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):
319 dnl This is really bare-bones.
320 dnl It at least checks request and reply serialization and deserialization.
321 dnl Actions definition listed in both supported formats (w/ actions=)
322 AT_SETUP([ofproto - add indirect group])
324 dnl indirect group must have exactly one bucket
325 AT_DATA([stderr], [dnl
326 OFPT_ERROR (OF1.1) (xid=0x2): OFPGMFC_INVALID_GROUP
327 OFPT_GROUP_MOD (OF1.1) (xid=0x2): ***decode error: OFPGMFC_INVALID_GROUP***
329 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn add-group br0 'group_id=1234,type=indirect'], [1], , [stderr])
330 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn add-group br0 'group_id=1235,type=indirect,bucket=output:10'])
331 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn add-group br0 'group_id=1236,type=indirect,bucket=output:10,bucket=output:11'], [1], , [stderr])
335 dnl This is really bare-bones.
336 dnl It at least checks request and reply serialization and deserialization.
337 dnl Actions definition listed in both supported formats (w/ actions=)
338 AT_SETUP([ofproto - del group (OpenFlow 1.5)])
340 AT_DATA([groups.txt], [dnl
341 group_id=1234,type=all,bucket=output:10,bucket=output:11
342 group_id=1235,type=all,bucket=actions=output:12,bucket=bucket_id:0,actions=output:10,bucket=bucket_id:1,actions=output:11
344 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn add-groups br0 groups.txt])
345 AT_CHECK([ovs-ofctl -F OXM-OpenFlow15 -O OpenFlow15 -vwarn dump-groups br0 1234], [0], [stdout])
346 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
347 OFPST_GROUP_DESC reply (OF1.5):
348 group_id=1234,type=all,bucket=bucket_id:0,actions=output:10,bucket=bucket_id:1,actions=output:11
350 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn del-groups br0 group_id=1234])
351 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-groups br0], [0], [stdout])
352 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
353 OFPST_GROUP_DESC reply (OF1.5):
354 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
356 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn del-groups br0 group_id=1234])
357 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-groups br0], [0], [stdout])
358 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
359 OFPST_GROUP_DESC reply (OF1.5):
360 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
362 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn del-groups br0], [0])
363 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-groups br0], [0], [stdout])
364 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
365 OFPST_GROUP_DESC reply (OF1.5):
370 dnl This is really bare-bones.
371 dnl It at least checks request and reply serialization and deserialization.
372 AT_SETUP([ofproto - del group deletes flows])
374 AT_DATA([groups.txt], [dnl
375 group_id=1234,type=all,bucket=output:10
376 group_id=1235,type=all,bucket=output:10
378 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn add-groups br0 groups.txt])
379 AT_DATA([flows.txt], [dnl
380 tcp actions=group:1234
381 udp actions=group:1235
383 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn add-flows br0 flows.txt])
384 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn dump-flows br0 | ofctl_strip | sort],
386 tcp actions=group:1234
387 udp actions=group:1235
388 OFPST_FLOW reply (OF1.1):
390 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn del-groups br0 group_id=1234])
391 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn dump-flows br0 | ofctl_strip | sort],
393 udp actions=group:1235
394 OFPST_FLOW reply (OF1.1):
396 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn del-groups br0 group_id=1234])
397 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn dump-flows br0 | ofctl_strip | sort],
399 udp actions=group:1235
400 OFPST_FLOW reply (OF1.1):
402 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn del-groups br0])
403 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn dump-flows br0 | ofctl_strip | sort],
405 OFPST_FLOW reply (OF1.1):
410 dnl This is really bare-bones.
411 dnl It at least checks request and reply serialization and deserialization.
412 dnl Actions definition listed in both supported formats (w/ actions=)
413 AT_SETUP([ofproto - insert buckets])
415 AT_DATA([groups.txt], [dnl
416 group_id=1234,type=all,bucket=bucket_id:10,actions=output:10,bucket=bucket_id:11,actions=output:11
418 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn add-groups br0 groups.txt])
419 AT_CHECK([ovs-ofctl -F OXM-OpenFlow15 -O OpenFlow15 -vwarn dump-groups br0 1234], [0], [stdout])
420 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
421 OFPST_GROUP_DESC reply (OF1.5):
422 group_id=1234,type=all,bucket=bucket_id:10,actions=output:10,bucket=bucket_id:11,actions=output:11
424 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])
425 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-groups br0], [0], [stdout])
426 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
427 OFPST_GROUP_DESC reply (OF1.5):
428 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
430 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])
431 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-groups br0], [0], [stdout])
432 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
433 OFPST_GROUP_DESC reply (OF1.5):
434 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
436 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn insert-buckets br0 group_id=1234,command_bucket_id=15])
437 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-groups br0], [0], [stdout])
438 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
439 OFPST_GROUP_DESC reply (OF1.5):
440 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
442 AT_DATA([buckets.txt], [dnl
443 group_id=1234,command_bucket_id=11,bucket=bucket_id:12,actions=output:12,bucket=bucket_id:13,actions=output:13
445 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn insert-buckets br0 - < buckets.txt])
446 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-groups br0], [0], [stdout])
447 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
448 OFPST_GROUP_DESC reply (OF1.5):
449 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
451 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])
452 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-groups br0], [0], [stdout])
453 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
454 OFPST_GROUP_DESC reply (OF1.5):
455 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
460 dnl This is really bare-bones.
461 dnl It at least checks request and reply serialization and deserialization.
462 dnl Actions definition listed in both supported formats (w/ actions=)
463 AT_SETUP([ofproto - remove buckets])
465 AT_DATA([groups.txt], [dnl
466 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
468 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn add-groups br0 groups.txt])
469 AT_CHECK([ovs-ofctl -F OXM-OpenFlow15 -O OpenFlow15 -vwarn dump-groups br0 1234], [0], [stdout])
470 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
471 OFPST_GROUP_DESC reply (OF1.5):
472 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
474 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn remove-buckets br0 group_id=1234,command_bucket_id=first])
475 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-groups br0], [0], [stdout])
476 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
477 OFPST_GROUP_DESC reply (OF1.5):
478 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
480 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn remove-buckets br0 group_id=1234,command_bucket_id=last])
481 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-groups br0], [0], [stdout])
482 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
483 OFPST_GROUP_DESC reply (OF1.5):
484 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
486 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn remove-buckets br0 group_id=1234,command_bucket_id=13])
487 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-groups br0], [0], [stdout])
488 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
489 OFPST_GROUP_DESC reply (OF1.5):
490 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
492 AT_DATA([buckets.txt], [dnl
495 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn remove-buckets br0 - < buckets.txt])
496 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-groups br0], [0], [stdout])
497 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
498 OFPST_GROUP_DESC reply (OF1.5):
499 group_id=1234,type=all
501 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn remove-buckets br0 group_id=1234,command_bucket_id=first])
502 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn remove-buckets br0 group_id=1234,command_bucket_id=last])
503 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn remove-buckets br0 group_id=1234,command_bucket_id=all])
504 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn remove-buckets br0 group_id=1234,command_bucket_id=1], [1], [], [stderr])
505 AT_CHECK([cat stderr | ofctl_strip], [0], [dnl
506 OFPT_ERROR (OF1.5): OFPGMFC_UNKNOWN_BUCKET
507 OFPT_GROUP_MOD (OF1.5):
508 REMOVE_BUCKET command_bucket_id:1,group_id=1234
513 dnl This is really bare-bones.
514 dnl It at least checks request and reply serialization and deserialization.
515 AT_SETUP([ofproto - flow mod checks group availability])
517 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn add-group br0 group_id=1234,type=all,bucket=output:10])
518 AT_DATA([flows.txt], [dnl
519 tcp actions=group:1234
520 udp actions=group:1235
522 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn add-flow br0 'tcp actions=group:1234'])
523 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn add-flow br0 'tcp actions=group:1235'], [1], [], [stderr])
525 # The output should look like this:
527 # 00000000 02 0e 00 98 00 00 00 02-00 00 00 00 00 00 00 00 |................|
528 # 00000010 00 00 00 00 00 00 00 00-ff 00 00 00 00 00 80 00 |................|
529 # 00000020 ff ff ff ff ff ff ff ff-ff ff ff ff 00 00 00 00 |................|
530 # 00000030 00 00 00 58 00 00 00 00-00 00 03 d7 00 00 00 00 |...X............|
532 # This 'sed' command captures the error message but drops details.
533 AT_CHECK([sed '/truncated/d
534 /^000000.0/d' stderr | STRIP_XIDS], [0],
535 [OFPT_ERROR (OF1.1): OFPBAC_BAD_OUT_GROUP
536 OFPT_FLOW_MOD (OF1.1):
541 dnl This is really bare-bones.
542 dnl It at least checks request and reply serialization and deserialization.
543 AT_SETUP([ofproto - group description])
545 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn add-group br0 group_id=1234,type=all,bucket=output:10], [0], [stdout])
546 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn dump-groups br0], [0], [stdout])
547 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
548 OFPST_GROUP_DESC reply (OF1.1):
549 group_id=1234,type=all,bucket=actions=output:10
554 dnl This is really bare-bones.
555 dnl It at least checks request and reply serialization and deserialization.
556 AT_SETUP([ofproto - group description])
558 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn add-group br0 group_id=1234,type=all,bucket=output:10])
559 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn dump-groups br0], [0], [stdout])
560 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
561 OFPST_GROUP_DESC reply (OF1.1):
562 group_id=1234,type=all,bucket=actions=output:10
567 dnl This is really bare-bones.
568 dnl It at least checks request and reply serialization and deserialization.
569 AT_SETUP([ofproto - group features])
571 AT_CHECK([ovs-ofctl -O OpenFlow12 -vwarn dump-group-features br0], [0], [stdout])
572 AT_CHECK([STRIP_XIDS stdout], [0], [dnl
573 OFPST_GROUP_FEATURES reply (OF1.2):
578 max_groups=0xffffff00
579 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
581 max_groups=0xffffff00
582 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
584 max_groups=0xffffff00
585 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
587 max_groups=0xffffff00
588 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
593 dnl This is really bare-bones.
594 dnl It at least checks request and reply serialization and deserialization.
595 AT_SETUP([ofproto - group stats (OpenFlow 1.1)])
597 AT_DATA([groups.txt], [dnl
598 group_id=1234,type=all,bucket=output:10
599 group_id=1235,type=all,bucket=output:10
601 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn add-groups br0 groups.txt])
602 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn add-flow br0 'tcp actions=group:1234'])
603 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn dump-group-stats br0 group_id=1234], [0], [stdout])
604 AT_CHECK([STRIP_XIDS stdout | sort], [0], [dnl
605 group_id=1234,ref_count=1,packet_count=0,byte_count=0,bucket0:packet_count=0,byte_count=0
606 OFPST_GROUP reply (OF1.1):
608 AT_CHECK([ovs-ofctl -O OpenFlow11 -vwarn dump-group-stats br0], [0], [stdout])
609 AT_CHECK([STRIP_XIDS stdout | sort], [0], [dnl
610 group_id=1234,ref_count=1,packet_count=0,byte_count=0,bucket0:packet_count=0,byte_count=0
611 group_id=1235,ref_count=0,packet_count=0,byte_count=0,bucket0:packet_count=0,byte_count=0
612 OFPST_GROUP reply (OF1.1):
617 dnl This is really bare-bones.
618 dnl It at least checks request and reply serialization and deserialization.
619 AT_SETUP([ofproto - group stats (OpenFlow 1.3)])
621 AT_DATA([groups.txt], [dnl
622 group_id=1234,type=all,bucket=output:10
623 group_id=1235,type=all,bucket=output:10
625 AT_CHECK([ovs-ofctl -O OpenFlow13 -vwarn add-groups br0 groups.txt])
626 AT_CHECK([ovs-ofctl -O OpenFlow13 -vwarn add-flow br0 'tcp actions=group:1234'])
627 AT_CHECK([ovs-ofctl -O OpenFlow13 -vwarn dump-group-stats br0 group_id=1234], [0], [stdout])
628 AT_CHECK([STRIP_XIDS stdout | sed 's/duration=[[0-9.]]*s/duration=?s/' | sort], [0], [dnl
629 group_id=1234,duration=?s,ref_count=1,packet_count=0,byte_count=0,bucket0:packet_count=0,byte_count=0
630 OFPST_GROUP reply (OF1.3):
632 AT_CHECK([ovs-ofctl -O OpenFlow13 -vwarn dump-group-stats br0], [0], [stdout])
633 AT_CHECK([STRIP_XIDS stdout | sed 's/duration=[[0-9.]]*s/duration=?s/' | sort], [0], [dnl
634 group_id=1234,duration=?s,ref_count=1,packet_count=0,byte_count=0,bucket0:packet_count=0,byte_count=0
635 group_id=1235,duration=?s,ref_count=0,packet_count=0,byte_count=0,bucket0:packet_count=0,byte_count=0
636 OFPST_GROUP reply (OF1.3):
641 dnl This is really bare-bones.
642 dnl It at least checks request and reply serialization and deserialization.
643 AT_SETUP([ofproto - group stats (OpenFlow 1.5)])
645 AT_DATA([groups.txt], [dnl
646 group_id=1234,type=all,bucket=output:10
647 group_id=1235,type=all,bucket=output:10
649 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn add-groups br0 groups.txt])
650 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn add-flow br0 'tcp actions=group:1234'])
651 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-group-stats br0 group_id=1234], [0], [stdout])
652 AT_CHECK([STRIP_XIDS stdout | sed 's/duration=[[0-9.]]*s/duration=?s/' | sort], [0], [dnl
653 group_id=1234,duration=?s,ref_count=1,packet_count=0,byte_count=0,bucket0:packet_count=0,byte_count=0
654 OFPST_GROUP reply (OF1.5):
656 AT_CHECK([ovs-ofctl -O OpenFlow15 -vwarn dump-group-stats br0], [0], [stdout])
657 AT_CHECK([STRIP_XIDS stdout | sed 's/duration=[[0-9.]]*s/duration=?s/' | sort], [0], [dnl
658 group_id=1234,duration=?s,ref_count=1,packet_count=0,byte_count=0,bucket0:packet_count=0,byte_count=0
659 group_id=1235,duration=?s,ref_count=0,packet_count=0,byte_count=0,bucket0:packet_count=0,byte_count=0
660 OFPST_GROUP reply (OF1.5):
665 AT_SETUP([ofproto - mod-port (OpenFlow 1.0)])
667 for command_config_state in \
669 'noflood NO_FLOOD 0' \
670 'down PORT_DOWN,NO_FLOOD LINK_DOWN' \
671 'flood PORT_DOWN LINK_DOWN' \
672 'no-receive PORT_DOWN,NO_RECV LINK_DOWN' \
673 'no-forward PORT_DOWN,NO_RECV,NO_FWD LINK_DOWN' \
674 'no-packet-in PORT_DOWN,NO_RECV,NO_FWD,NO_PACKET_IN LINK_DOWN' \
675 'forward PORT_DOWN,NO_RECV,NO_PACKET_IN LINK_DOWN' \
676 'packet-in PORT_DOWN,NO_RECV LINK_DOWN' \
680 set $command_config_state
681 command=$[1] config=`echo $[2] | sed 's/,/ /g'` state=$[3]
682 AT_CHECK([ovs-ofctl -vwarn mod-port br0 br0 $command])
683 AT_CHECK([ovs-ofctl -vwarn show br0], [0], [stdout])
684 AT_CHECK_UNQUOTED([STRIP_XIDS stdout], [0], [dnl
685 OFPT_FEATURES_REPLY: dpid:fedcba9876543210
686 n_tables:254, n_buffers:256
687 capabilities: FLOW_STATS TABLE_STATS PORT_STATS QUEUE_STATS ARP_MATCH_IP
688 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
689 LOCAL(br0): addr:aa:55:aa:55:00:00
692 speed: 0 Mbps now, 0 Mbps max
693 OFPT_GET_CONFIG_REPLY: frags=normal miss_send_len=0
699 AT_SETUP([ofproto - mod-port (OpenFlow 1.2)])
701 for command_config_state in \
703 'down PORT_DOWN LINK_DOWN' \
704 'no-receive PORT_DOWN,NO_RECV LINK_DOWN' \
705 'no-forward PORT_DOWN,NO_RECV,NO_FWD LINK_DOWN' \
706 'no-packet-in PORT_DOWN,NO_RECV,NO_FWD,NO_PACKET_IN LINK_DOWN' \
707 'forward PORT_DOWN,NO_RECV,NO_PACKET_IN LINK_DOWN' \
708 'packet-in PORT_DOWN,NO_RECV LINK_DOWN' \
712 set $command_config_state
713 command=$[1] config=`echo $[2] | sed 's/,/ /g'` state=$[3]
714 AT_CHECK([ovs-ofctl -O OpenFlow12 -vwarn mod-port br0 br0 $command])
715 AT_CHECK([ovs-ofctl -O OpenFlow12 -vwarn show br0], [0], [stdout])
716 AT_CHECK_UNQUOTED([STRIP_XIDS stdout], [0], [dnl
717 OFPT_FEATURES_REPLY (OF1.2): dpid:fedcba9876543210
718 n_tables:254, n_buffers:256
719 capabilities: FLOW_STATS TABLE_STATS PORT_STATS GROUP_STATS QUEUE_STATS
720 LOCAL(br0): addr:aa:55:aa:55:00:00
723 speed: 0 Mbps now, 0 Mbps max
724 OFPT_GET_CONFIG_REPLY (OF1.2): frags=normal miss_send_len=0
730 AT_SETUP([ofproto - mod-port (OpenFlow 1.4)])
732 for command_config_state in \
734 'down PORT_DOWN LINK_DOWN' \
735 'no-receive PORT_DOWN,NO_RECV LINK_DOWN' \
736 'no-forward PORT_DOWN,NO_RECV,NO_FWD LINK_DOWN' \
737 'no-packet-in PORT_DOWN,NO_RECV,NO_FWD,NO_PACKET_IN LINK_DOWN' \
738 'forward PORT_DOWN,NO_RECV,NO_PACKET_IN LINK_DOWN' \
739 'packet-in PORT_DOWN,NO_RECV LINK_DOWN' \
743 set $command_config_state
744 command=$[1] config=`echo $[2] | sed 's/,/ /g'` state=$[3]
745 AT_CHECK([ovs-ofctl -O OpenFlow14 -vwarn mod-port br0 br0 $command])
746 AT_CHECK([ovs-ofctl -O OpenFlow14 -vwarn show br0], [0], [stdout])
747 AT_CHECK_UNQUOTED([STRIP_XIDS stdout], [0], [dnl
748 OFPT_FEATURES_REPLY (OF1.4): dpid:fedcba9876543210
749 n_tables:254, n_buffers:256
750 capabilities: FLOW_STATS TABLE_STATS PORT_STATS GROUP_STATS QUEUE_STATS
751 OFPST_PORT_DESC reply (OF1.4):
752 LOCAL(br0): addr:aa:55:aa:55:00:00
755 speed: 0 Mbps now, 0 Mbps max
756 OFPT_GET_CONFIG_REPLY (OF1.4): frags=normal miss_send_len=0
762 AT_SETUP([ofproto - basic flow_mod commands (NXM)])
764 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip], [0], [NXST_FLOW reply:
766 AT_CHECK([echo 'in_port=2,actions=1' | ovs-ofctl add-flows br0 -])
767 AT_CHECK([ovs-ofctl add-flow br0 in_port=1,actions=2])
768 AT_CHECK([ovs-ofctl -F nxm add-flow br0 table=1,in_port=4,actions=3])
769 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
770 in_port=1 actions=output:2
771 in_port=2 actions=output:1
772 table=1, in_port=4 actions=output:3
775 AT_CHECK([ovs-ofctl dump-aggregate br0 table=0 | STRIP_XIDS], [0], [dnl
776 NXST_AGGREGATE reply: packet_count=0 byte_count=0 flow_count=2
778 AT_CHECK([ovs-ofctl del-flows br0])
779 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip], [0], [NXST_FLOW reply:
784 AT_SETUP([ofproto - basic flow_mod commands (OpenFlow 1.0)])
786 AT_CHECK([ovs-ofctl -F openflow10 dump-flows br0 | ofctl_strip], [0], [OFPST_FLOW reply:
788 AT_CHECK([echo 'in_port=2,actions=1' | ovs-ofctl -F openflow10 add-flows br0 -])
789 AT_CHECK([ovs-ofctl -F openflow10 add-flow br0 in_port=1,actions=2])
790 AT_CHECK([ovs-ofctl -F openflow10 add-flow br0 table=1,in_port=4,actions=3])
791 AT_CHECK([ovs-ofctl -F openflow10 dump-flows br0 | ofctl_strip | sort], [0], [dnl
792 in_port=1 actions=output:2
793 in_port=2 actions=output:1
794 table=1, in_port=4 actions=output:3
797 AT_CHECK([ovs-ofctl -F openflow10 dump-aggregate br0 table=0 | STRIP_XIDS], [0], [dnl
798 OFPST_AGGREGATE reply: packet_count=0 byte_count=0 flow_count=2
800 AT_CHECK([ovs-ofctl -F openflow10 del-flows br0])
801 AT_CHECK([ovs-ofctl -F openflow10 dump-flows br0 | ofctl_strip], [0], [OFPST_FLOW reply:
806 AT_SETUP([ofproto - basic flow_mod commands (OpenFlow 1.1)])
808 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip], [0], [OFPST_FLOW reply (OF1.1):
810 AT_CHECK([echo 'in_port=2,actions=1' | ovs-ofctl -O OpenFlow11 add-flows br0 -])
811 AT_CHECK([ovs-ofctl -O OpenFlow11 add-flow br0 in_port=1,actions=2])
812 AT_CHECK([ovs-ofctl -O OpenFlow11 add-flow br0 table=1,in_port=4,actions=3])
813 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort], [0], [dnl
814 in_port=1 actions=output:2
815 in_port=2 actions=output:1
816 table=1, in_port=4 actions=output:3
817 OFPST_FLOW reply (OF1.1):
819 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-aggregate br0 table=0 | STRIP_XIDS], [0], [dnl
820 OFPST_AGGREGATE reply (OF1.1): packet_count=0 byte_count=0 flow_count=2
822 AT_CHECK([ovs-ofctl -O OpenFlow11 del-flows br0])
823 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip], [0], [OFPST_FLOW reply (OF1.1):
824 table=1, in_port=4 actions=output:3
829 AT_SETUP([ofproto - flow_mod negative test (OpenFlow 1.1)])
831 [set bridge br0 protocols=OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13])
832 AT_CHECK([ovs-ofctl add-flow -O OpenFlow11 br0 table=1,action=goto_table:2])
834 # The error message here actually comes from ovs-ofctl, not from ovs-vswitchd,
835 # but at least it's the same code in ofpacts_check() that issues the error.
836 AT_CHECK([ovs-ofctl add-flow -O OpenFlow11 br0 table=1,action=goto_table:1],
838 [ovs-ofctl: actions are invalid with specified match (OFPBIC_BAD_TABLE_ID)
843 AT_SETUP([ofproto - set-field flow_mod commands (NXM)])
845 AT_CHECK([ovs-ofctl add-flow br0 ipv6,table=1,in_port=3,actions=drop])
846 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])
847 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
848 table=1, ipv6,in_port=3 actions=load:0xa6badbfffefe59fa->NXM_NX_IPV6_SRC[[0..63]],load:0xfe8001234567890a->NXM_NX_IPV6_SRC[[64..127]]
854 AT_SETUP([ofproto - basic flow_mod commands (OpenFlow 1.2)])
856 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip], [0], [OFPST_FLOW reply (OF1.2):
858 AT_CHECK([echo 'in_port=2,actions=1' | ovs-ofctl -O OpenFlow12 add-flows br0 -])
859 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 in_port=1,actions=2])
860 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 table=1,in_port=4,actions=3])
861 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
862 in_port=1 actions=output:2
863 in_port=2 actions=output:1
864 table=1, in_port=4 actions=output:3
865 OFPST_FLOW reply (OF1.2):
867 AT_CHECK([ovs-ofctl -O OpenFlow12 del-flows br0])
868 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip], [0], [OFPST_FLOW reply (OF1.2):
873 AT_SETUP([ofproto - dump flows with cookie])
875 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x1,in_port=1,actions=1])
876 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x2,in_port=2,actions=1])
877 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x3,in_port=3,actions=1])
878 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
879 cookie=0x1, in_port=1 actions=output:1
880 cookie=0x2, in_port=2 actions=output:1
881 cookie=0x3, in_port=3 actions=output:1
884 AT_CHECK([ovs-ofctl dump-aggregate br0 table=0 | STRIP_XIDS], [0], [dnl
885 NXST_AGGREGATE reply: packet_count=0 byte_count=0 flow_count=3
887 AT_CHECK([ovs-ofctl dump-flows br0 cookie=0x3/-1 | ofctl_strip | sort], [0], [dnl
888 cookie=0x3, in_port=3 actions=output:1
891 AT_CHECK([ovs-ofctl dump-aggregate br0 cookie=0x3/-1 | STRIP_XIDS], [0], [dnl
892 NXST_AGGREGATE reply: packet_count=0 byte_count=0 flow_count=1
897 AT_SETUP([ofproto - mod flow with cookie change (OpenFlow 1.0)])
899 AT_CHECK([ovs-ofctl -F openflow10 add-flow br0 cookie=0x1,in_port=1,actions=1])
900 AT_CHECK([ovs-ofctl -F openflow10 dump-flows br0 | ofctl_strip | sort], [0], [dnl
901 cookie=0x1, in_port=1 actions=output:1
905 AT_CHECK([ovs-ofctl -F openflow10 mod-flows br0 cookie=0x2,in_port=1,actions=1])
906 AT_CHECK([ovs-ofctl -F openflow10 dump-flows br0 | ofctl_strip | sort], [0], [dnl
907 cookie=0x2, in_port=1 actions=output:1
913 AT_SETUP([ofproto - mod flow with cookie change (NXM)])
915 AT_CHECK([ovs-ofctl -F nxm add-flow br0 cookie=0x1,in_port=1,actions=1])
916 AT_CHECK([ovs-ofctl -F nxm dump-flows br0 | ofctl_strip | sort], [0], [dnl
917 cookie=0x1, in_port=1 actions=output:1
921 AT_CHECK([ovs-ofctl -F nxm mod-flows br0 cookie=0x2,in_port=1,actions=1])
922 AT_CHECK([ovs-ofctl -F nxm dump-flows br0 | ofctl_strip | sort], [0], [dnl
923 cookie=0x2, in_port=1 actions=output:1
929 AT_SETUP([ofproto - no mod flow with cookie change (OpenFlow 1.1)])
931 AT_CHECK([ovs-ofctl -O OpenFlow11 add-flow br0 cookie=0x1,in_port=1,actions=1])
932 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort], [0], [dnl
933 cookie=0x1, in_port=1 actions=output:1
934 OFPST_FLOW reply (OF1.1):
936 AT_CHECK([ovs-ofctl -O OpenFlow11 mod-flows br0 cookie=0x2,in_port=1,actions=1])
937 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort], [0], [dnl
938 cookie=0x1, in_port=1 actions=output:1
939 OFPST_FLOW reply (OF1.1):
944 dnl The OpenFlow 1.2 spec states that the cookie may not be modified
945 AT_SETUP([ofproto - no mod flow with cookie change (OpenFlow 1.2)])
947 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 cookie=0x1,in_port=1,actions=1])
948 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
949 cookie=0x1, in_port=1 actions=output:1
950 OFPST_FLOW reply (OF1.2):
953 AT_CHECK([ovs-ofctl -O OpenFlow12 mod-flows br0 cookie=0x2,in_port=1,actions=1])
954 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
955 cookie=0x1, in_port=1 actions=output:1
956 OFPST_FLOW reply (OF1.2):
961 AT_SETUP([ofproto - mod flows based on cookie mask (OpenFlow 1.0)])
963 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x1,in_port=1,actions=1])
964 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x1,in_port=2,actions=1])
965 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x2,in_port=3,actions=1])
966 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
967 cookie=0x1, in_port=1 actions=output:1
968 cookie=0x1, in_port=2 actions=output:1
969 cookie=0x2, in_port=3 actions=output:1
973 AT_CHECK([ovs-ofctl -F nxm mod-flows br0 cookie=0x1/0xff,actions=4])
974 AT_CHECK([ovs-ofctl -F nxm dump-flows br0 | ofctl_strip | sort], [0], [dnl
975 cookie=0x1, in_port=1 actions=output:4
976 cookie=0x1, in_port=2 actions=output:4
977 cookie=0x2, in_port=3 actions=output:1
983 AT_SETUP([ofproto - mod flows based on cookie mask (OpenFlow 1.1)])
985 AT_CHECK([ovs-ofctl -O OpenFlow11 add-flow br0 cookie=0x1,in_port=1,actions=1])
986 AT_CHECK([ovs-ofctl -O OpenFlow11 add-flow br0 cookie=0x1,in_port=2,actions=1])
987 AT_CHECK([ovs-ofctl -O OpenFlow11 add-flow br0 cookie=0x2,in_port=3,actions=1])
988 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort], [0], [dnl
989 cookie=0x1, in_port=1 actions=output:1
990 cookie=0x1, in_port=2 actions=output:1
991 cookie=0x2, in_port=3 actions=output:1
992 OFPST_FLOW reply (OF1.1):
995 AT_CHECK([ovs-ofctl -O OpenFlow11 mod-flows br0 cookie=0x1/0xff,actions=4])
996 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort], [0], [dnl
997 cookie=0x1, in_port=1 actions=output:4
998 cookie=0x1, in_port=2 actions=output:4
999 cookie=0x2, in_port=3 actions=output:1
1000 OFPST_FLOW reply (OF1.1):
1005 AT_SETUP([ofproto - mod flows based on cookie mask (OpenFlow 1.2)])
1007 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 cookie=0x1,in_port=1,actions=1])
1008 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 cookie=0x1,in_port=2,actions=1])
1009 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 cookie=0x2,in_port=3,actions=1])
1010 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1011 cookie=0x1, in_port=1 actions=output:1
1012 cookie=0x1, in_port=2 actions=output:1
1013 cookie=0x2, in_port=3 actions=output:1
1014 OFPST_FLOW reply (OF1.2):
1017 AT_CHECK([ovs-ofctl -O OpenFlow12 mod-flows br0 cookie=0x1/0xff,actions=4])
1018 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1019 cookie=0x1, in_port=1 actions=output:4
1020 cookie=0x1, in_port=2 actions=output:4
1021 cookie=0x2, in_port=3 actions=output:1
1022 OFPST_FLOW reply (OF1.2):
1027 dnl The OpenFlow 1.2 spec states that the cookie may not be modified
1028 AT_SETUP([ofproto - mod flows based on cookie mask with cookie change])
1030 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x1,in_port=1,actions=1])
1031 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x1,in_port=2,actions=1])
1032 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x2,in_port=3,actions=1])
1033 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1034 cookie=0x1, in_port=1 actions=output:1
1035 cookie=0x1, in_port=2 actions=output:1
1036 cookie=0x2, in_port=3 actions=output:1
1040 AT_CHECK([ovs-ofctl -F nxm mod-flows br0 cookie=1/-1,cookie=4,actions=4])
1041 AT_CHECK([ovs-ofctl -F nxm dump-flows br0 | ofctl_strip | sort], [0], [dnl
1042 cookie=0x2, in_port=3 actions=output:1
1043 cookie=0x4, in_port=1 actions=output:4
1044 cookie=0x4, in_port=2 actions=output:4
1050 AT_SETUP([ofproto - mod flow with cookie miss (mask==0) - NXM])
1052 AT_CHECK([ovs-ofctl -F nxm mod-flows br0 in_port=1,actions=1])
1053 AT_CHECK([ovs-ofctl -F nxm dump-flows br0 | ofctl_strip | sort], [0], [dnl
1054 in_port=1 actions=output:1
1060 AT_SETUP([ofproto - mod flow with cookie miss (mask==0) - OF1.1])
1062 AT_CHECK([ovs-ofctl -O openflow11 mod-flows br0 in_port=1,actions=1])
1063 AT_CHECK([ovs-ofctl -O openflow11 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1064 in_port=1 actions=output:1
1065 OFPST_FLOW reply (OF1.1):
1070 AT_SETUP([ofproto - mod flow with cookie miss (mask==0) - OF1.2])
1072 AT_CHECK([ovs-ofctl -O openflow12 mod-flows br0 in_port=1,actions=1])
1073 AT_CHECK([ovs-ofctl -O openflow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1074 OFPST_FLOW reply (OF1.2):
1079 AT_SETUP([ofproto - mod flow with cookie miss (mask!=0) - NXM])
1081 AT_CHECK([ovs-ofctl -F nxm mod-flows br0 cookie=1/1,in_port=1,actions=1])
1082 AT_CHECK([ovs-ofctl -F nxm dump-flows br0 | ofctl_strip | sort], [0], [dnl
1088 AT_SETUP([ofproto - mod flow with cookie miss (mask!=0) - OF1.1])
1090 AT_CHECK([ovs-ofctl -O openflow11 mod-flows br0 cookie=1/1,in_port=1,actions=1])
1091 AT_CHECK([ovs-ofctl -O openflow11 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1092 OFPST_FLOW reply (OF1.1):
1097 AT_SETUP([ofproto - mod flow with cookie miss (mask!=0) - OF1.2])
1099 AT_CHECK([ovs-ofctl -O openflow12 mod-flows br0 cookie=1/1,in_port=1,actions=1])
1100 AT_CHECK([ovs-ofctl -O openflow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1101 OFPST_FLOW reply (OF1.2):
1106 AT_SETUP([ofproto - del flows with cookies])
1108 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x1,in_port=1,actions=1])
1109 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x2,in_port=2,actions=1])
1110 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x3,in_port=3,actions=1])
1111 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1112 cookie=0x1, in_port=1 actions=output:1
1113 cookie=0x2, in_port=2 actions=output:1
1114 cookie=0x3, in_port=3 actions=output:1
1118 AT_CHECK([ovs-ofctl del-flows br0])
1119 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1125 AT_SETUP([ofproto - del flows based on cookie])
1127 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x1,in_port=1,actions=1])
1128 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x2,in_port=2,actions=1])
1129 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x3,in_port=3,actions=1])
1130 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1131 cookie=0x1, in_port=1 actions=output:1
1132 cookie=0x2, in_port=2 actions=output:1
1133 cookie=0x3, in_port=3 actions=output:1
1137 AT_CHECK([ovs-ofctl del-flows br0 cookie=0x3/-1])
1138 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1139 cookie=0x1, in_port=1 actions=output:1
1140 cookie=0x2, in_port=2 actions=output:1
1146 AT_SETUP([ofproto - del flows based on cookie mask])
1148 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x1,in_port=1,actions=1])
1149 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x2,in_port=2,actions=1])
1150 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x3,in_port=3,actions=1])
1151 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1152 cookie=0x1, in_port=1 actions=output:1
1153 cookie=0x2, in_port=2 actions=output:1
1154 cookie=0x3, in_port=3 actions=output:1
1157 AT_CHECK([ovs-ofctl del-flows br0 cookie=0x3/0x1])
1158 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1159 cookie=0x2, in_port=2 actions=output:1
1165 AT_SETUP([ofproto - del flows based on table id (NXM)])
1167 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x1,in_port=1,actions=1])
1168 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x2,in_port=2,table=1,actions=1])
1169 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1170 cookie=0x1, in_port=1 actions=output:1
1171 cookie=0x2, table=1, in_port=2 actions=output:1
1174 AT_CHECK([ovs-ofctl del-flows br0 table=0])
1175 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1176 cookie=0x2, table=1, in_port=2 actions=output:1
1179 AT_CHECK([ovs-ofctl del-flows br0 table=1])
1180 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1183 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x1,in_port=1,actions=1])
1184 AT_CHECK([ovs-ofctl add-flow br0 cookie=0x2,in_port=2,table=1,actions=1])
1185 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1186 cookie=0x1, in_port=1 actions=output:1
1187 cookie=0x2, table=1, in_port=2 actions=output:1
1190 AT_CHECK([ovs-ofctl del-flows br0])
1191 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1197 AT_SETUP([ofproto - del flows based on table id (OpenFlow 1.1)])
1199 AT_CHECK([ovs-ofctl -O OpenFlow11 add-flow br0 cookie=0x1,in_port=1,actions=1])
1200 AT_CHECK([ovs-ofctl -O OpenFlow11 add-flow br0 cookie=0x2,in_port=2,table=1,actions=1])
1201 AT_CHECK([ovs-ofctl -O OpenFlow11 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
1204 OFPST_FLOW reply (OF1.1):
1206 AT_CHECK([ovs-ofctl -O OpenFlow11 del-flows br0 table=0])
1207 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1208 cookie=0x2, table=1, in_port=2 actions=output:1
1209 OFPST_FLOW reply (OF1.1):
1211 AT_CHECK([ovs-ofctl -O OpenFlow11 del-flows br0 table=1])
1212 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1213 OFPST_FLOW reply (OF1.1):
1215 AT_CHECK([ovs-ofctl -O OpenFlow11 add-flow br0 cookie=0x1,in_port=1,actions=1])
1216 AT_CHECK([ovs-ofctl -O OpenFlow11 add-flow br0 cookie=0x2,in_port=2,table=1,actions=1])
1217 AT_CHECK([ovs-ofctl -O OpenFlow11 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
1220 OFPST_FLOW reply (OF1.1):
1222 AT_CHECK([ovs-ofctl -O OpenFlow11 del-flows br0])
1223 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip], [0], [dnl
1224 OFPST_FLOW reply (OF1.1):
1225 cookie=0x2, table=1, in_port=2 actions=output:1
1230 AT_SETUP([ofproto - del flows based on table id (OpenFlow 1.2)])
1232 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 cookie=0x1,in_port=1,actions=1])
1233 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 cookie=0x2,in_port=2,table=1,actions=1])
1234 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1235 cookie=0x1, in_port=1 actions=output:1
1236 cookie=0x2, table=1, in_port=2 actions=output:1
1237 OFPST_FLOW reply (OF1.2):
1239 AT_CHECK([ovs-ofctl -O OpenFlow12 del-flows br0 table=0])
1240 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1241 cookie=0x2, table=1, in_port=2 actions=output:1
1242 OFPST_FLOW reply (OF1.2):
1244 AT_CHECK([ovs-ofctl -O OpenFlow12 del-flows br0 table=1])
1245 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1246 OFPST_FLOW reply (OF1.2):
1248 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 cookie=0x1,in_port=1,actions=1])
1249 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 cookie=0x2,in_port=2,table=1,actions=1])
1250 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1251 cookie=0x1, in_port=1 actions=output:1
1252 cookie=0x2, table=1, in_port=2 actions=output:1
1253 OFPST_FLOW reply (OF1.2):
1255 AT_CHECK([ovs-ofctl -O OpenFlow12 del-flows br0])
1256 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1257 OFPST_FLOW reply (OF1.2):
1262 AT_SETUP([ofproto - flow table configuration (OpenFlow 1.0)])
1264 # Check the default configuration.
1265 (printf "OFPST_TABLE reply (xid=0x2):"
1268 while test $x -lt 254; do
1271 active=0, lookup=0, matched=0
1274 in_port: exact match or wildcard
1275 eth_src: exact match or wildcard
1276 eth_dst: exact match or wildcard
1277 eth_type: exact match or wildcard
1278 vlan_vid: exact match or wildcard
1279 vlan_pcp: exact match or wildcard
1280 ip_src: exact match or wildcard
1281 ip_dst: exact match or wildcard
1282 nw_proto: exact match or wildcard
1283 nw_tos: exact match or wildcard
1284 tcp_src: exact match or wildcard
1285 tcp_dst: exact match or wildcard
1290 AT_CHECK([ovs-ofctl dump-tables br0], [0], [expout])
1291 # Change the configuration.
1294 -- --id=@t0 create Flow_Table name=main \
1295 -- --id=@t1 create Flow_Table flow-limit=1024 \
1296 -- set bridge br0 'flow_tables={1=@t1,0=@t0}' \
1297 | ${PERL} $srcdir/uuidfilt.pl],
1301 # Check that the configuration was updated.
1302 mv expout orig-expout
1303 sed -e 's/classifier/main/
1304 21s/1000000/1024/' orig-expout > expout
1305 AT_CHECK([ovs-ofctl dump-tables br0], [0], [expout])
1309 AT_SETUP([ofproto - flow table configuration (OpenFlow 1.2)])
1311 # Check the default configuration.
1312 (printf "OFPST_TABLE reply (OF1.2) (xid=0x2):"
1315 while test $x -lt 254; do
1317 table $x (\"$name\"):
1318 active=0, lookup=0, matched=0
1319 metadata: match=0xffffffffffffffff write=0xffffffffffffffff
1322 instructions (table miss and others):
1323 instructions: apply_actions,clear_actions,write_actions,write_metadata,goto_table
1324 Write-Actions and Apply-Actions features:
1325 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
1326 supported on Set-Field: metadata in_port_oxm eth_src eth_dst vlan_vid vlan_pcp mpls_label mpls_tc ip_src ip_dst ipv6_src ipv6_dst ip_dscp nw_ecn arp_op arp_spa arp_tpa arp_sha arp_tha tcp_src tcp_dst udp_src udp_dst sctp_src sctp_dst
1328 metadata: exact match or wildcard
1329 in_port_oxm: exact match or wildcard
1330 eth_src: exact match or wildcard
1331 eth_dst: exact match or wildcard
1332 eth_type: exact match or wildcard
1333 vlan_vid: exact match or wildcard
1334 vlan_pcp: exact match or wildcard
1335 mpls_label: exact match or wildcard
1336 mpls_tc: exact match or wildcard
1337 ip_src: exact match or wildcard
1338 ip_dst: exact match or wildcard
1339 ipv6_src: exact match or wildcard
1340 ipv6_dst: exact match or wildcard
1341 ipv6_label: exact match or wildcard
1342 nw_proto: exact match or wildcard
1343 ip_dscp: exact match or wildcard
1344 nw_ecn: exact match or wildcard
1345 arp_op: exact match or wildcard
1346 arp_spa: exact match or wildcard
1347 arp_tpa: exact match or wildcard
1348 arp_sha: exact match or wildcard
1349 arp_tha: exact match or wildcard
1350 tcp_src: exact match or wildcard
1351 tcp_dst: exact match or wildcard
1352 udp_src: exact match or wildcard
1353 udp_dst: exact match or wildcard
1354 sctp_src: exact match or wildcard
1355 sctp_dst: exact match or wildcard
1356 icmp_type: exact match or wildcard
1357 icmp_code: exact match or wildcard
1358 icmpv6_type: exact match or wildcard
1359 icmpv6_code: exact match or wildcard
1360 nd_target: exact match or wildcard
1361 nd_sll: exact match or wildcard
1362 nd_tll: exact match or wildcard"
1366 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-tables br0], [0], [expout])
1367 # Change the configuration.
1370 -- --id=@t0 create Flow_Table name=main \
1371 -- --id=@t1 create Flow_Table flow-limit=1024 \
1372 -- set bridge br0 'flow_tables={1=@t1,0=@t0}' \
1373 | ${PERL} $srcdir/uuidfilt.pl],
1377 # Check that the configuration was updated.
1378 mv expout orig-expout
1379 sed 's/classifier/main/
1380 53s/1000000/1024/' < orig-expout > expout
1381 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-tables br0], [0], [expout])
1385 AT_SETUP([ofproto - table features (OpenFlow 1.3)])
1389 while test $x -lt 254; do
1391 if test $x = 253; then
1396 echo " table $x (\"$name\"):
1397 metadata: match=0xffffffffffffffff write=0xffffffffffffffff
1399 instructions (table miss and others):
1401 instructions: meter,apply_actions,clear_actions,write_actions,write_metadata,goto_table
1402 Write-Actions and Apply-Actions features:
1403 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
1404 supported on Set-Field: tun_id tun_src tun_dst 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 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
1406 dp_hash: arbitrary mask
1407 recirc_id: exact match or wildcard
1408 tun_id: arbitrary mask
1409 tun_src: arbitrary mask
1410 tun_dst: arbitrary mask
1411 metadata: arbitrary mask
1412 in_port: exact match or wildcard
1413 in_port_oxm: exact match or wildcard
1414 actset_output: exact match or wildcard
1415 pkt_mark: arbitrary mask
1416 reg0: arbitrary mask
1417 reg1: arbitrary mask
1418 reg2: arbitrary mask
1419 reg3: arbitrary mask
1420 reg4: arbitrary mask
1421 reg5: arbitrary mask
1422 reg6: arbitrary mask
1423 reg7: arbitrary mask
1424 xreg0: arbitrary mask
1425 xreg1: arbitrary mask
1426 xreg2: arbitrary mask
1427 xreg3: arbitrary mask
1428 eth_src: arbitrary mask
1429 eth_dst: arbitrary mask
1430 eth_type: exact match or wildcard
1431 vlan_tci: arbitrary mask
1432 vlan_vid: arbitrary mask
1433 vlan_pcp: exact match or wildcard
1434 mpls_label: exact match or wildcard
1435 mpls_tc: exact match or wildcard
1436 mpls_bos: exact match or wildcard
1437 ip_src: arbitrary mask
1438 ip_dst: arbitrary mask
1439 ipv6_src: arbitrary mask
1440 ipv6_dst: arbitrary mask
1441 ipv6_label: arbitrary mask
1442 nw_proto: exact match or wildcard
1443 nw_tos: exact match or wildcard
1444 ip_dscp: exact match or wildcard
1445 nw_ecn: exact match or wildcard
1446 nw_ttl: exact match or wildcard
1447 ip_frag: arbitrary mask
1448 arp_op: exact match or wildcard
1449 arp_spa: arbitrary mask
1450 arp_tpa: arbitrary mask
1451 arp_sha: arbitrary mask
1452 arp_tha: arbitrary mask
1453 tcp_src: arbitrary mask
1454 tcp_dst: arbitrary mask
1455 tcp_flags: arbitrary mask
1456 udp_src: arbitrary mask
1457 udp_dst: arbitrary mask
1458 sctp_src: arbitrary mask
1459 sctp_dst: arbitrary mask
1460 icmp_type: exact match or wildcard
1461 icmp_code: exact match or wildcard
1462 icmpv6_type: exact match or wildcard
1463 icmpv6_code: exact match or wildcard
1464 nd_target: arbitrary mask
1465 nd_sll: arbitrary mask
1466 nd_tll: arbitrary mask"
1470 AT_CHECK([ovs-ofctl -O OpenFlow13 dump-table-features br0 | sed '/^$/d
1471 /^OFPST_TABLE_FEATURES/d'], [0], [expout])
1472 # Change the configuration.
1475 -- --id=@t0 create Flow_Table name=main \
1476 -- --id=@t1 create Flow_Table flow-limit=1024 \
1477 -- set bridge br0 'flow_tables={1=@t1,0=@t0}' \
1478 | ${PERL} $srcdir/uuidfilt.pl],
1482 # Check that the configuration was updated.
1483 mv expout orig-expout
1484 sed 's/classifier/main/
1485 74s/1000000/1024/' < orig-expout > expout
1486 AT_CHECK([ovs-ofctl -O OpenFlow13 dump-table-features br0 | sed '/^$/d
1487 /^OFPST_TABLE_FEATURES/d'], [0], [expout])
1491 AT_SETUP([ofproto - hard limits on flow table size (OpenFlow 1.0)])
1493 # Configure a maximum of 4 flows.
1496 -- --id=@t0 create Flow_Table flow-limit=4 \
1497 -- set bridge br0 flow_tables:0=@t0 \
1498 | ${PERL} $srcdir/uuidfilt.pl],
1502 for in_port in 1 2 3 4; do
1503 ovs-ofctl add-flow br0 in_port=$in_port,actions=drop
1505 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1506 in_port=1 actions=drop
1507 in_port=2 actions=drop
1508 in_port=3 actions=drop
1509 in_port=4 actions=drop
1512 # Adding another flow will be refused.
1513 AT_CHECK([ovs-ofctl add-flow br0 in_port=5,actions=drop], [1], [], [stderr])
1514 AT_CHECK([head -n 1 stderr | ofctl_strip], [0],
1515 [OFPT_ERROR: OFPFMFC_TABLE_FULL
1517 # Also a mod-flow that would add a flow will be refused.
1518 AT_CHECK([ovs-ofctl mod-flows br0 in_port=5,actions=drop], [1], [], [stderr])
1519 AT_CHECK([head -n 1 stderr | ofctl_strip], [0],
1520 [OFPT_ERROR: OFPFMFC_TABLE_FULL
1522 # Replacing or modifying an existing flow is allowed.
1523 AT_CHECK([ovs-ofctl add-flow br0 in_port=4,actions=normal])
1524 AT_CHECK([ovs-ofctl mod-flows br0 in_port=3,actions=output:1])
1525 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1526 in_port=1 actions=drop
1527 in_port=2 actions=drop
1528 in_port=3 actions=output:1
1529 in_port=4 actions=NORMAL
1535 AT_SETUP([ofproto - hard limits on flow table size (OpenFlow 1.2)])
1537 # Configure a maximum of 4 flows.
1540 -- --id=@t0 create Flow_Table flow-limit=4 \
1541 -- set bridge br0 flow_tables:0=@t0 \
1542 | ${PERL} $srcdir/uuidfilt.pl],
1546 for in_port in 1 2 3 4; do
1547 ovs-ofctl -O OpenFlow12 add-flow br0 in_port=$in_port,actions=drop
1549 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1550 in_port=1 actions=drop
1551 in_port=2 actions=drop
1552 in_port=3 actions=drop
1553 in_port=4 actions=drop
1554 OFPST_FLOW reply (OF1.2):
1556 # Adding another flow will be refused.
1557 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 in_port=5,actions=drop], [1], [], [stderr])
1558 AT_CHECK([head -n 1 stderr | ofctl_strip], [0],
1559 [OFPT_ERROR (OF1.2): OFPFMFC_TABLE_FULL
1561 # Replacing or modifying an existing flow is allowed.
1562 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 in_port=4,actions=normal])
1563 AT_CHECK([ovs-ofctl -O OpenFlow12 mod-flows br0 in_port=3,actions=output:1])
1564 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1565 in_port=1 actions=drop
1566 in_port=2 actions=drop
1567 in_port=3 actions=output:1
1568 in_port=4 actions=NORMAL
1569 OFPST_FLOW reply (OF1.2):
1574 AT_SETUP([ofproto - eviction upon table overflow (OpenFlow 1.0)])
1576 # Configure a maximum of 4 flows.
1579 -- --id=@t0 create Flow_Table flow-limit=4 overflow-policy=evict \
1580 -- set bridge br0 flow_tables:0=@t0 \
1581 | ${PERL} $srcdir/uuidfilt.pl],
1585 for in_port in 4 3 2 1; do
1586 ovs-ofctl add-flow br0 idle_timeout=${in_port}0,in_port=$in_port,actions=drop
1588 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1589 idle_timeout=10, in_port=1 actions=drop
1590 idle_timeout=20, in_port=2 actions=drop
1591 idle_timeout=30, in_port=3 actions=drop
1592 idle_timeout=40, in_port=4 actions=drop
1595 # Adding another flow will cause the one that expires soonest to be evicted.
1596 AT_CHECK([ovs-ofctl add-flow br0 in_port=5,actions=drop])
1597 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1598 idle_timeout=20, in_port=2 actions=drop
1599 idle_timeout=30, in_port=3 actions=drop
1600 idle_timeout=40, in_port=4 actions=drop
1601 in_port=5 actions=drop
1604 # A mod-flow that adds a flow also causes eviction, but replacing or
1605 # modifying an existing flow doesn't.
1606 AT_CHECK([ovs-ofctl mod-flows br0 in_port=6,actions=drop])
1607 AT_CHECK([ovs-ofctl add-flow br0 in_port=4,actions=normal])
1608 AT_CHECK([ovs-ofctl mod-flows br0 in_port=3,actions=output:1])
1609 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1610 idle_timeout=30, in_port=3 actions=output:1
1611 in_port=4 actions=NORMAL
1612 in_port=5 actions=drop
1613 in_port=6 actions=drop
1616 # Flows with no timeouts at all cannot be evicted.
1617 AT_CHECK([ovs-ofctl add-flow br0 in_port=7,actions=normal])
1618 AT_CHECK([ovs-ofctl add-flow br0 in_port=8,actions=drop], [1], [], [stderr])
1619 AT_CHECK([head -n 1 stderr | ofctl_strip], [0],
1620 [OFPT_ERROR: OFPFMFC_TABLE_FULL
1622 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1623 in_port=4 actions=NORMAL
1624 in_port=5 actions=drop
1625 in_port=6 actions=drop
1626 in_port=7 actions=NORMAL
1632 AT_SETUP([ofproto - eviction upon table overflow (OpenFlow 1.2)])
1634 # Configure a maximum of 4 flows.
1637 -- --id=@t0 create Flow_Table flow-limit=4 overflow-policy=evict \
1638 -- set bridge br0 flow_tables:0=@t0 \
1639 | ${PERL} $srcdir/uuidfilt.pl],
1643 for in_port in 4 3 2 1; do
1644 ovs-ofctl -O OpenFlow12 add-flow br0 idle_timeout=${in_port}0,in_port=$in_port,actions=drop
1646 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1647 idle_timeout=10, in_port=1 actions=drop
1648 idle_timeout=20, in_port=2 actions=drop
1649 idle_timeout=30, in_port=3 actions=drop
1650 idle_timeout=40, in_port=4 actions=drop
1651 OFPST_FLOW reply (OF1.2):
1653 # Adding another flow will cause the one that expires soonest to be evicted.
1654 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 in_port=5,actions=drop])
1655 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1656 idle_timeout=20, in_port=2 actions=drop
1657 idle_timeout=30, in_port=3 actions=drop
1658 idle_timeout=40, in_port=4 actions=drop
1659 in_port=5 actions=drop
1660 OFPST_FLOW reply (OF1.2):
1662 # In OpenFlow 1.2 a mod-flow does not ever add a flow and thus
1663 # has no effect on eviction
1664 AT_CHECK([ovs-ofctl -O OpenFlow12 mod-flows br0 in_port=6,actions=drop])
1665 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 in_port=4,actions=normal])
1666 AT_CHECK([ovs-ofctl -O OpenFlow12 mod-flows br0 in_port=3,actions=output:1])
1667 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1668 idle_timeout=20, in_port=2 actions=drop
1669 idle_timeout=30, in_port=3 actions=output:1
1670 in_port=4 actions=NORMAL
1671 in_port=5 actions=drop
1672 OFPST_FLOW reply (OF1.2):
1674 # Flows with no timeouts at all cannot be evicted.
1675 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 in_port=6,actions=drop])
1676 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 in_port=7,actions=normal])
1677 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 in_port=8,actions=drop], [1], [], [stderr])
1678 AT_CHECK([head -n 1 stderr | ofctl_strip], [0],
1679 [OFPT_ERROR (OF1.2): OFPFMFC_TABLE_FULL
1681 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1682 in_port=4 actions=NORMAL
1683 in_port=5 actions=drop
1684 in_port=6 actions=drop
1685 in_port=7 actions=NORMAL
1686 OFPST_FLOW reply (OF1.2):
1691 AT_SETUP([ofproto - eviction upon table overflow, with fairness (OpenFlow 1.0)])
1693 # Configure a maximum of 4 flows.
1696 -- --id=@t0 create Flow_Table name=evict flow-limit=4 \
1697 overflow-policy=evict \
1698 groups='"NXM_OF_IN_PORT[[]]"' \
1699 -- set bridge br0 flow_tables:0=@t0 \
1700 | ${PERL} $srcdir/uuidfilt.pl],
1704 ovs-ofctl add-flows br0 - <<EOF
1705 idle_timeout=10 in_port=2 dl_src=00:44:55:66:77:88 actions=drop
1706 idle_timeout=20 in_port=1 dl_src=00:11:22:33:44:55 actions=drop
1707 idle_timeout=30 in_port=1 dl_src=00:22:33:44:55:66 actions=drop
1708 idle_timeout=40 in_port=1 dl_src=00:33:44:55:66:77 actions=drop
1710 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1711 idle_timeout=10, in_port=2,dl_src=00:44:55:66:77:88 actions=drop
1712 idle_timeout=20, in_port=1,dl_src=00:11:22:33:44:55 actions=drop
1713 idle_timeout=30, in_port=1,dl_src=00:22:33:44:55:66 actions=drop
1714 idle_timeout=40, in_port=1,dl_src=00:33:44:55:66:77 actions=drop
1717 # Adding another flow will cause the one that expires soonest within
1718 # the largest group (those with in_port=1) to be evicted. In this
1719 # case this is not the same as the one that expires soonest overall
1720 # (which is what makes the test interesting):
1721 AT_CHECK([ovs-ofctl add-flow br0 in_port=2,dl_src=00:55:66:77:88:99,actions=drop])
1722 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1723 idle_timeout=10, in_port=2,dl_src=00:44:55:66:77:88 actions=drop
1724 idle_timeout=30, in_port=1,dl_src=00:22:33:44:55:66 actions=drop
1725 idle_timeout=40, in_port=1,dl_src=00:33:44:55:66:77 actions=drop
1726 in_port=2,dl_src=00:55:66:77:88:99 actions=drop
1729 # Enlarge the flow limit, change the eviction policy back to strictly
1730 # based on expiration, and and add some flows.
1731 AT_CHECK([ovs-vsctl set Flow_Table evict groups='[[]]' flow-limit=7])
1732 ovs-ofctl add-flows br0 - <<EOF
1733 idle_timeout=50 in_port=2 dl_src=00:66:77:88:99:aa actions=drop
1734 idle_timeout=60 in_port=2 dl_src=00:77:88:99:aa:bb actions=drop
1735 idle_timeout=70 in_port=2 dl_src=00:88:99:aa:bb:cc actions=drop
1737 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1738 idle_timeout=10, in_port=2,dl_src=00:44:55:66:77:88 actions=drop
1739 idle_timeout=30, in_port=1,dl_src=00:22:33:44:55:66 actions=drop
1740 idle_timeout=40, in_port=1,dl_src=00:33:44:55:66:77 actions=drop
1741 idle_timeout=50, in_port=2,dl_src=00:66:77:88:99:aa actions=drop
1742 idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=drop
1743 idle_timeout=70, in_port=2,dl_src=00:88:99:aa:bb:cc actions=drop
1744 in_port=2,dl_src=00:55:66:77:88:99 actions=drop
1747 # Adding another flow will cause the one that expires soonest overall
1749 AT_CHECK([ovs-ofctl add-flow br0 'idle_timeout=80 in_port=2 dl_src=00:99:aa:bb:cc:dd actions=drop'])
1750 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1751 idle_timeout=30, in_port=1,dl_src=00:22:33:44:55:66 actions=drop
1752 idle_timeout=40, in_port=1,dl_src=00:33:44:55:66:77 actions=drop
1753 idle_timeout=50, in_port=2,dl_src=00:66:77:88:99:aa actions=drop
1754 idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=drop
1755 idle_timeout=70, in_port=2,dl_src=00:88:99:aa:bb:cc actions=drop
1756 idle_timeout=80, in_port=2,dl_src=00:99:aa:bb:cc:dd actions=drop
1757 in_port=2,dl_src=00:55:66:77:88:99 actions=drop
1760 # Reducing the flow limit also causes the flows that expire soonest
1761 # overall to be evicted.
1762 AT_CHECK([ovs-vsctl set Flow_Table evict flow-limit=4])
1763 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1764 idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=drop
1765 idle_timeout=70, in_port=2,dl_src=00:88:99:aa:bb:cc actions=drop
1766 idle_timeout=80, in_port=2,dl_src=00:99:aa:bb:cc:dd actions=drop
1767 in_port=2,dl_src=00:55:66:77:88:99 actions=drop
1773 AT_SETUP([ofproto - eviction upon table overflow, with fairness (OpenFlow 1.2)])
1775 # Configure a maximum of 4 flows.
1778 -- --id=@t0 create Flow_Table name=evict flow-limit=4 \
1779 overflow-policy=evict \
1780 groups='"NXM_OF_IN_PORT[[]]"' \
1781 -- set bridge br0 flow_tables:0=@t0 \
1782 | ${PERL} $srcdir/uuidfilt.pl],
1786 ovs-ofctl -O OpenFlow12 add-flows br0 - <<EOF
1787 idle_timeout=10 in_port=2 dl_src=00:44:55:66:77:88 actions=drop
1788 idle_timeout=20 in_port=1 dl_src=00:11:22:33:44:55 actions=drop
1789 idle_timeout=30 in_port=1 dl_src=00:22:33:44:55:66 actions=drop
1790 idle_timeout=40 in_port=1 dl_src=00:33:44:55:66:77 actions=drop
1792 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1793 idle_timeout=10, in_port=2,dl_src=00:44:55:66:77:88 actions=drop
1794 idle_timeout=20, in_port=1,dl_src=00:11:22:33:44:55 actions=drop
1795 idle_timeout=30, in_port=1,dl_src=00:22:33:44:55:66 actions=drop
1796 idle_timeout=40, in_port=1,dl_src=00:33:44:55:66:77 actions=drop
1797 OFPST_FLOW reply (OF1.2):
1799 # Adding another flow will cause the one that expires soonest within
1800 # the largest group (those with in_port=1) to be evicted. In this
1801 # case this is not the same as the one that expires soonest overall
1802 # (which is what makes the test interesting):
1803 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 in_port=2,dl_src=00:55:66:77:88:99,actions=drop])
1804 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1805 idle_timeout=10, in_port=2,dl_src=00:44:55:66:77:88 actions=drop
1806 idle_timeout=30, in_port=1,dl_src=00:22:33:44:55:66 actions=drop
1807 idle_timeout=40, in_port=1,dl_src=00:33:44:55:66:77 actions=drop
1808 in_port=2,dl_src=00:55:66:77:88:99 actions=drop
1809 OFPST_FLOW reply (OF1.2):
1811 # Enlarge the flow limit, change the eviction policy back to strictly
1812 # based on expiration, and and add some flows.
1813 AT_CHECK([ovs-vsctl set Flow_Table evict groups='[[]]' flow-limit=7])
1814 ovs-ofctl -O OpenFlow12 add-flows br0 - <<EOF
1815 idle_timeout=50 in_port=2 dl_src=00:66:77:88:99:aa actions=drop
1816 idle_timeout=60 in_port=2 dl_src=00:77:88:99:aa:bb actions=drop
1817 idle_timeout=70 in_port=2 dl_src=00:88:99:aa:bb:cc actions=drop
1819 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1820 idle_timeout=10, in_port=2,dl_src=00:44:55:66:77:88 actions=drop
1821 idle_timeout=30, in_port=1,dl_src=00:22:33:44:55:66 actions=drop
1822 idle_timeout=40, in_port=1,dl_src=00:33:44:55:66:77 actions=drop
1823 idle_timeout=50, in_port=2,dl_src=00:66:77:88:99:aa actions=drop
1824 idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=drop
1825 idle_timeout=70, in_port=2,dl_src=00:88:99:aa:bb:cc actions=drop
1826 in_port=2,dl_src=00:55:66:77:88:99 actions=drop
1827 OFPST_FLOW reply (OF1.2):
1829 # Adding another flow will cause the one that expires soonest overall
1831 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'])
1832 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1833 idle_timeout=30, in_port=1,dl_src=00:22:33:44:55:66 actions=drop
1834 idle_timeout=40, in_port=1,dl_src=00:33:44:55:66:77 actions=drop
1835 idle_timeout=50, in_port=2,dl_src=00:66:77:88:99:aa actions=drop
1836 idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=drop
1837 idle_timeout=70, in_port=2,dl_src=00:88:99:aa:bb:cc actions=drop
1838 idle_timeout=80, in_port=2,dl_src=00:99:aa:bb:cc:dd actions=drop
1839 in_port=2,dl_src=00:55:66:77:88:99 actions=drop
1840 OFPST_FLOW reply (OF1.2):
1842 # Reducing the flow limit also causes the flows that expire soonest
1843 # overall to be evicted.
1844 AT_CHECK([ovs-vsctl set Flow_Table evict flow-limit=4])
1845 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1846 idle_timeout=60, in_port=2,dl_src=00:77:88:99:aa:bb actions=drop
1847 idle_timeout=70, in_port=2,dl_src=00:88:99:aa:bb:cc actions=drop
1848 idle_timeout=80, in_port=2,dl_src=00:99:aa:bb:cc:dd actions=drop
1849 in_port=2,dl_src=00:55:66:77:88:99 actions=drop
1850 OFPST_FLOW reply (OF1.2):
1855 AT_SETUP([ofproto - eviction upon table overflow, with modified hard timeout])
1857 # Configure a maximum of 4 flows.
1860 -- --id=@t0 create Flow_Table flow-limit=4 overflow-policy=evict \
1861 -- set bridge br0 flow_tables:0=@t0 \
1862 | ${PERL} $srcdir/uuidfilt.pl],
1865 ovs-appctl time/stop
1867 for in_port in 4 3 2 1; do
1868 ovs-ofctl add-flow br0 hard_timeout=$((10 + in_port * 3)),in_port=$in_port,actions=drop
1870 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1871 hard_timeout=13, in_port=1 actions=drop
1872 hard_timeout=16, in_port=2 actions=drop
1873 hard_timeout=19, in_port=3 actions=drop
1874 hard_timeout=22, in_port=4 actions=drop
1877 # Sleep and modify the one that expires soonest
1878 ovs-appctl time/warp 5000
1879 AT_CHECK([ovs-ofctl mod-flows br0 in_port=1,actions=drop])
1880 # At this point the table would looks like:
1881 # in_port seconds to expire
1886 ovs-appctl time/warp 2000
1887 # Adding another flow will cause the one that expires soonest to be evicted.
1888 AT_CHECK([ovs-ofctl add-flow br0 in_port=5,actions=drop])
1889 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1890 hard_timeout=13, in_port=1 actions=drop
1891 hard_timeout=19, in_port=3 actions=drop
1892 hard_timeout=22, in_port=4 actions=drop
1893 in_port=5 actions=drop
1899 AT_SETUP([ofproto - eviction upon table overflow, with modified idle timeout])
1900 OVS_VSWITCHD_START([add-port br0 p1 -- set interface p1 type=dummy ofport_request=1])
1901 # Configure a maximum of 4 flows.
1904 -- --id=@t0 create Flow_Table flow-limit=4 overflow-policy=evict \
1905 -- set bridge br0 flow_tables:0=@t0 \
1906 | ${PERL} $srcdir/uuidfilt.pl],
1910 for in_port in 4 3 2 1; do
1911 ovs-ofctl add-flow br0 idle_timeout=$((10 + in_port * 3)),in_port=$in_port,actions=drop
1913 ovs-appctl time/stop
1914 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1915 idle_timeout=13, in_port=1 actions=drop
1916 idle_timeout=16, in_port=2 actions=drop
1917 idle_timeout=19, in_port=3 actions=drop
1918 idle_timeout=22, in_port=4 actions=drop
1921 # Sleep and receive on the flow that expires soonest
1922 ovs-appctl time/warp 5000
1923 AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1)'])
1924 # At this point the table would looks like:
1925 # in_port seconds to expire
1930 ovs-appctl time/warp 2000
1931 # Adding another flow will cause the one that expires soonest to be evicted.
1932 AT_CHECK([ovs-ofctl add-flow br0 in_port=5,actions=drop])
1933 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1934 idle_timeout=19, in_port=3 actions=drop
1935 idle_timeout=22, in_port=4 actions=drop
1936 in_port=5 actions=drop
1937 n_packets=1, n_bytes=60, idle_timeout=13, in_port=1 actions=drop
1943 AT_SETUP([ofproto - asynchronous message control (OpenFlow 1.0)])
1945 AT_CHECK([ovs-ofctl -P openflow10 monitor br0 --detach --no-chdir --pidfile])
1947 printf '\n\n--- check_async %d ---\n\n\n' $1
1950 ovs-appctl -t ovs-ofctl ofctl/barrier
1951 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
1954 # OFPT_PACKET_IN, OFPR_ACTION (controller_id=0)
1955 ovs-ofctl -v packet-out br0 controller controller '0001020304050010203040501234'
1956 if test X"$1" = X"OFPR_ACTION"; then shift;
1957 echo >>expout "OFPT_PACKET_IN: total_len=14 in_port=CONTROLLER (via action) data_len=14 (unbuffered)
1958 in_port=0,vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234"
1961 # OFPT_PACKET_IN, OFPR_NO_MATCH (controller_id=123)
1962 ovs-ofctl -v packet-out br0 controller 'controller(reason=no_match,id=123)' '0001020304050010203040501234'
1963 if test X"$1" = X"OFPR_NO_MATCH"; then shift;
1964 echo >>expout "OFPT_PACKET_IN: total_len=14 in_port=CONTROLLER (via no_match) data_len=14 (unbuffered)
1965 in_port=0,vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234"
1968 # OFPT_PACKET_IN, OFPR_INVALID_TTL (controller_id=0)
1969 ovs-ofctl packet-out br0 controller dec_ttl '002583dfb4000026b98cb0f908004500003eb7e200000011339bac11370dac100002d7730035002b8f6d86fb0100000100000000000006626c702d7873066e696369726103636f6d00000f00'
1970 if test X"$1" = X"OFPR_INVALID_TTL"; then shift;
1971 echo >>expout "OFPT_PACKET_IN: total_len=76 in_port=CONTROLLER (via invalid_ttl) data_len=76 (unbuffered)
1972 udp,in_port=0,vlan_tci=0x0000,dl_src=00:26:b9:8c:b0:f9,dl_dst=00:25:83:df:b4:00,nw_src=172.17.55.13,nw_dst=172.16.0.2,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=55155,tp_dst=53 udp_csum:8f6d"
1975 # OFPT_PORT_STATUS, OFPPR_ADD
1976 ovs-vsctl add-port br0 test -- set Interface test type=dummy ofport_request=1
1977 if test X"$1" = X"OFPPR_ADD"; then shift;
1978 echo >>expout "OFPT_PORT_STATUS: ADD: 1(test): addr:aa:55:aa:55:00:0x
1981 speed: 0 Mbps now, 0 Mbps max"
1984 # OFPT_PORT_STATUS, OFPPR_DELETE
1985 ovs-vsctl del-port br0 test
1986 if test X"$1" = X"OFPPR_DELETE"; then shift;
1987 echo >>expout "OFPT_PORT_STATUS: DEL: 1(test): addr:aa:55:aa:55:00:0x
1990 speed: 0 Mbps now, 0 Mbps max"
1993 # OFPT_FLOW_REMOVED, OFPRR_DELETE
1994 ovs-ofctl add-flow br0 send_flow_rem,actions=drop
1995 ovs-ofctl --strict del-flows br0 ''
1996 if test X"$1" = X"OFPRR_DELETE"; then shift;
1997 echo >>expout "OFPT_FLOW_REMOVED: reason=delete"
1999 AT_FAIL_IF([test X"$1" != X])
2001 ovs-appctl -t ovs-ofctl ofctl/barrier
2002 echo >>expout "OFPT_BARRIER_REPLY:"
2006 s/ (xid=0x[0-9a-fA-F]*)//
2008 s/00:0.$/00:0x/' < monitor.log]],
2012 # It's a service connection so initially there should be no async messages.
2015 # Set miss_send_len to 128, turning on packet-ins for our service connection.
2016 ovs-appctl -t ovs-ofctl ofctl/send 0109000c0123456700000080
2017 check_async 2 OFPR_ACTION OFPPR_ADD OFPPR_DELETE OFPRR_DELETE
2019 # Set miss_send_len to 128 and enable invalid_ttl.
2020 ovs-appctl -t ovs-ofctl ofctl/send 0109000c0123456700040080
2021 check_async 3 OFPR_ACTION OFPR_INVALID_TTL OFPPR_ADD OFPPR_DELETE OFPRR_DELETE
2023 # Become slave, which should disable everything except port status.
2024 ovs-appctl -t ovs-ofctl ofctl/send 0104001400000002000023200000000a00000002
2025 check_async 4 OFPPR_ADD OFPPR_DELETE
2027 # Use NXT_SET_ASYNC_CONFIG to enable a patchwork of asynchronous messages.
2028 ovs-appctl -t ovs-ofctl ofctl/send 01040028000000020000232000000013000000020000000500000005000000020000000200000005
2029 check_async 5 OFPR_INVALID_TTL OFPPR_DELETE OFPRR_DELETE
2031 # Set controller ID 123.
2032 ovs-appctl -t ovs-ofctl ofctl/send 01040018000000030000232000000014000000000000007b
2033 check_async 6 OFPR_NO_MATCH OFPPR_DELETE OFPRR_DELETE
2035 # Restore controller ID 0.
2036 ovs-appctl -t ovs-ofctl ofctl/send 010400180000000300002320000000140000000000000000
2039 ovs-appctl -t ovs-ofctl ofctl/send 0104001400000002000023200000000a00000001
2040 check_async 7 OFPR_ACTION OFPPR_ADD
2042 ovs-appctl -t ovs-ofctl exit
2046 AT_SETUP([ofproto - asynchronous message control (OpenFlow 1.2)])
2048 AT_CHECK([ovs-ofctl -O OpenFlow12 monitor br0 --detach --no-chdir --pidfile])
2050 printf '\n\n--- check_async %d ---\n\n\n' $1
2054 ovs-appctl -t ovs-ofctl ofctl/barrier
2055 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
2058 # OFPT_PACKET_IN, OFPR_ACTION (controller_id=0)
2059 ovs-ofctl -O OpenFlow12 -v packet-out br0 none controller '0001020304050010203040501234'
2060 if test X"$1" = X"OFPR_ACTION"; then shift;
2061 echo >>expout "OFPT_PACKET_IN (OF1.2): total_len=14 in_port=ANY (via action) data_len=14 (unbuffered)
2062 in_port=0,vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234"
2065 # OFPT_PACKET_IN, OFPR_NO_MATCH (controller_id=123)
2066 ovs-ofctl -O OpenFlow12 -v packet-out br0 none 'controller(reason=no_match,id=123)' '0001020304050010203040501234'
2067 if test X"$1" = X"OFPR_NO_MATCH"; then shift;
2068 echo >>expout "OFPT_PACKET_IN (OF1.2): total_len=14 in_port=ANY (via no_match) data_len=14 (unbuffered)
2069 in_port=0,vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234"
2072 # OFPT_PACKET_IN, OFPR_INVALID_TTL (controller_id=0)
2073 ovs-ofctl -O OpenFlow12 packet-out br0 none dec_ttl '002583dfb4000026b98cb0f908004500003eb7e200000011339bac11370dac100002d7730035002b8f6d86fb0100000100000000000006626c702d7873066e696369726103636f6d00000f00'
2074 if test X"$1" = X"OFPR_INVALID_TTL"; then shift;
2075 echo >>expout "OFPT_PACKET_IN (OF1.2): total_len=76 in_port=ANY (via invalid_ttl) data_len=76 (unbuffered)
2076 udp,in_port=0,vlan_tci=0x0000,dl_src=00:26:b9:8c:b0:f9,dl_dst=00:25:83:df:b4:00,nw_src=172.17.55.13,nw_dst=172.16.0.2,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=55155,tp_dst=53 udp_csum:8f6d"
2079 # OFPT_PORT_STATUS, OFPPR_ADD
2080 ovs-vsctl add-port br0 test -- set Interface test type=dummy
2081 if test X"$1" = X"OFPPR_ADD"; then shift;
2082 echo >>expout "OFPT_PORT_STATUS (OF1.2): ADD: ${INDEX}(test): addr:aa:55:aa:55:00:0x
2085 speed: 0 Mbps now, 0 Mbps max"
2088 # OFPT_PORT_STATUS, OFPPR_DELETE
2089 ovs-vsctl del-port br0 test
2090 if test X"$1" = X"OFPPR_DELETE"; then shift;
2091 echo >>expout "OFPT_PORT_STATUS (OF1.2): DEL: ${INDEX}(test): addr:aa:55:aa:55:00:0x
2094 speed: 0 Mbps now, 0 Mbps max"
2097 # OFPT_FLOW_REMOVED, OFPRR_DELETE
2098 ovs-ofctl -O OpenFlow12 add-flow br0 send_flow_rem,actions=drop
2099 ovs-ofctl -O OpenFlow12 --strict del-flows br0 ''
2100 if test X"$1" = X"OFPRR_DELETE"; then shift;
2101 echo >>expout "OFPT_FLOW_REMOVED (OF1.2): reason=delete table_id=0"
2103 AT_FAIL_IF([test X"$1" != X])
2105 ovs-appctl -t ovs-ofctl ofctl/barrier
2106 echo >>expout "OFPT_BARRIER_REPLY (OF1.2):"
2110 s/ (xid=0x[0-9a-fA-F]*)//
2112 s/00:0.$/00:0x/' < monitor.log]],
2116 # It's a service connection so initially there should be no async messages.
2119 # Set miss_send_len to 128, turning on packet-ins for our service connection.
2120 ovs-appctl -t ovs-ofctl ofctl/send 0309000c0123456700000080
2121 check_async 2 OFPR_ACTION OFPPR_ADD OFPPR_DELETE OFPRR_DELETE
2123 # Set miss_send_len to 128 and enable invalid_ttl.
2124 ovs-appctl -t ovs-ofctl ofctl/send 0309000c0123456700040080
2125 check_async 3 OFPR_ACTION OFPR_INVALID_TTL OFPPR_ADD OFPPR_DELETE OFPRR_DELETE
2127 # Become slave (OF 1.2), which should disable everything except port status.
2128 ovs-appctl -t ovs-ofctl ofctl/send 031800180000000200000003000000000000000000000001
2129 check_async 4 OFPPR_ADD OFPPR_DELETE
2131 # Use NXT_SET_ASYNC_CONFIG to enable a patchwork of asynchronous messages.
2132 ovs-appctl -t ovs-ofctl ofctl/send 03040028000000020000232000000013000000020000000500000005000000020000000200000005
2133 check_async 5 OFPR_INVALID_TTL OFPPR_DELETE OFPRR_DELETE
2135 # Set controller ID 123.
2136 ovs-appctl -t ovs-ofctl ofctl/send 03040018000000030000232000000014000000000000007b
2137 check_async 6 OFPR_NO_MATCH OFPPR_DELETE OFPRR_DELETE
2139 # Restore controller ID 0.
2140 ovs-appctl -t ovs-ofctl ofctl/send 030400180000000300002320000000140000000000000000
2142 # Become master (OF 1.2).
2143 ovs-appctl -t ovs-ofctl ofctl/send 031800180000000400000002000000000000000000000002
2144 check_async 7 OFPR_ACTION OFPPR_ADD
2146 ovs-appctl -t ovs-ofctl exit
2150 AT_SETUP([ofproto - asynchronous message control (OpenFlow 1.3)])
2152 AT_CHECK([ovs-ofctl -O OpenFlow13 monitor br0 --detach --no-chdir --pidfile])
2154 printf '\n\n--- check_async %d ---\n\n\n' $1
2158 ovs-appctl -t ovs-ofctl ofctl/barrier
2159 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
2162 # OFPT_PACKET_IN, OFPR_ACTION (controller_id=0)
2163 ovs-ofctl -O OpenFlow13 -v packet-out br0 none controller '0001020304050010203040501234'
2164 if test X"$1" = X"OFPR_ACTION"; then shift;
2165 echo >>expout "OFPT_PACKET_IN (OF1.3): total_len=14 in_port=ANY (via action) data_len=14 (unbuffered)
2166 in_port=0,vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234"
2169 # OFPT_PACKET_IN, OFPR_NO_MATCH (controller_id=123)
2170 ovs-ofctl -O OpenFlow13 -v packet-out br0 none 'controller(reason=no_match,id=123)' '0001020304050010203040501234'
2171 if test X"$1" = X"OFPR_NO_MATCH"; then shift;
2172 echo >>expout "OFPT_PACKET_IN (OF1.3): total_len=14 in_port=ANY (via no_match) data_len=14 (unbuffered)
2173 in_port=0,vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234"
2176 # OFPT_PACKET_IN, OFPR_INVALID_TTL (controller_id=0)
2177 ovs-ofctl -O OpenFlow13 packet-out br0 none dec_ttl '002583dfb4000026b98cb0f908004500003eb7e200000011339bac11370dac100002d7730035002b8f6d86fb0100000100000000000006626c702d7873066e696369726103636f6d00000f00'
2178 if test X"$1" = X"OFPR_INVALID_TTL"; then shift;
2179 echo >>expout "OFPT_PACKET_IN (OF1.3): total_len=76 in_port=ANY (via invalid_ttl) data_len=76 (unbuffered)
2180 udp,in_port=0,vlan_tci=0x0000,dl_src=00:26:b9:8c:b0:f9,dl_dst=00:25:83:df:b4:00,nw_src=172.17.55.13,nw_dst=172.16.0.2,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=55155,tp_dst=53 udp_csum:8f6d"
2183 # OFPT_PORT_STATUS, OFPPR_ADD
2184 ovs-vsctl add-port br0 test -- set Interface test type=dummy
2185 if test X"$1" = X"OFPPR_ADD"; then shift;
2186 echo >>expout "OFPT_PORT_STATUS (OF1.3): ADD: ${INDEX}(test): addr:aa:55:aa:55:00:0x
2189 speed: 0 Mbps now, 0 Mbps max"
2192 # OFPT_PORT_STATUS, OFPPR_DELETE
2193 ovs-vsctl del-port br0 test
2194 if test X"$1" = X"OFPPR_DELETE"; then shift;
2195 echo >>expout "OFPT_PORT_STATUS (OF1.3): DEL: ${INDEX}(test): addr:aa:55:aa:55:00:0x
2198 speed: 0 Mbps now, 0 Mbps max"
2201 # OFPT_FLOW_REMOVED, OFPRR_DELETE
2202 ovs-ofctl -O OpenFlow13 add-flow br0 send_flow_rem,actions=drop
2203 ovs-ofctl -O OpenFlow13 --strict del-flows br0 ''
2204 if test X"$1" = X"OFPRR_DELETE"; then shift;
2205 echo >>expout "OFPT_FLOW_REMOVED (OF1.3): reason=delete table_id=0"
2208 # OFPT_FLOW_REMOVED, OFPRR_GROUP_DELETE
2209 ovs-ofctl -O OpenFlow13 add-group br0 group_id=1234,type=all,bucket=output:10
2210 ovs-ofctl -O OpenFlow13 add-flow br0 send_flow_rem,actions=group:1234
2211 ovs-ofctl -O OpenFlow13 --strict del-groups br0 group_id=1234
2212 if test X"$1" = X"OFPRR_DELETE"; then shift;
2213 echo >>expout "OFPT_FLOW_REMOVED (OF1.3): reason=gropu_delete table_id=0"
2216 AT_FAIL_IF([test X"$1" != X])
2218 ovs-appctl -t ovs-ofctl ofctl/barrier
2219 echo >>expout "OFPT_BARRIER_REPLY (OF1.3):"
2223 s/ (xid=0x[0-9a-fA-F]*)//
2225 s/00:0.$/00:0x/' < monitor.log]],
2229 # It's a service connection so initially there should be no async messages.
2232 # Set miss_send_len to 128, turning on packet-ins for our service connection.
2233 ovs-appctl -t ovs-ofctl ofctl/send 0409000c0123456700000080
2234 check_async 2 OFPR_ACTION OFPPR_ADD OFPPR_DELETE OFPRR_DELETE
2236 # Become slave (OF 1.3), which should disable everything except port status.
2237 ovs-appctl -t ovs-ofctl ofctl/send 041800180000000200000003000000000000000000000001
2238 check_async 3 OFPPR_ADD OFPPR_DELETE
2240 # Use OF 1.3 OFPT_SET_ASYNC to enable a patchwork of asynchronous messages.
2241 ovs-appctl -t ovs-ofctl ofctl/send 041c002000000002000000020000000500000005000000020000000200000005
2242 check_async 4 OFPR_INVALID_TTL OFPPR_DELETE OFPRR_DELETE
2244 # Set controller ID 123.
2245 ovs-appctl -t ovs-ofctl ofctl/send 04040018000000030000232000000014000000000000007b
2246 check_async 5 OFPR_NO_MATCH OFPPR_DELETE OFPRR_DELETE
2248 # Restore controller ID 0.
2249 ovs-appctl -t ovs-ofctl ofctl/send 040400180000000300002320000000140000000000000000
2251 # Become master (OF 1.3).
2252 ovs-appctl -t ovs-ofctl ofctl/send 041800180000000400000002000000000000000000000002
2253 check_async 6 OFPR_ACTION OFPPR_ADD
2255 ovs-appctl -t ovs-ofctl exit
2259 AT_SETUP([ofproto - asynchronous message control (OpenFlow 1.5)])
2261 AT_CHECK([ovs-ofctl -O OpenFlow15 monitor br0 --detach --no-chdir --pidfile])
2263 printf '\n\n--- check_async %d ---\n\n\n' $1
2267 ovs-appctl -t ovs-ofctl ofctl/barrier
2268 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
2271 # Other tests are not working with OF 1.5, and message
2272 # format may change, so leave them out.
2274 # OFPT_PORT_STATUS, OFPPR_ADD
2275 ovs-vsctl add-port br0 test -- set Interface test type=dummy
2276 if test X"$1" = X"OFPPR_ADD"; then shift;
2277 echo >>expout "OFPT_PORT_STATUS (OF1.5): ADD: ${INDEX}(test): addr:aa:55:aa:55:00:0x
2280 speed: 0 Mbps now, 0 Mbps max"
2283 # OFPT_PORT_STATUS, OFPPR_MODIFY
2284 ovs-ofctl -O OpenFlow15 -vwarn mod-port br0 test up
2285 if test X"$1" = X"OFPPR_MODIFY"; then shift;
2286 echo >>expout "OFPT_PORT_STATUS (OF1.5): MOD: ${INDEX}(test): addr:aa:55:aa:55:00:0x
2289 speed: 0 Mbps now, 0 Mbps max
2290 OFPT_PORT_STATUS (OF1.5): MOD: 2(test): addr:aa:55:aa:55:00:0x
2293 speed: 0 Mbps now, 0 Mbps max"
2296 # OFPT_PORT_STATUS, OFPPR_DELETE
2297 ovs-vsctl del-port br0 test
2298 if test X"$1" = X"OFPPR_DELETE"; then shift;
2299 echo >>expout "OFPT_PORT_STATUS (OF1.5): DEL: ${INDEX}(test): addr:aa:55:aa:55:00:0x
2302 speed: 0 Mbps now, 0 Mbps max"
2305 AT_FAIL_IF([test X"$1" != X])
2307 ovs-appctl -t ovs-ofctl ofctl/barrier
2308 echo >>expout "OFPT_BARRIER_REPLY (OF1.5):"
2312 s/ (xid=0x[0-9a-fA-F]*)//
2314 s/00:0.$/00:0x/' < monitor.log]],
2318 # It's a service connection so initially there should be no async messages.
2321 # If we don't set this, async messages are not received.
2322 # Set miss_send_len to 128, turning on packet-ins for our service connection.
2323 ovs-appctl -t ovs-ofctl ofctl/send 0609000c0123456700000080
2324 check_async 2 OFPPR_ADD OFPPR_MODIFY OFPPR_DELETE
2326 # Set-async has changed in OF 1.4 and is not yet implemented.
2328 ovs-appctl -t ovs-ofctl exit
2332 dnl This test checks that the role request/response messaging works
2333 dnl and that generation_id is handled properly.
2334 AT_SETUP([ofproto - controller role (OpenFlow 1.2)])
2336 ON_EXIT([kill `cat c1.pid c2.pid`])
2338 # Start two ovs-ofctl controller processes.
2339 AT_CAPTURE_FILE([monitor1.log])
2340 AT_CAPTURE_FILE([expout1])
2341 AT_CAPTURE_FILE([experr1])
2342 AT_CAPTURE_FILE([monitor2.log])
2343 AT_CAPTURE_FILE([expout2])
2344 AT_CAPTURE_FILE([experr2])
2346 AT_CHECK([ovs-ofctl -O OpenFlow12 monitor br0 --detach --no-chdir --pidfile=`pwd`/c$i.pid --unixctl=`pwd`/c$i])
2347 ovs-appctl -t `pwd`/c$i ofctl/barrier
2348 ovs-appctl -t `pwd`/c$i ofctl/set-output-file monitor$i.log
2352 # find out current role
2353 ovs-appctl -t `pwd`/c$i ofctl/send 031800180000000200000000000000000000000000000000
2354 echo >>experr$i "send: OFPT_ROLE_REQUEST (OF1.2): role=nochange"
2355 echo >>expout$i "OFPT_ROLE_REPLY (OF1.2): role=equal"
2358 # controller 1: Become slave (generation_id is initially undefined, so
2359 # 2^63+2 should not be stale)
2360 ovs-appctl -t `pwd`/c1 ofctl/send 031800180000000300000003000000008000000000000002
2361 echo >>experr1 "send: OFPT_ROLE_REQUEST (OF1.2): role=slave generation_id=9223372036854775810"
2362 echo >>expout1 "OFPT_ROLE_REPLY (OF1.2): role=slave generation_id=9223372036854775810"
2364 # controller 2: Become master.
2365 ovs-appctl -t `pwd`/c2 ofctl/send 031800180000000300000002000000008000000000000003
2366 echo >>experr2 "send: OFPT_ROLE_REQUEST (OF1.2): role=master generation_id=9223372036854775811"
2367 echo >>expout2 "OFPT_ROLE_REPLY (OF1.2): role=master generation_id=9223372036854775811"
2369 # controller 1: Try to become the master using a stale generation ID
2370 ovs-appctl -t `pwd`/c1 ofctl/send 031800180000000400000002000000000000000000000003
2371 echo >>experr1 "send: OFPT_ROLE_REQUEST (OF1.2): role=master generation_id=3"
2372 echo >>expout1 "OFPT_ERROR (OF1.2): OFPRRFC_STALE"
2373 echo >>expout1 "OFPT_ROLE_REQUEST (OF1.2): role=master generation_id=3"
2375 # controller 1: Become master using a valid generation ID
2376 ovs-appctl -t `pwd`/c1 ofctl/send 031800180000000500000002000000000000000000000001
2377 echo >>experr1 "send: OFPT_ROLE_REQUEST (OF1.2): role=master generation_id=1"
2378 echo >>expout1 "OFPT_ROLE_REPLY (OF1.2): role=master generation_id=1"
2381 ovs-appctl -t `pwd`/c$i ofctl/barrier
2382 echo >>expout$i "OFPT_BARRIER_REPLY (OF1.2):"
2388 AT_CHECK([grep -v '^send:' monitor$i.log | STRIP_XIDS], [0], [expout])
2390 AT_CHECK([grep '^send:' monitor$i.log | STRIP_XIDS], [0], [expout])
2395 dnl This test checks that the role request/response messaging works,
2396 dnl that generation_id is handled properly, and that role status update
2397 dnl messages are sent when a controller's role gets changed from master
2399 AT_SETUP([ofproto - controller role (OpenFlow 1.4)])
2401 ON_EXIT([kill `cat c1.pid c2.pid`])
2403 # Start two ovs-ofctl controller processes.
2404 AT_CAPTURE_FILE([monitor1.log])
2405 AT_CAPTURE_FILE([expout1])
2406 AT_CAPTURE_FILE([experr1])
2407 AT_CAPTURE_FILE([monitor2.log])
2408 AT_CAPTURE_FILE([expout2])
2409 AT_CAPTURE_FILE([experr2])
2411 AT_CHECK([ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile=`pwd`/c$i.pid --unixctl=`pwd`/c$i])
2412 ovs-appctl -t `pwd`/c$i ofctl/barrier
2413 ovs-appctl -t `pwd`/c$i ofctl/set-output-file monitor$i.log
2417 # find out current role
2418 ovs-appctl -t `pwd`/c$i ofctl/send 051800180000000200000000000000000000000000000000
2419 echo >>experr$i "send: OFPT_ROLE_REQUEST (OF1.4): role=nochange"
2420 echo >>expout$i "OFPT_ROLE_REPLY (OF1.4): role=equal"
2423 # controller 1: Become slave (generation_id is initially undefined, so
2424 # 2^63+2 should not be stale)
2425 ovs-appctl -t `pwd`/c1 ofctl/send 051800180000000300000003000000008000000000000002
2426 echo >>experr1 "send: OFPT_ROLE_REQUEST (OF1.4): role=slave generation_id=9223372036854775810"
2427 echo >>expout1 "OFPT_ROLE_REPLY (OF1.4): role=slave generation_id=9223372036854775810"
2429 # controller 2: Become master.
2430 ovs-appctl -t `pwd`/c2 ofctl/send 051800180000000300000002000000008000000000000003
2431 echo >>experr2 "send: OFPT_ROLE_REQUEST (OF1.4): role=master generation_id=9223372036854775811"
2432 echo >>expout2 "OFPT_ROLE_REPLY (OF1.4): role=master generation_id=9223372036854775811"
2434 # controller 1: Try to become the master using a stale generation ID
2435 ovs-appctl -t `pwd`/c1 ofctl/send 051800180000000400000002000000000000000000000003
2436 echo >>experr1 "send: OFPT_ROLE_REQUEST (OF1.4): role=master generation_id=3"
2437 echo >>expout1 "OFPT_ERROR (OF1.4): OFPRRFC_STALE"
2438 echo >>expout1 "OFPT_ROLE_REQUEST (OF1.4): role=master generation_id=3"
2440 # controller 1: Become master using a valid generation ID
2441 ovs-appctl -t `pwd`/c1 ofctl/send 051800180000000500000002000000000000000000000001
2442 echo >>experr1 "send: OFPT_ROLE_REQUEST (OF1.4): role=master generation_id=1"
2443 echo >>expout1 "OFPT_ROLE_REPLY (OF1.4): role=master generation_id=1"
2444 echo >>expout2 "OFPT_ROLE_STATUS (OF1.4): role=slave generation_id=1 reason=master_request"
2447 ovs-appctl -t `pwd`/c$i ofctl/barrier
2448 echo >>expout$i "OFPT_BARRIER_REPLY (OF1.4):"
2454 AT_CHECK([grep -v '^send:' monitor$i.log | STRIP_XIDS], [0], [expout])
2456 AT_CHECK([grep '^send:' monitor$i.log | STRIP_XIDS], [0], [expout])
2461 dnl This test checks that OFPT_PACKET_OUT accepts both OFPP_NONE (as
2462 dnl specified by OpenFlow 1.0) and OFPP_CONTROLLER (used by some
2463 dnl controllers despite the spec) as meaning a packet that was generated
2464 dnl by the controller.
2465 AT_SETUP([ofproto - packet-out from controller (OpenFlow 1.0)])
2467 ADD_OF_PORTS([br0], [1])
2469 # Start a monitor listening for packet-ins.
2470 AT_CHECK([ovs-ofctl -P openflow10 monitor br0 --detach --no-chdir --pidfile])
2471 ovs-appctl -t ovs-ofctl ofctl/send 0109000c0123456700000080
2472 ovs-appctl -t ovs-ofctl ofctl/barrier
2473 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
2474 AT_CAPTURE_FILE([monitor.log])
2476 # Send some packet-outs with OFPP_NONE and OFPP_CONTROLLER (65533) as in_port.
2477 AT_CHECK([ovs-ofctl packet-out br0 none controller,1 '0001020304050010203040501234'])
2478 AT_CHECK([ovs-ofctl packet-out br0 controller controller,1 '0001020304050010203040505678'])
2480 # Stop the monitor and check its output.
2481 ovs-appctl -t ovs-ofctl ofctl/barrier
2482 ovs-appctl -t ovs-ofctl exit
2484 ovs-ofctl dump-ports br0
2486 AT_CHECK([sed 's/ (xid=0x[[0-9a-fA-F]]*)//' monitor.log], [0], [dnl
2487 OFPT_PACKET_IN: total_len=14 in_port=ANY (via action) data_len=14 (unbuffered)
2488 in_port=0,vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234
2489 OFPT_PACKET_IN: total_len=14 in_port=CONTROLLER (via action) data_len=14 (unbuffered)
2490 in_port=0,vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x5678
2497 dnl This test checks that OFPT_PACKET_OUT accepts both OFPP_NONE (as
2498 dnl specified by OpenFlow 1.2) and OFPP_CONTROLLER (used by some
2499 dnl controllers despite the spec) as meaning a packet that was generated
2500 dnl by the controller.
2501 AT_SETUP([ofproto - packet-out from controller (OpenFlow 1.2)])
2504 # Start a monitor listening for packet-ins.
2505 AT_CHECK([ovs-ofctl -O OpenFlow12 monitor br0 --detach --no-chdir --pidfile])
2506 ovs-appctl -t ovs-ofctl ofctl/send 0309000c0123456700000080
2507 ovs-appctl -t ovs-ofctl ofctl/barrier
2508 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
2509 AT_CAPTURE_FILE([monitor.log])
2511 # Send some packet-outs with OFPP_NONE and OFPP_CONTROLLER (65533) as in_port.
2512 AT_CHECK([ovs-ofctl -O OpenFlow12 packet-out br0 none controller '0001020304050010203040501234'])
2513 AT_CHECK([ovs-ofctl -O OpenFlow12 packet-out br0 4294967293 controller '0001020304050010203040505678'])
2515 # Stop the monitor and check its output.
2516 ovs-appctl -t ovs-ofctl ofctl/barrier
2517 ovs-appctl -t ovs-ofctl exit
2519 AT_CHECK([sed 's/ (xid=0x[[0-9a-fA-F]]*)//' monitor.log], [0], [dnl
2520 OFPT_PACKET_IN (OF1.2): total_len=14 in_port=ANY (via action) data_len=14 (unbuffered)
2521 in_port=0,vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234
2522 OFPT_PACKET_IN (OF1.2): total_len=14 in_port=CONTROLLER (via action) data_len=14 (unbuffered)
2523 in_port=0,vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x5678
2524 OFPT_BARRIER_REPLY (OF1.2):
2530 dnl This test checks that OFPT_PACKET_OUT accepts both OFPP_NONE (as
2531 dnl specified by OpenFlow 1.1) and OFPP_CONTROLLER (used by some
2532 dnl controllers despite the spec) as meaning a packet that was generated
2533 dnl by the controller.
2534 AT_SETUP([ofproto - packet-out from controller (OpenFlow 1.1)])
2537 # Start a monitor listening for packet-ins.
2538 AT_CHECK([ovs-ofctl -O OpenFlow11 monitor br0 --detach --no-chdir --pidfile])
2539 ovs-appctl -t ovs-ofctl ofctl/send 0209000c0123456700000080
2540 ovs-appctl -t ovs-ofctl ofctl/barrier
2541 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
2542 AT_CAPTURE_FILE([monitor.log])
2544 # Send some packet-outs with OFPP_NONE and OFPP_CONTROLLER (65533) as in_port.
2545 AT_CHECK([ovs-ofctl -O OpenFlow11 packet-out br0 none controller '0001020304050010203040501234'])
2546 AT_CHECK([ovs-ofctl -O OpenFlow11 packet-out br0 4294967293 controller '0001020304050010203040505678'])
2548 # Stop the monitor and check its output.
2549 ovs-appctl -t ovs-ofctl ofctl/barrier
2550 ovs-appctl -t ovs-ofctl exit
2552 AT_CHECK([sed 's/ (xid=0x[[0-9a-fA-F]]*)//' monitor.log], [0], [dnl
2553 OFPT_PACKET_IN (OF1.1): total_len=14 in_port=ANY (via action) data_len=14 (unbuffered)
2554 in_port=0,vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234
2555 OFPT_PACKET_IN (OF1.1): total_len=14 in_port=CONTROLLER (via action) data_len=14 (unbuffered)
2556 in_port=0,vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x5678
2557 OFPT_BARRIER_REPLY (OF1.1):
2563 dnl This test checks that metadata is encoded in packet_in structures,
2564 dnl supported by NXAST.
2565 AT_SETUP([ofproto - packet-out with metadata (NXM)])
2568 # Start a monitor listening for packet-ins.
2569 AT_CHECK([ovs-ofctl -P nxm monitor br0 --detach --no-chdir --pidfile])
2570 ovs-appctl -t ovs-ofctl ofctl/send 0109000c0123456700000080
2571 ovs-appctl -t ovs-ofctl ofctl/barrier
2572 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
2573 AT_CAPTURE_FILE([monitor.log])
2575 # Send a packet-out with a load action to set some metadata, and forward to controller
2576 AT_CHECK([ovs-ofctl packet-out br0 controller 'load(0xfafafafa5a5a5a5a->OXM_OF_METADATA[[0..63]]), load(0xaa->NXM_NX_PKT_MARK[[]]), controller' '0001020304050010203040501234'])
2578 # Stop the monitor and check its output.
2579 ovs-appctl -t ovs-ofctl ofctl/barrier
2580 ovs-appctl -t ovs-ofctl exit
2582 AT_CHECK([sed 's/ (xid=0x[[0-9a-fA-F]]*)//' monitor.log], [0], [dnl
2583 NXT_PACKET_IN: total_len=14 in_port=CONTROLLER metadata=0xfafafafa5a5a5a5a pkt_mark=0xaa (via action) data_len=14 (unbuffered)
2584 in_port=0,vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234
2591 dnl This test checks that metadata is encoded in packet_in structures,
2592 dnl supported by NXAST.
2593 AT_SETUP([ofproto - packet-out with metadata (OpenFlow 1.2)])
2596 # Start a monitor listening for packet-ins.
2597 AT_CHECK([ovs-ofctl -O OpenFlow12 monitor br0 --detach --no-chdir --pidfile])
2598 ovs-appctl -t ovs-ofctl ofctl/send 0309000c0123456700000080
2599 ovs-appctl -t ovs-ofctl ofctl/barrier
2600 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
2601 AT_CAPTURE_FILE([monitor.log])
2603 # Send a packet-out with a set-field action to set some metadata, and forward to controller
2604 AT_CHECK([ovs-ofctl -O OpenFlow12 packet-out br0 none 'set_field:0xfafafafa5a5a5a5a->metadata, controller' '0001020304050010203040501234'])
2606 # Stop the monitor and check its output.
2607 ovs-appctl -t ovs-ofctl ofctl/barrier
2608 ovs-appctl -t ovs-ofctl exit
2610 AT_CHECK([sed 's/ (xid=0x[[0-9a-fA-F]]*)//' monitor.log], [0], [dnl
2611 OFPT_PACKET_IN (OF1.2): total_len=14 in_port=ANY metadata=0xfafafafa5a5a5a5a (via action) data_len=14 (unbuffered)
2612 in_port=0,vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234
2613 OFPT_BARRIER_REPLY (OF1.2):
2619 dnl This test checks that metadata is encoded in packet_in structures,
2620 dnl supported by NXAST.
2621 AT_SETUP([ofproto - packet-out with metadata and dual set_field (OpenFlow 1.3)])
2624 # Start a monitor listening for packet-ins.
2625 AT_CHECK([ovs-ofctl -O OpenFlow13 monitor br0 --detach --no-chdir --pidfile])
2626 ovs-appctl -t ovs-ofctl ofctl/send 0409000c0123456700000080
2627 ovs-appctl -t ovs-ofctl ofctl/barrier
2628 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
2629 AT_CAPTURE_FILE([monitor.log])
2631 # Send a packet-out with a couple of set-field action to set some metadata, and forward to controller
2632 AT_CHECK([ovs-ofctl -O OpenFlow13 packet-out br0 none 'set_field:0xfafafafa5a5a5a5a->metadata, set_field:0x6b->metadata, controller' '0001020304050010203040501234'])
2634 # Stop the monitor and check its output.
2635 ovs-appctl -t ovs-ofctl ofctl/barrier
2636 ovs-appctl -t ovs-ofctl exit
2638 AT_CHECK([sed 's/ (xid=0x[[0-9a-fA-F]]*)//' monitor.log], [0], [dnl
2639 OFPT_PACKET_IN (OF1.3): total_len=14 in_port=ANY metadata=0x6b (via action) data_len=14 (unbuffered)
2640 in_port=0,vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234
2641 OFPT_BARRIER_REPLY (OF1.3):
2647 dnl This test checks that tunnel metadata is encoded in packet_in structures.
2648 AT_SETUP([ofproto - packet-out with tunnel metadata (OpenFlow 1.2)])
2651 # Start a monitor listening for packet-ins.
2652 AT_CHECK([ovs-ofctl -O OpenFlow12 monitor br0 --detach --no-chdir --pidfile])
2653 ovs-appctl -t ovs-ofctl ofctl/send 0309000c0123456700000080
2654 ovs-appctl -t ovs-ofctl ofctl/barrier
2655 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
2656 AT_CAPTURE_FILE([monitor.log])
2658 # Send a packet-out with set field actions to set some tunnel metadata, and forward to controller
2659 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'])
2661 # Stop the monitor and check its output.
2662 ovs-appctl -t ovs-ofctl ofctl/barrier
2663 ovs-appctl -t ovs-ofctl exit
2665 AT_CHECK([sed 's/ (xid=0x[[0-9a-fA-F]]*)//' monitor.log], [0], [dnl
2666 OFPT_PACKET_IN (OF1.2): total_len=14 in_port=ANY tun_id=0x1020304 tun_src=127.0.0.1 tun_dst=192.168.0.1 (via action) data_len=14 (unbuffered)
2667 in_port=0,vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1234
2668 OFPT_BARRIER_REPLY (OF1.2):
2674 m4_divert_push([PREPARE_TESTS])
2675 # Sorts groups of lines that start with a space, without moving them
2676 # past the nearest line that does not start with a space.
2686 print $_ foreach sort(@buffer);
2691 print $_ foreach sort(@buffer);
2694 m4_divert_pop([PREPARE_TESTS])
2696 AT_SETUP([ofproto - flow monitoring])
2697 AT_KEYWORDS([monitor])
2700 ovs-ofctl add-flow br0 in_port=0,dl_vlan=123,actions=output:1
2702 # Start a monitor watching the flow table and check the initial reply.
2703 ovs-ofctl monitor br0 watch: --detach --no-chdir --pidfile >monitor.log 2>&1
2704 AT_CAPTURE_FILE([monitor.log])
2705 ovs-appctl -t ovs-ofctl ofctl/barrier
2706 AT_CHECK([sed 's/ (xid=0x[[1-9a-fA-F]][[0-9a-fA-F]]*)//' monitor.log], [0],
2707 [NXST_FLOW_MONITOR reply:
2708 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=123 actions=output:1
2712 # Add, delete, and modify some flows and check the updates.
2713 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
2714 ovs-ofctl add-flow br0 in_port=0,dl_vlan=124,actions=output:2
2715 ovs-ofctl add-flow br0 in_port=0,dl_vlan=123,actions=output:5
2716 ovs-ofctl add-flow br0 in_port=0,dl_vlan=123,dl_vlan_pcp=0,actions=output:6
2717 ovs-ofctl add-flow br0 in_port=0,dl_vlan=123,dl_vlan_pcp=1,actions=output:7
2718 ovs-ofctl add-flow br0 in_port=0,dl_vlan=123,actions=output:8
2719 ovs-ofctl add-flow br0 in_port=0,dl_vlan=65535,dl_vlan_pcp=0,actions=output:9
2720 ovs-ofctl add-flow br0 in_port=0,dl_vlan=65535,dl_vlan_pcp=1,actions=output:10
2721 ovs-ofctl add-flow br0 in_port=0,dl_vlan=65535,actions=output:11
2722 ovs-ofctl add-flow br0 in_port=0,dl_vlan=8191,dl_vlan_pcp=0,actions=output:12
2723 ovs-ofctl add-flow br0 in_port=0,dl_vlan=8191,dl_vlan_pcp=1,actions=output:13
2724 ovs-ofctl add-flow br0 in_port=0,dl_vlan=8191,actions=output:14
2725 ovs-ofctl add-flow br0 in_port=0,dl_vlan=0,dl_vlan_pcp=0,actions=output:15
2726 ovs-ofctl add-flow br0 in_port=0,dl_vlan=0,dl_vlan_pcp=1,actions=output:16
2727 ovs-ofctl add-flow br0 in_port=0,dl_vlan=0,actions=output:17
2728 ovs-ofctl add-flow br0 in_port=0,dl_vlan=0,dl_vlan_pcp=0,actions=output:18
2729 ovs-ofctl add-flow br0 in_port=0,dl_vlan=0,dl_vlan_pcp=1,actions=output:19
2730 ovs-ofctl add-flow br0 in_port=0,dl_vlan=0,actions=output:20
2731 ovs-ofctl add-flow br0 in_port=0,dl_vlan_pcp=0,actions=output:21
2732 ovs-ofctl add-flow br0 in_port=0,dl_vlan_pcp=1,actions=output:22
2733 ovs-ofctl add-flow br0 in_port=0,actions=output:23
2734 ovs-ofctl mod-flows br0 dl_vlan=123,actions=output:3
2735 ovs-ofctl mod-flows br0 cookie=5,dl_vlan=123,actions=output:3
2736 ovs-ofctl del-flows br0 dl_vlan=123
2737 ovs-ofctl del-flows br0
2738 ovs-appctl -t ovs-ofctl ofctl/barrier
2739 AT_CHECK([sed 's/ (xid=0x[[1-9a-fA-F]][[0-9a-fA-F]]*)//' monitor.log | multiline_sort], [0],
2740 [NXST_FLOW_MONITOR reply (xid=0x0):
2741 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=124 actions=output:2
2742 NXST_FLOW_MONITOR reply (xid=0x0):
2743 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=123 actions=output:5
2744 NXST_FLOW_MONITOR reply (xid=0x0):
2745 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=123,dl_vlan_pcp=0 actions=output:6
2746 NXST_FLOW_MONITOR reply (xid=0x0):
2747 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=123,dl_vlan_pcp=1 actions=output:7
2748 NXST_FLOW_MONITOR reply (xid=0x0):
2749 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=123 actions=output:8
2750 NXST_FLOW_MONITOR reply (xid=0x0):
2751 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=0,dl_vlan_pcp=0 actions=output:9
2752 NXST_FLOW_MONITOR reply (xid=0x0):
2753 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=0,dl_vlan_pcp=1 actions=output:10
2754 NXST_FLOW_MONITOR reply (xid=0x0):
2755 event=ADDED table=0 cookie=0 in_port=0,vlan_tci=0x0000 actions=output:11
2756 NXST_FLOW_MONITOR reply (xid=0x0):
2757 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=4095,dl_vlan_pcp=0 actions=output:12
2758 NXST_FLOW_MONITOR reply (xid=0x0):
2759 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=4095,dl_vlan_pcp=1 actions=output:13
2760 NXST_FLOW_MONITOR reply (xid=0x0):
2761 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=4095 actions=output:14
2762 NXST_FLOW_MONITOR reply (xid=0x0):
2763 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=0,dl_vlan_pcp=0 actions=output:15
2764 NXST_FLOW_MONITOR reply (xid=0x0):
2765 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=0,dl_vlan_pcp=1 actions=output:16
2766 NXST_FLOW_MONITOR reply (xid=0x0):
2767 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=0 actions=output:17
2768 NXST_FLOW_MONITOR reply (xid=0x0):
2769 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=0,dl_vlan_pcp=0 actions=output:18
2770 NXST_FLOW_MONITOR reply (xid=0x0):
2771 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=0,dl_vlan_pcp=1 actions=output:19
2772 NXST_FLOW_MONITOR reply (xid=0x0):
2773 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=0 actions=output:20
2774 NXST_FLOW_MONITOR reply (xid=0x0):
2775 event=ADDED table=0 cookie=0 in_port=0,dl_vlan_pcp=0 actions=output:21
2776 NXST_FLOW_MONITOR reply (xid=0x0):
2777 event=ADDED table=0 cookie=0 in_port=0,dl_vlan_pcp=1 actions=output:22
2778 NXST_FLOW_MONITOR reply (xid=0x0):
2779 event=ADDED table=0 cookie=0 in_port=0 actions=output:23
2780 NXST_FLOW_MONITOR reply (xid=0x0):
2781 event=MODIFIED table=0 cookie=0 in_port=0,dl_vlan=123 actions=output:3
2782 event=MODIFIED table=0 cookie=0 in_port=0,dl_vlan=123,dl_vlan_pcp=0 actions=output:3
2783 event=MODIFIED table=0 cookie=0 in_port=0,dl_vlan=123,dl_vlan_pcp=1 actions=output:3
2784 NXST_FLOW_MONITOR reply (xid=0x0):
2785 event=MODIFIED table=0 cookie=0x5 in_port=0,dl_vlan=123 actions=output:3
2786 event=MODIFIED table=0 cookie=0x5 in_port=0,dl_vlan=123,dl_vlan_pcp=0 actions=output:3
2787 event=MODIFIED table=0 cookie=0x5 in_port=0,dl_vlan=123,dl_vlan_pcp=1 actions=output:3
2788 NXST_FLOW_MONITOR reply (xid=0x0):
2789 event=DELETED reason=delete table=0 cookie=0x5 in_port=0,dl_vlan=123 actions=output:3
2790 event=DELETED reason=delete table=0 cookie=0x5 in_port=0,dl_vlan=123,dl_vlan_pcp=0 actions=output:3
2791 event=DELETED reason=delete table=0 cookie=0x5 in_port=0,dl_vlan=123,dl_vlan_pcp=1 actions=output:3
2792 NXST_FLOW_MONITOR reply (xid=0x0):
2793 event=DELETED reason=delete table=0 cookie=0 in_port=0 actions=output:23
2794 event=DELETED reason=delete table=0 cookie=0 in_port=0,dl_vlan=0 actions=output:20
2795 event=DELETED reason=delete table=0 cookie=0 in_port=0,dl_vlan=0,dl_vlan_pcp=0 actions=output:18
2796 event=DELETED reason=delete table=0 cookie=0 in_port=0,dl_vlan=0,dl_vlan_pcp=1 actions=output:19
2797 event=DELETED reason=delete table=0 cookie=0 in_port=0,dl_vlan=124 actions=output:2
2798 event=DELETED reason=delete table=0 cookie=0 in_port=0,dl_vlan=4095 actions=output:14
2799 event=DELETED reason=delete table=0 cookie=0 in_port=0,dl_vlan=4095,dl_vlan_pcp=0 actions=output:12
2800 event=DELETED reason=delete table=0 cookie=0 in_port=0,dl_vlan=4095,dl_vlan_pcp=1 actions=output:13
2801 event=DELETED reason=delete table=0 cookie=0 in_port=0,dl_vlan_pcp=0 actions=output:21
2802 event=DELETED reason=delete table=0 cookie=0 in_port=0,dl_vlan_pcp=1 actions=output:22
2803 event=DELETED reason=delete table=0 cookie=0 in_port=0,vlan_tci=0x0000 actions=output:11
2807 # Check that our own changes are reported as full updates.
2808 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
2809 ovs-ofctl add-flow br0 in_port=1,actions=output:2
2810 ovs-ofctl add-flow br0 in_port=2,actions=output:1
2811 ovs-appctl -t ovs-ofctl ofctl/barrier
2812 ovs-appctl -t ovs-ofctl ofctl/send 010e004812345678003fffff00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003000000000000ffffffffffff0000
2813 ovs-appctl -t ovs-ofctl ofctl/barrier
2814 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip], [0], [NXST_FLOW reply:
2816 AT_CHECK([sed 's/ (xid=0x[[1-9a-fA-F]][[0-9a-fA-F]]*)//' monitor.log | multiline_sort], [0],
2817 [NXST_FLOW_MONITOR reply (xid=0x0):
2818 event=ADDED table=0 cookie=0 in_port=1 actions=output:2
2819 NXST_FLOW_MONITOR reply (xid=0x0):
2820 event=ADDED table=0 cookie=0 in_port=2 actions=output:1
2822 send: OFPT_FLOW_MOD: DEL priority=0 actions=drop
2823 NXST_FLOW_MONITOR reply (xid=0x0):
2824 event=DELETED reason=delete table=0 cookie=0 in_port=1 actions=output:2
2825 event=DELETED reason=delete table=0 cookie=0 in_port=2 actions=output:1
2829 ovs-appctl -t ovs-ofctl exit
2833 AT_SETUP([ofproto - flow monitoring with !own])
2834 AT_KEYWORDS([monitor])
2837 ovs-ofctl add-flow br0 in_port=0,dl_vlan=123,actions=output:1
2839 # Start a monitor watching the flow table and check the initial reply.
2840 ovs-ofctl monitor br0 watch:\!own --detach --no-chdir --pidfile >monitor.log 2>&1
2841 AT_CAPTURE_FILE([monitor.log])
2842 ovs-appctl -t ovs-ofctl ofctl/barrier
2843 AT_CHECK([sed 's/ (xid=0x[[1-9a-fA-F]][[0-9a-fA-F]]*)//' monitor.log], [0],
2844 [NXST_FLOW_MONITOR reply:
2845 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=123 actions=output:1
2849 # Check that our own changes are reported as abbreviations.
2850 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
2851 ovs-ofctl add-flow br0 in_port=1,actions=output:2
2852 ovs-ofctl add-flow br0 in_port=2,actions=output:1
2853 ovs-appctl -t ovs-ofctl ofctl/barrier
2854 ovs-appctl -t ovs-ofctl ofctl/send 010e004812345678003fffff00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003000000000000ffffffffffff0000
2855 ovs-appctl -t ovs-ofctl ofctl/barrier
2856 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip], [0], [NXST_FLOW reply:
2858 AT_CHECK([sed 's/ (xid=0x[[1-9a-fA-F]][[0-9a-fA-F]]*)//' monitor.log], [0],
2859 [NXST_FLOW_MONITOR reply (xid=0x0):
2860 event=ADDED table=0 cookie=0 in_port=1 actions=output:2
2861 NXST_FLOW_MONITOR reply (xid=0x0):
2862 event=ADDED table=0 cookie=0 in_port=2 actions=output:1
2864 send: OFPT_FLOW_MOD: DEL priority=0 actions=drop
2865 NXST_FLOW_MONITOR reply (xid=0x0):
2866 event=ABBREV xid=0x12345678
2870 ovs-appctl -t ovs-ofctl exit
2874 AT_SETUP([ofproto - flow monitoring with out_port])
2875 AT_KEYWORDS([monitor])
2878 ovs-ofctl add-flow br0 in_port=0,dl_vlan=121,actions=output:1
2879 ovs-ofctl add-flow br0 in_port=0,dl_vlan=122,actions=output:1
2880 ovs-ofctl add-flow br0 in_port=0,dl_vlan=123,actions=output:2
2882 # Start a monitor watching the flow table and check the initial reply.
2883 ovs-ofctl monitor br0 watch:out_port=2 --detach --no-chdir --pidfile >monitor.log 2>&1
2884 AT_CAPTURE_FILE([monitor.log])
2885 ovs-appctl -t ovs-ofctl ofctl/barrier
2886 AT_CHECK([sed 's/ (xid=0x[[1-9a-fA-F]][[0-9a-fA-F]]*)//' monitor.log], [0],
2887 [NXST_FLOW_MONITOR reply:
2888 event=ADDED table=0 cookie=0 in_port=0,dl_vlan=123 actions=output:2
2892 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
2894 # Add, modify flows and check the updates.
2895 ovs-ofctl mod-flows br0 dl_vlan=121,actions=drop
2896 ovs-ofctl mod-flows br0 dl_vlan=122,actions=output:1,output:2
2897 ovs-appctl -t ovs-ofctl ofctl/barrier
2899 ovs-ofctl mod-flows br0 dl_vlan=123,actions=output:1,output:2
2900 ovs-appctl -t ovs-ofctl ofctl/barrier
2902 ovs-ofctl mod-flows br0 dl_vlan=122,actions=output:1
2903 ovs-appctl -t ovs-ofctl ofctl/barrier
2904 ovs-ofctl mod-flows br0 dl_vlan=123,actions=output:2
2905 ovs-appctl -t ovs-ofctl ofctl/barrier
2907 AT_CHECK([sed 's/ (xid=0x[[1-9a-fA-F]][[0-9a-fA-F]]*)//' monitor.log], [0],
2908 [NXST_FLOW_MONITOR reply (xid=0x0):
2909 event=MODIFIED table=0 cookie=0 in_port=0,dl_vlan=122 actions=output:1,output:2
2911 NXST_FLOW_MONITOR reply (xid=0x0):
2912 event=MODIFIED table=0 cookie=0 in_port=0,dl_vlan=123 actions=output:1,output:2
2914 NXST_FLOW_MONITOR reply (xid=0x0):
2915 event=MODIFIED table=0 cookie=0 in_port=0,dl_vlan=122 actions=output:1
2917 NXST_FLOW_MONITOR reply (xid=0x0):
2918 event=MODIFIED table=0 cookie=0 in_port=0,dl_vlan=123 actions=output:2
2922 ovs-appctl -t ovs-ofctl exit
2926 AT_SETUP([ofproto - flow monitoring pause and resume])
2927 AT_KEYWORDS([monitor])
2929 # The maximum socket receive buffer size is important for this test, which
2930 # tests behavior when the receive buffer overflows.
2931 if test -e /proc/sys/net/core/rmem_max; then
2933 rmem_max=`cat /proc/sys/net/core/rmem_max`
2934 elif rmem_max=`sysctl -n net.inet.tcp.recvbuf_max 2>/dev/null`; then
2937 # Don't know how to get maximum socket receive buffer on this OS
2940 # Calculate the total amount of queuing: rmem_max in the kernel, 128 kB
2941 # in ofproto sending userspace (see ofmonitor_flush() in connmgr.c).
2942 queue_size=`expr $rmem_max + 128 \* 1024`
2943 echo rmem_max=$rmem_max queue_size=$queue_size
2945 # If there's too much queuing skip the test to avoid timing out.
2946 AT_SKIP_IF([test $rmem_max -gt 1048576])
2948 # Each flow update message takes up at least 48 bytes of space in queues
2949 # and in practice more than that.
2950 n_msgs=`expr $queue_size / 48`
2955 # Start a monitor watching the flow table, then make it block.
2956 ON_EXIT([kill `cat ovs-ofctl.pid`])
2957 ovs-ofctl monitor br0 watch: --detach --no-chdir --pidfile >monitor.log 2>&1
2958 AT_CAPTURE_FILE([monitor.log])
2959 ovs-appctl -t ovs-ofctl ofctl/block
2961 # Add $n_msgs flows.
2962 (echo "in_port=2,actions=output:2"
2964 for ($i = 0; $i < '$n_msgs'; $i++) {
2965 print "cookie=1,reg1=$i,actions=drop\n";
2968 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
2969 # Check that multipart flow dumps work properly:
2970 AT_CHECK([ovs-ofctl diff-flows br0 flows.txt])
2971 AT_CHECK([ovs-ofctl add-flow br0 in_port=1,cookie=3,actions=drop])
2972 AT_CHECK([ovs-ofctl mod-flows br0 in_port=2,cookie=2,actions=output:2])
2973 AT_CHECK([ovs-ofctl del-flows br0 cookie=1/-1])
2975 ovs-appctl -t ovs-ofctl ofctl/unblock
2977 # Wait for the connection resumed.
2978 # A barrier doesn't work for this purpose.
2979 # https://www.mail-archive.com/dev@openvswitch.org/msg27013.html
2980 # https://www.mail-archive.com/dev@openvswitch.org/msg27675.html
2981 OVS_WAIT_UNTIL([grep NXT_FLOW_MONITOR_RESUMED monitor.log])
2983 ovs-appctl -t ovs-ofctl exit
2985 # Check that the flow monitor reported the same number of flows
2986 # added and deleted, but fewer than we actually added and deleted.
2987 adds=`grep -c 'ADDED.*reg1=' monitor.log`
2988 deletes=`grep -c 'DELETED.*reg1=' monitor.log`
2989 echo adds=$adds deletes=$deletes
2990 AT_CHECK([test $adds -gt 100 && test $adds -lt $n_msgs])
2991 AT_CHECK([test $adds = $deletes])
2993 # Check that the flow monitor reported everything in the expected order:
2995 # event=ADDED table=0 cookie=0x1 reg1=0x22
2997 # NXT_FLOW_MONITOR_PAUSED:
2999 # event=DELETED reason=delete table=0 cookie=0x1 reg1=0x22
3001 # event=ADDED table=0 cookie=0x3 in_port=1
3002 # event=MODIFIED table=0 cookie=0x2 in_port=2 actions=output:2
3003 # NXT_FLOW_MONITOR_RESUMED:
3005 # except that, between the PAUSED and RESUMED, the order of the ADDED
3006 # and MODIFIED lines lines depends on hash order, that is, it varies
3007 # as we change the hash function or change architecture. Therefore,
3008 # we use a couple of tests below to accept both orders.
3009 AT_CHECK([ofctl_strip < monitor.log | sed -n -e '
3012 /NXT_FLOW_MONITOR_PAUSED:/p
3013 /NXT_FLOW_MONITOR_RESUMED:/p
3014 ' > monitor.log.subset])
3015 AT_CHECK([grep -v MODIFIED monitor.log.subset], [0], [dnl
3016 event=ADDED table=0 cookie=0x1 reg1=0x22
3017 NXT_FLOW_MONITOR_PAUSED:
3018 event=DELETED reason=delete table=0 cookie=0x1 reg1=0x22
3019 event=ADDED table=0 cookie=0x3 in_port=1
3020 NXT_FLOW_MONITOR_RESUMED:
3022 AT_CHECK([grep -v ADDED monitor.log.subset], [0], [dnl
3023 NXT_FLOW_MONITOR_PAUSED:
3024 event=DELETED reason=delete table=0 cookie=0x1 reg1=0x22
3025 event=MODIFIED table=0 cookie=0x2 in_port=2 actions=output:2
3026 NXT_FLOW_MONITOR_RESUMED:
3032 AT_SETUP([ofproto - event filtering (OpenFlow 1.3)])
3033 AT_KEYWORDS([monitor])
3036 # Start a monitor, use the required protocol version
3037 ovs-ofctl -O OpenFlow13 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1
3038 AT_CAPTURE_FILE([monitor.log])
3040 # Send an OpenFlow13 message (04), OFPT_GET_ASYNC_REQUEST (1a), length (8), xid (0a)
3041 ovs-appctl -t ovs-ofctl ofctl/send 041a00080000000a
3042 ovs-appctl -t ovs-ofctl ofctl/barrier
3044 # Check default setting
3045 read -r -d '' expected <<'EOF'
3048 AT_CHECK([ofctl_strip < monitor.log], [], [dnl
3049 send: OFPT_GET_ASYNC_REQUEST (OF1.3):
3050 OFPT_GET_ASYNC_REPLY (OF1.3):
3052 PACKET_IN: no_match action
3053 PORT_STATUS: add delete modify
3054 FLOW_REMOVED: idle hard delete
3058 PORT_STATUS: add delete modify
3060 OFPT_BARRIER_REPLY (OF1.3):
3066 AT_SETUP([ofproto - ofport_request])
3068 ADD_OF_PORTS([br0], [1], [2], [3])
3070 set_and_check_specific_ofports () {
3071 ovs-vsctl set Interface p1 ofport_request="$1" -- \
3072 set Interface p2 ofport_request="$2" -- \
3073 set Interface p3 ofport_request="$3"
3074 ofports=`ovs-vsctl get Interface p1 ofport -- \
3075 get Interface p2 ofport -- \
3076 get Interface p3 ofport`
3077 AT_CHECK_UNQUOTED([echo $ofports], [0], [$1 $2 $3
3080 for pre in '1 2 3' '1 3 2' '2 1 3' '2 3 1' '3 1 2' '3 2 1'; do
3081 for post in '1 2 3' '1 3 2' '2 1 3' '2 3 1' '3 1 2' '3 2 1'; do
3082 echo -----------------------------------------------------------
3083 echo "Check changing port numbers from $pre to $post"
3084 set_and_check_specific_ofports $pre
3085 set_and_check_specific_ofports $post
3089 ovs-vsctl del-port p3
3091 set_and_check_poorly_specified_ofports () {
3092 ovs-vsctl set Interface p1 ofport_request="$1" -- \
3093 set Interface p2 ofport_request="$2"
3094 p1=`ovs-vsctl get Interface p1 ofport`
3095 p2=`ovs-vsctl get Interface p2 ofport`
3098 AT_CHECK([test "$p1" != "$p2"])
3099 if test "$1" = "$2" && test "$1" != '[[]]'; then
3100 # One port number must be the requested one.
3101 AT_CHECK([test "$p1" = "$1" || test "$p2" = "$1"])
3102 # The other port number must be different (already tested above).
3104 AT_CHECK([test "$1" = '[[]]' || test "$p1" == "$1"])
3105 AT_CHECK([test "$2" = '[[]]' || test "$p2" == "$2"])
3108 for pre in '1 2' '[[]] 2' '1 [[]]' '[[]] [[]]' '2 1' '[[]] 1' '2 [[]]' \
3110 for post in '1 2' '[[]] 2' '1 [[]]' '[[]] [[]]' '2 1' '[[]] 1' '2 [[]]' \
3112 echo -----------------------------------------------------------
3113 echo "Check changing port numbers from $pre to $post"
3114 set_and_check_poorly_specified_ofports $pre
3115 set_and_check_poorly_specified_ofports $post
3122 AT_SETUP([ofproto - bundles, open (OpenFlow 1.4)])
3123 AT_KEYWORDS([monitor])
3126 # Start a monitor, use the required protocol version
3127 ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1
3128 AT_CAPTURE_FILE([monitor.log])
3130 # Send an OpenFlow14 message (05), OFPT_BUNDLE_CONTROL (21), length (10), xid (0a)
3131 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 00 00 01"
3132 ovs-appctl -t ovs-ofctl ofctl/barrier
3133 ovs-appctl -t ovs-ofctl exit
3135 AT_CHECK([ofctl_strip < monitor.log], [], [dnl
3136 send: OFPT_BUNDLE_CONTROL (OF1.4):
3137 bundle_id=0x1 type=OPEN_REQUEST flags=atomic
3138 OFPT_BUNDLE_CONTROL (OF1.4):
3139 bundle_id=0x1 type=OPEN_REPLY flags=0
3140 OFPT_BARRIER_REPLY (OF1.4):
3146 AT_SETUP([ofproto - bundles, double open (OpenFlow 1.4)])
3147 AT_KEYWORDS([monitor])
3150 # Start a monitor, use the required protocol version
3151 ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1
3152 AT_CAPTURE_FILE([monitor.log])
3154 # Send twice an OpenFlow14 message (05), OFPT_BUNDLE_CONTROL (21), length (10), xid (0a)
3155 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 00 00 01"
3156 ovs-appctl -t ovs-ofctl ofctl/barrier
3157 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 00 00 01"
3158 ovs-appctl -t ovs-ofctl ofctl/barrier
3159 ovs-appctl -t ovs-ofctl exit
3161 AT_CHECK([ofctl_strip < monitor.log], [0], [dnl
3162 send: OFPT_BUNDLE_CONTROL (OF1.4):
3163 bundle_id=0x1 type=OPEN_REQUEST flags=atomic
3164 OFPT_BUNDLE_CONTROL (OF1.4):
3165 bundle_id=0x1 type=OPEN_REPLY flags=0
3166 OFPT_BARRIER_REPLY (OF1.4):
3167 send: OFPT_BUNDLE_CONTROL (OF1.4):
3168 bundle_id=0x1 type=OPEN_REQUEST flags=atomic
3169 OFPT_ERROR (OF1.4): OFPBFC_BAD_ID
3170 OFPT_BUNDLE_CONTROL (OF1.4):
3171 bundle_id=0x1 type=OPEN_REQUEST flags=atomic
3172 OFPT_BARRIER_REPLY (OF1.4):
3178 AT_SETUP([ofproto - bundle close without open (OpenFlow 1.4)])
3179 AT_KEYWORDS([monitor])
3182 # Start a monitor, use the required protocol version
3183 ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1
3184 AT_CAPTURE_FILE([monitor.log])
3186 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 02 00 01"
3187 ovs-appctl -t ovs-ofctl ofctl/barrier
3188 ovs-appctl -t ovs-ofctl exit
3190 AT_CHECK([ofctl_strip < monitor.log], [0], [dnl
3191 send: OFPT_BUNDLE_CONTROL (OF1.4):
3192 bundle_id=0x1 type=CLOSE_REQUEST flags=atomic
3193 OFPT_ERROR (OF1.4): OFPBFC_BAD_ID
3194 OFPT_BUNDLE_CONTROL (OF1.4):
3195 bundle_id=0x1 type=CLOSE_REQUEST flags=atomic
3196 OFPT_BARRIER_REPLY (OF1.4):
3202 AT_SETUP([ofproto - bundle double close (OpenFlow 1.4)])
3203 AT_KEYWORDS([monitor])
3206 # Start a monitor, use the required protocol version
3207 ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1
3208 AT_CAPTURE_FILE([monitor.log])
3210 # Open, Close, Close
3211 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 00 00 01"
3212 ovs-appctl -t ovs-ofctl ofctl/barrier
3213 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 02 00 01"
3214 ovs-appctl -t ovs-ofctl ofctl/barrier
3215 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 02 00 01"
3216 ovs-appctl -t ovs-ofctl ofctl/barrier
3217 ovs-appctl -t ovs-ofctl exit
3219 AT_CHECK([ofctl_strip < monitor.log], [0], [dnl
3220 send: OFPT_BUNDLE_CONTROL (OF1.4):
3221 bundle_id=0x1 type=OPEN_REQUEST flags=atomic
3222 OFPT_BUNDLE_CONTROL (OF1.4):
3223 bundle_id=0x1 type=OPEN_REPLY flags=0
3224 OFPT_BARRIER_REPLY (OF1.4):
3225 send: OFPT_BUNDLE_CONTROL (OF1.4):
3226 bundle_id=0x1 type=CLOSE_REQUEST flags=atomic
3227 OFPT_BUNDLE_CONTROL (OF1.4):
3228 bundle_id=0x1 type=CLOSE_REPLY flags=0
3229 OFPT_BARRIER_REPLY (OF1.4):
3230 send: OFPT_BUNDLE_CONTROL (OF1.4):
3231 bundle_id=0x1 type=CLOSE_REQUEST flags=atomic
3232 OFPT_ERROR (OF1.4): OFPBFC_BUNDLE_CLOSED
3233 OFPT_BUNDLE_CONTROL (OF1.4):
3234 bundle_id=0x1 type=CLOSE_REQUEST flags=atomic
3235 OFPT_BARRIER_REPLY (OF1.4):
3241 AT_SETUP([ofproto - bundle close, different flags (OpenFlow 1.4)])
3242 AT_KEYWORDS([monitor])
3245 # Start a monitor, use the required protocol version
3246 ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1
3247 AT_CAPTURE_FILE([monitor.log])
3249 # Open, Close, Close
3250 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 00 00 01"
3251 ovs-appctl -t ovs-ofctl ofctl/barrier
3252 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 02 00 02"
3253 ovs-appctl -t ovs-ofctl ofctl/barrier
3254 ovs-appctl -t ovs-ofctl exit
3256 AT_CHECK([ofctl_strip < monitor.log], [0], [dnl
3257 send: OFPT_BUNDLE_CONTROL (OF1.4):
3258 bundle_id=0x1 type=OPEN_REQUEST flags=atomic
3259 OFPT_BUNDLE_CONTROL (OF1.4):
3260 bundle_id=0x1 type=OPEN_REPLY flags=0
3261 OFPT_BARRIER_REPLY (OF1.4):
3262 send: OFPT_BUNDLE_CONTROL (OF1.4):
3263 bundle_id=0x1 type=CLOSE_REQUEST flags=ordered
3264 OFPT_ERROR (OF1.4): OFPBFC_BAD_FLAGS
3265 OFPT_BUNDLE_CONTROL (OF1.4):
3266 bundle_id=0x1 type=CLOSE_REQUEST flags=ordered
3267 OFPT_BARRIER_REPLY (OF1.4):
3273 AT_SETUP([ofproto - bundle commit without open (OpenFlow 1.4)])
3274 AT_KEYWORDS([monitor])
3277 # Start a monitor, use the required protocol version
3278 ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1
3279 AT_CAPTURE_FILE([monitor.log])
3281 # Open, Close, Close
3282 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 04 00 01"
3283 ovs-appctl -t ovs-ofctl ofctl/barrier
3284 ovs-appctl -t ovs-ofctl exit
3286 AT_CHECK([ofctl_strip < monitor.log], [0], [dnl
3287 send: OFPT_BUNDLE_CONTROL (OF1.4):
3288 bundle_id=0x1 type=COMMIT_REQUEST flags=atomic
3289 OFPT_ERROR (OF1.4): OFPBFC_BAD_ID
3290 OFPT_BUNDLE_CONTROL (OF1.4):
3291 bundle_id=0x1 type=COMMIT_REQUEST flags=atomic
3292 OFPT_BARRIER_REPLY (OF1.4):
3298 AT_SETUP([ofproto - bundle commit, different flags (OpenFlow 1.4)])
3299 AT_KEYWORDS([monitor])
3302 # Start a monitor, use the required protocol version
3303 ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1
3304 AT_CAPTURE_FILE([monitor.log])
3306 # Open, Close, Close
3307 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 00 00 01"
3308 ovs-appctl -t ovs-ofctl ofctl/barrier
3309 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 04 00 02"
3310 ovs-appctl -t ovs-ofctl ofctl/barrier
3311 ovs-appctl -t ovs-ofctl exit
3313 AT_CHECK([ofctl_strip < monitor.log], [0], [dnl
3314 send: OFPT_BUNDLE_CONTROL (OF1.4):
3315 bundle_id=0x1 type=OPEN_REQUEST flags=atomic
3316 OFPT_BUNDLE_CONTROL (OF1.4):
3317 bundle_id=0x1 type=OPEN_REPLY flags=0
3318 OFPT_BARRIER_REPLY (OF1.4):
3319 send: OFPT_BUNDLE_CONTROL (OF1.4):
3320 bundle_id=0x1 type=COMMIT_REQUEST flags=ordered
3321 OFPT_ERROR (OF1.4): OFPBFC_BAD_FLAGS
3322 OFPT_BUNDLE_CONTROL (OF1.4):
3323 bundle_id=0x1 type=COMMIT_REQUEST flags=ordered
3324 OFPT_BARRIER_REPLY (OF1.4):
3330 AT_SETUP([ofproto - bundle discard without open (OpenFlow 1.4)])
3331 AT_KEYWORDS([monitor])
3334 # Start a monitor, use the required protocol version
3335 ovs-ofctl -O OpenFlow14 monitor br0 --detach --no-chdir --pidfile >monitor.log 2>&1
3336 AT_CAPTURE_FILE([monitor.log])
3338 # Open, Close, Close
3339 ovs-appctl -t ovs-ofctl ofctl/send "05 21 00 10 00 00 00 0a 00 00 00 01 00 06 00 01"
3340 ovs-appctl -t ovs-ofctl ofctl/barrier
3341 ovs-appctl -t ovs-ofctl exit
3343 AT_CHECK([ofctl_strip < monitor.log], [0], [dnl
3344 send: OFPT_BUNDLE_CONTROL (OF1.4):
3345 bundle_id=0x1 type=DISCARD_REQUEST flags=atomic
3346 OFPT_ERROR (OF1.4): OFPBFC_BAD_ID
3347 OFPT_BUNDLE_CONTROL (OF1.4):
3348 bundle_id=0x1 type=DISCARD_REQUEST flags=atomic
3349 OFPT_BARRIER_REPLY (OF1.4):