1 AT_BANNER([ofproto-dpif])
3 AT_SETUP([ofproto-dpif - revalidator/wait])
5 AT_CHECK([ovs-appctl revalidator/wait])
9 AT_SETUP([ofproto-dpif - active-backup bonding])
10 # Create br0 with interfaces p1, p2 and p7, creating bond0 with p1 and p2
11 # and br1 with interfaces p3, p4 and p8.
12 # toggle p1,p2 of bond0 up and down to test bonding in active-backup mode.
14 [add-bond br0 bond0 p1 p2 bond_mode=active-backup --\
15 set interface p1 type=dummy options:pstream=punix:$OVS_RUNDIR/p1.sock ofport_request=1 -- \
16 set interface p2 type=dummy options:pstream=punix:$OVS_RUNDIR/p2.sock ofport_request=2 -- \
17 add-port br0 p7 -- set interface p7 ofport_request=7 type=dummy -- \
19 set bridge br1 other-config:hwaddr=aa:66:aa:66:00:00 -- \
20 set bridge br1 datapath-type=dummy other-config:datapath-id=1234 \
22 add-port br1 p3 -- set interface p3 type=dummy options:stream=unix:$OVS_RUNDIR/p1.sock ofport_request=3 -- \
23 add-port br1 p4 -- set interface p4 type=dummy options:stream=unix:$OVS_RUNDIR/p2.sock ofport_request=4 -- \
24 add-port br1 p8 -- set interface p8 ofport_request=8 type=dummy --])
25 WAIT_FOR_DUMMY_PORTS([p3], [p4])
26 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
28 AT_CHECK([ovs-ofctl add-flow br0 action=normal])
29 AT_CHECK([ovs-ofctl add-flow br1 action=normal])
30 ovs-appctl netdev-dummy/set-admin-state up
31 ovs-appctl time/warp 100
32 ovs-appctl netdev-dummy/set-admin-state p2 down
34 ovs-appctl time/warp 100
35 AT_CHECK([ovs-appctl netdev-dummy/receive p7 'in_port(7),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
36 AT_CHECK([ovs-appctl netdev-dummy/receive p7 'in_port(7),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.3,dst=10.0.0.4,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
37 ovs-appctl time/warp 100
38 ovs-appctl netdev-dummy/set-admin-state p2 up
39 ovs-appctl netdev-dummy/set-admin-state p1 down
40 ovs-appctl time/warp 100
41 AT_CHECK([ovs-appctl netdev-dummy/receive p7 'in_port(7),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0d),eth_type(0x0800),ipv4(src=10.0.0.5,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
42 AT_CHECK([ovs-appctl netdev-dummy/receive p7 'in_port(7),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0e),eth_type(0x0800),ipv4(src=10.0.0.6,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
43 ovs-appctl time/warp 200 100
45 AT_CHECK([grep 'in_port([[348]])' ovs-vswitchd.log | filter_flow_install | strip_xout], [0], [dnl
46 recirc_id(0),in_port(3),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(frag=no), actions: <del>
47 recirc_id(0),in_port(3),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(frag=no), actions: <del>
48 recirc_id(0),in_port(4),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0d),eth_type(0x0800),ipv4(frag=no), actions: <del>
49 recirc_id(0),in_port(4),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0e),eth_type(0x0800),ipv4(frag=no), actions: <del>
50 recirc_id(0),in_port(4),eth(src=50:54:00:00:00:09,dst=ff:ff:ff:ff:ff:ff),eth_type(0x8035), actions: <del>
51 recirc_id(0),in_port(4),eth(src=50:54:00:00:00:0b,dst=ff:ff:ff:ff:ff:ff),eth_type(0x8035), actions: <del>
56 AT_SETUP([ofproto-dpif - balance-slb bonding])
57 # Create br0 with interfaces bond0(p1, p2, p3) and p7,
58 # and br1 with interfaces p4, p5, p6 and p8.
59 # p1 <-> p4, p2 <-> p5, p3 <-> p6
60 # Send some traffic, make sure the traffic are spread based on source mac.
62 [add-bond br0 bond0 p1 p2 p3 bond_mode=balance-slb --\
63 set interface p1 type=dummy options:pstream=punix:$OVS_RUNDIR/p1.sock ofport_request=1 -- \
64 set interface p2 type=dummy options:pstream=punix:$OVS_RUNDIR/p2.sock ofport_request=2 -- \
65 set interface p3 type=dummy options:pstream=punix:$OVS_RUNDIR/p3.sock ofport_request=3 -- \
66 add-port br0 p7 -- set interface p7 ofport_request=7 type=dummy -- \
68 set bridge br1 other-config:hwaddr=aa:66:aa:66:00:00 -- \
69 set bridge br1 datapath-type=dummy other-config:datapath-id=1234 \
71 add-port br1 p4 -- set interface p4 type=dummy options:stream=unix:$OVS_RUNDIR/p1.sock ofport_request=4 -- \
72 add-port br1 p5 -- set interface p5 type=dummy options:stream=unix:$OVS_RUNDIR/p2.sock ofport_request=5 -- \
73 add-port br1 p6 -- set interface p6 type=dummy options:stream=unix:$OVS_RUNDIR/p3.sock ofport_request=6 -- \
74 add-port br1 p8 -- set interface p8 ofport_request=8 type=dummy --])
75 WAIT_FOR_DUMMY_PORTS([p4], [p5], [p6])
76 AT_CHECK([ovs-ofctl add-flow br0 action=normal])
77 AT_CHECK([ovs-ofctl add-flow br1 action=normal])
78 AT_CHECK([ovs-appctl netdev-dummy/set-admin-state up], 0, [OK
81 ovs-appctl time/warp 100
83 for i in `seq 0 100 |xargs printf '%02x\n'`;
85 pkt="in_port(7),eth(src=50:54:00:00:00:$i,dst=50:54:00:00:01:00),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)"
86 AT_CHECK([ovs-appctl netdev-dummy/receive p7 $pkt])
89 ovs-appctl time/warp 100
90 AT_CHECK([ovs-appctl dpif/dump-flows br1 > br1_flows.txt])
91 # Make sure there is resonable distribution to all three ports.
92 # We don't want to make this check precise, in case hash function changes.
93 AT_CHECK([test `egrep 'in_port\(4\)' br1_flows.txt |wc -l` -gt 3])
94 AT_CHECK([test `egrep 'in_port\(5\)' br1_flows.txt |wc -l` -gt 3])
95 AT_CHECK([test `egrep 'in_port\(6\)' br1_flows.txt |wc -l` -gt 3])
99 AT_SETUP([ofproto-dpif - balance-tcp bonding])
100 # Create br0 with interfaces bond0(p1, p2, p3) and p7,
101 # and br1 with interfaces bond1(p4, p5, p6) and p8.
103 # Send some traffic, make sure the traffic are spread based on L4 headers.
105 [add-bond br0 bond0 p1 p2 p3 bond_mode=balance-tcp lacp=active \
106 other-config:lacp-time=fast other-config:bond-rebalance-interval=0 --\
107 set interface p1 type=dummy options:pstream=punix:$OVS_RUNDIR/p1.sock ofport_request=1 -- \
108 set interface p2 type=dummy options:pstream=punix:$OVS_RUNDIR/p2.sock ofport_request=2 -- \
109 set interface p3 type=dummy options:pstream=punix:$OVS_RUNDIR/p3.sock ofport_request=3 -- \
110 add-port br0 p7 -- set interface p7 ofport_request=7 type=dummy -- \
112 set bridge br1 other-config:hwaddr=aa:66:aa:66:00:00 -- \
113 set bridge br1 datapath-type=dummy other-config:datapath-id=1234 \
114 fail-mode=secure -- \
115 add-bond br1 bond1 p4 p5 p6 bond_mode=balance-tcp lacp=active \
116 other-config:lacp-time=fast other-config:bond-rebalance-interval=0 --\
117 set interface p4 type=dummy options:stream=unix:$OVS_RUNDIR/p1.sock ofport_request=4 -- \
118 set interface p5 type=dummy options:stream=unix:$OVS_RUNDIR/p2.sock ofport_request=5 -- \
119 set interface p6 type=dummy options:stream=unix:$OVS_RUNDIR/p3.sock ofport_request=6 -- \
120 add-port br1 p8 -- set interface p8 ofport_request=8 type=dummy --])
121 AT_CHECK([ovs-appctl netdev-dummy/set-admin-state up], 0, [OK
123 AT_CHECK([ovs-ofctl add-flow br0 action=normal])
124 AT_CHECK([ovs-ofctl add-flow br1 action=normal])
125 AT_CHECK([ovs-appctl upcall/disable-megaflows], [0], [megaflows disabled
127 OVS_WAIT_WHILE([ovs-appctl bond/show | grep "may_enable: false"])
129 ovs-appctl time/warp 100
130 ovs-appctl lacp/show > lacp.txt
131 ovs-appctl bond/show > bond.txt
133 for i in `seq 0 255` ;
135 pkt="in_port(7),eth(src=50:54:00:00:00:05,dst=50:54:00:00:01:00),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=$i),tcp_flags(ack)"
136 AT_CHECK([ovs-appctl netdev-dummy/receive p7 $pkt])
139 ovs-appctl time/warp 300 100
140 AT_CHECK([ovs-appctl dpif/dump-flows br0 |grep tcp > br0_flows.txt])
141 AT_CHECK([ovs-appctl dpif/dump-flows br1 |grep tcp > br1_flows.txt])
142 # Make sure there is resonable distribution to all three ports.
143 # We don't want to make this check precise, in case hash function changes.
144 AT_CHECK([test `grep in_port.4 br1_flows.txt |wc -l` -gt 24])
145 AT_CHECK([test `grep in_port.5 br1_flows.txt |wc -l` -gt 24])
146 AT_CHECK([test `grep in_port.6 br1_flows.txt |wc -l` -gt 24])
151 # Makes sure recirculation does not change the way packet is handled.
152 AT_SETUP([ofproto-dpif - balance-tcp bonding, different recirc flow ])
154 [add-bond br0 bond0 p1 p2 bond_mode=balance-tcp lacp=active \
155 other-config:lacp-time=fast other-config:bond-rebalance-interval=0 -- \
156 set interface p1 type=dummy options:pstream=punix:$OVS_RUNDIR/p1.sock ofport_request=1 -- \
157 set interface p2 type=dummy options:pstream=punix:$OVS_RUNDIR/p2.sock ofport_request=2 -- \
159 set bridge br1 other-config:hwaddr=aa:66:aa:66:00:00 -- \
160 set bridge br1 datapath-type=dummy other-config:datapath-id=1234 \
161 fail-mode=standalone -- \
162 add-bond br1 bond1 p3 p4 bond_mode=balance-tcp lacp=active \
163 other-config:lacp-time=fast other-config:bond-rebalance-interval=0 -- \
164 set interface p3 type=dummy options:stream=unix:$OVS_RUNDIR/p1.sock ofport_request=3 -- \
165 set interface p4 type=dummy options:stream=unix:$OVS_RUNDIR/p2.sock ofport_request=4 -- \
166 add-port br1 br1- -- set interface br1- type=patch options:peer=br1+ ofport_request=100 -- \
168 set bridge br-int other-config:hwaddr=aa:77:aa:77:00:00 -- \
169 set bridge br-int datapath-type=dummy other-config:datapath-id=1235 \
170 fail-mode=secure -- \
171 add-port br-int br1+ -- set interface br1+ type=patch options:peer=br1- ofport_request=101 -- \
172 add-port br-int p5 -- set interface p5 ofport_request=5 type=dummy
174 AT_CHECK([ovs-appctl netdev-dummy/set-admin-state up], 0, [OK
177 # Waits for all ifaces enabled.
178 OVS_WAIT_UNTIL([test `ovs-appctl bond/show | grep -- "may_enable: true" | wc -l` -ge 4])
180 # The dl_vlan flow should not be ever matched,
181 # since recirculation should not change the flow handling.
182 AT_DATA([flows.txt], [dnl
183 table=0 priority=1 in_port=5 actions=mod_vlan_vid:1,output(101)
184 table=0 priority=2 in_port=5 dl_vlan=1 actions=drop
186 AT_CHECK([ovs-ofctl add-flows br-int flows.txt])
188 # Sends a packet to trigger recirculation.
189 AT_CHECK([ovs-appctl netdev-dummy/receive p5 "in_port(5),eth(src=50:54:00:00:00:05,dst=50:54:00:00:01:00),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1)"])
191 # Collects flow stats.
192 AT_CHECK([ovs-appctl revalidator/purge], [0])
194 # Checks the flow stats in br1, should only be one flow with non-zero
195 # 'n_packets' from internal table.
196 AT_CHECK([ovs-appctl bridge/dump-flows br1 | ofctl_strip | grep -- "n_packets" | grep -- "table_id" | sed -e 's/output:[[0-9]][[0-9]]*/output/'] , [0], [dnl
197 table_id=254, n_packets=1, n_bytes=64, priority=20,recirc_id=0x0,dp_hash=0x0/0xff,actions=output
200 # Checks the flow stats in br-int, should be only one match.
201 AT_CHECK([ovs-ofctl dump-flows br-int | ofctl_strip | sort], [0], [dnl
202 n_packets=1, n_bytes=60, priority=1,in_port=5 actions=mod_vlan_vid:1,output:101
203 priority=2,in_port=5,dl_vlan=1 actions=drop
210 AT_SETUP([ofproto-dpif - resubmit])
212 add_of_ports br0 1 10 11 12 13 14 15 16 17 18 19 20 21
213 AT_DATA([flows.txt], [dnl
214 table=0 in_port=1 priority=1000 icmp actions=output(10),resubmit(2),output(19),resubmit(3),output(21)
215 table=0 in_port=2 priority=1500 icmp actions=output(11),resubmit(,1),output(16),resubmit(2,1),output(18)
216 table=0 in_port=3 priority=2000 icmp actions=output(20)
217 table=1 in_port=1 priority=1000 icmp actions=output(12),resubmit(4,1),output(13),resubmit(3),output(15)
218 table=1 in_port=2 priority=1500 icmp actions=output(17),resubmit(,2)
219 table=1 in_port=3 priority=1500 icmp actions=output(14),resubmit(,2)
221 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
222 AT_CHECK([ovs-appctl ofproto/trace br0 'in_port=1,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,dl_type=0x0800,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=1,nw_tos=0,nw_ttl=128,icmp_type=8,icmp_code=0'], [0], [stdout])
223 AT_CHECK([tail -1 stdout], [0],
224 [Datapath actions: 10,11,12,13,14,15,16,17,18,19,20,21
229 AT_SETUP([ofproto-dpif - goto table])
231 add_of_ports br0 1 10 11
232 echo "table=0 in_port=1 actions=output(10),goto_table(1)" > flows.txt
233 for i in `seq 1 63`; do echo "table=$i actions=goto_table($(($i+1)))"; done >> flows.txt
234 echo "table=64 actions=output(11)" >> flows.txt
235 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flows br0 flows.txt])
236 AT_CHECK([ovs-appctl ofproto/trace br0 'in_port=1,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,dl_type=0x0800,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=1,nw_tos=0,nw_ttl=128,icmp_type=8,icmp_code=0'], [0], [stdout])
237 AT_CHECK([tail -1 stdout], [0],
238 [Datapath actions: 10,11
243 AT_SETUP([ofproto-dpif - write actions])
245 add_of_ports br0 1 10 11 12 13
246 AT_DATA([flows.txt], [dnl
247 table=0 in_port=1,ip actions=output(10),write_actions(set_field:192.168.3.90->ip_src,output(12)),goto_table(1)
248 table=1 ip actions=write_actions(output(13)),goto_table(2)
249 table=2 ip actions=set_field:192.168.3.91->ip_src,output(11)
251 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flows br0 flows.txt])
252 AT_CHECK([ovs-appctl ofproto/trace br0 'in_port=1,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,dl_type=0x0800,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=1,nw_tos=0,nw_ttl=128,icmp_type=8,icmp_code=0'], [0], [stdout])
253 AT_CHECK([tail -2 stdout], [0],
254 [Megaflow: recirc_id=0,ip,in_port=1,nw_src=192.168.0.1,nw_frag=no
255 Datapath actions: 10,set(ipv4(src=192.168.3.91)),11,set(ipv4(src=192.168.3.90)),13
260 AT_SETUP([ofproto-dpif - modify IPv6 Neighbor Solitication (ND)])
262 add_of_ports br0 1 10 11 12 13
263 AT_DATA([flows.txt], [dnl
264 table=0 in_port=1,icmp6,icmpv6_type=135 actions=output(10),write_actions(set_field:fe80::3->nd_target,set_field:aa:aa:aa:aa:aa:aa->nd_sll,output(12)),goto_table(1)
265 table=1 icmp6 actions=write_actions(output(13)),goto_table(2)
266 table=2 in_port=1,icmp6,icmpv6_type=135 actions=set_field:fe80::4->nd_target,set_field:cc:cc:cc:cc:cc:cc->nd_sll,output(11)
268 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flows br0 flows.txt])
269 AT_CHECK([ovs-appctl ofproto/trace br0 'in_port=1,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,icmp6,ipv6_src=fe80::1,ipv6_dst=fe80::2,nw_tos=0,nw_ttl=128,icmpv6_type=135,nd_target=fe80::2020,nd_sll=66:55:44:33:22:11'], [0], [stdout])
270 AT_CHECK([tail -4 stdout], [0],
271 [Megaflow: recirc_id=0,icmp6,in_port=1,nw_frag=no,icmp_type=0x87/0xff,icmp_code=0x0/0xff,nd_target=fe80::2020,nd_sll=66:55:44:33:22:11
272 Datapath actions: 10,set(nd(target=fe80::4,sll=cc:cc:cc:cc:cc:cc)),11,set(nd(target=fe80::3,sll=aa:aa:aa:aa:aa:aa)),13
273 This flow is handled by the userspace slow path because it:
274 - Uses action(s) not supported by datapath.
279 AT_SETUP([ofproto-dpif - clear actions])
281 add_of_ports br0 1 10 11 12
282 AT_DATA([flows.txt], [dnl
283 table=0 in_port=1,ip actions=output(10),write_actions(set_field:192.168.3.90->ip_src,output(12)),goto_table(1)
284 table=1 tcp actions=set_field:91->tp_src,output(11),clear_actions
286 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flows br0 flows.txt])
287 AT_CHECK([ovs-appctl ofproto/trace br0 'in_port=1,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,dl_type=0x0800,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=6,nw_tos=0,nw_ttl=128,tp_src=8,tp_dst=9'], [0], [stdout])
288 AT_CHECK([tail -2 stdout], [0],
289 [Megaflow: recirc_id=0,tcp,in_port=1,nw_frag=no,tp_src=8
290 Datapath actions: 10,set(tcp(src=91)),11
295 AT_SETUP([ofproto-dpif - group chaining])
297 add_of_ports br0 1 10 11
298 AT_CHECK([ovs-ofctl -O OpenFlow12 add-group br0 'group_id=1234,type=all,bucket=set_field:192.168.3.90->ip_src,group:123,bucket=output:11'])
299 AT_CHECK([ovs-ofctl -O OpenFlow12 add-group br0 'group_id=123,type=all,bucket=output:10'])
300 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 'ip actions=group:1234'])
301 AT_CHECK([ovs-appctl ofproto/trace br0 'in_port=1,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,dl_type=0x0800,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=1,nw_tos=0,nw_ttl=128,icmp_type=8,icmp_code=0'], [0], [stdout])
302 AT_CHECK([tail -1 stdout], [0],
303 [Datapath actions: set(ipv4(src=192.168.3.90)),10,set(ipv4(src=192.168.0.1)),11
308 AT_SETUP([ofproto-dpif - all group in action list])
310 add_of_ports br0 1 10 11
311 AT_CHECK([ovs-ofctl -O OpenFlow12 add-group br0 'group_id=1234,type=all,bucket=output:10,set_field:192.168.3.90->ip_src,bucket=output:11'])
312 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 'ip actions=group:1234'])
313 AT_CHECK([ovs-appctl ofproto/trace br0 'in_port=1,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,dl_type=0x0800,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=1,nw_tos=0,nw_ttl=128,icmp_type=8,icmp_code=0'], [0], [stdout])
314 # Must match on the source address to be able to restore it's value for
316 AT_CHECK([tail -2 stdout], [0],
317 [Megaflow: recirc_id=0,ip,in_port=1,nw_src=192.168.0.1,nw_frag=no
318 Datapath actions: set(ipv4(src=192.168.3.90)),10,set(ipv4(src=192.168.0.1)),11
323 AT_SETUP([ofproto-dpif - indirect group in action list])
325 add_of_ports br0 1 10
326 AT_CHECK([ovs-ofctl -O OpenFlow12 add-group br0 group_id=1234,type=indirect,bucket=output:10])
327 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 'ip actions=group:1234'])
328 AT_CHECK([ovs-appctl ofproto/trace br0 'in_port=1,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,dl_type=0x0800,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=1,nw_tos=0,nw_ttl=128,icmp_type=8,icmp_code=0'], [0], [stdout])
329 AT_CHECK([tail -1 stdout], [0],
330 [Datapath actions: 10
335 AT_SETUP([ofproto-dpif - group actions have no effect afterwards])
337 add_of_ports br0 1 10
338 AT_CHECK([ovs-ofctl -O OpenFlow12 add-group br0 'group_id=1234,type=select,bucket=set_field:192.168.3.90->ip_src,output:10'])
339 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 'ip actions=group:1234,output:10'])
340 AT_CHECK([ovs-appctl ofproto/trace br0 'in_port=1,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,dl_type=0x0800,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=1,nw_tos=0,nw_ttl=128,icmp_type=8,icmp_code=0'], [0], [stdout])
341 AT_CHECK([tail -1 stdout], [0],
342 [Datapath actions: set(ipv4(src=192.168.3.90,dst=192.168.0.2)),10,set(ipv4(src=192.168.0.1,dst=192.168.0.2)),10
347 AT_SETUP([ofproto-dpif - all group in action set])
349 add_of_ports br0 1 10 11
350 AT_CHECK([ovs-ofctl -O OpenFlow12 add-group br0 'group_id=1234,type=all,bucket=output:10,set_field:192.168.3.90->ip_src,bucket=output:11'])
351 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 'ip actions=write_actions(group:1234)'])
352 AT_CHECK([ovs-appctl ofproto/trace br0 'in_port=1,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,dl_type=0x0800,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=1,nw_tos=0,nw_ttl=128,icmp_type=8,icmp_code=0'], [0], [stdout])
353 # Must match on the source address to be able to restore it's value for
355 AT_CHECK([tail -2 stdout], [0],
356 [Megaflow: recirc_id=0,ip,in_port=1,nw_src=192.168.0.1,nw_frag=no
357 Datapath actions: set(ipv4(src=192.168.3.90)),10,set(ipv4(src=192.168.0.1)),11
362 AT_SETUP([ofproto-dpif - indirect group in action set])
364 add_of_ports br0 1 10
365 AT_CHECK([ovs-ofctl -O OpenFlow12 add-group br0 group_id=1234,type=indirect,bucket=output:10])
366 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 'ip actions=write_actions(group:1234)'])
367 AT_CHECK([ovs-appctl ofproto/trace br0 'in_port=1,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,dl_type=0x0800,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=1,nw_tos=0,nw_ttl=128,icmp_type=8,icmp_code=0'], [0], [stdout])
368 AT_CHECK([tail -1 stdout], [0],
369 [Datapath actions: 10
374 AT_SETUP([ofproto-dpif - select group])
376 add_of_ports br0 1 10 11
377 AT_CHECK([ovs-ofctl -O OpenFlow12 add-group br0 'group_id=1234,type=select,bucket=output:10,bucket=output:11'])
378 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 'ip actions=write_actions(group:1234)'])
380 # Try a bunch of different flows and make sure that they get distributed
382 for d in 0 1 2 3 4 5 6 7 8 9 a b c d e f; do
383 AT_CHECK([ovs-appctl ofproto/trace br0 "in_port=1,dl_src=50:54:00:00:00:07,dl_dst=50:54:00:00:00:0$d,dl_type=0x0800,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=1,nw_tos=0,nw_ttl=128,icmp_type=8,icmp_code=0"], [0], [stdout])
384 tail -1 stdout >> results
386 sort results | uniq -c
387 AT_CHECK([sort results | uniq], [0],
388 [Datapath actions: 10
394 AT_SETUP([ofproto-dpif - select group with watch port])
396 add_of_ports br0 1 10 11
397 AT_CHECK([ovs-ofctl -O OpenFlow12 add-group br0 'group_id=1234,type=select,bucket=watch_port:10,output:10,bucket=output:11'])
398 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 'ip actions=write_actions(group:1234)'])
399 AT_CHECK([ovs-appctl ofproto/trace br0 'in_port=1,dl_src=50:54:00:00:00:07,dl_dst=50:54:00:00:00:07,dl_type=0x0800,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=1,nw_tos=0,nw_ttl=128,icmp_type=8,icmp_code=0'], [0], [stdout])
400 AT_CHECK([tail -1 stdout], [0],
401 [Datapath actions: 11
406 AT_SETUP([ofproto-dpif - select group with weight])
408 add_of_ports br0 1 10 11 12
409 AT_CHECK([ovs-ofctl -O OpenFlow12 add-group br0 'group_id=1234,type=select,bucket=output:10,bucket=output:11,weight=2000,bucket=output:12,weight=0'])
410 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 'ip actions=write_actions(group:1234)'])
411 AT_CHECK([ovs-appctl ofproto/trace br0 'in_port=1,dl_src=50:54:00:00:00:07,dl_dst=50:54:00:00:00:07,dl_type=0x0800,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=1,nw_tos=0,nw_ttl=128,icmp_type=8,icmp_code=0'], [0], [stdout])
412 AT_CHECK([tail -1 stdout], [0],
413 [Datapath actions: 11
418 AT_SETUP([ofproto-dpif - select group with hash selection method])
420 add_of_ports br0 1 10 11
421 AT_CHECK([ovs-ofctl -O OpenFlow15 add-group br0 'group_id=1234,type=select,selection_method=hash,fields=eth_dst,bucket=output:10,bucket=output:11'])
422 AT_CHECK([ovs-ofctl -O OpenFlow15 add-flow br0 'ip actions=write_actions(group:1234)'])
424 # Try a bunch of different flows and make sure that they get distributed
426 for d in 0 1 2 3 4 5 6 7 8 9 a b c d e f; do
427 AT_CHECK([ovs-appctl ofproto/trace br0 "in_port=1,dl_src=50:54:00:00:00:07,dl_dst=50:54:00:00:00:0$d,dl_type=0x0800,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=1,nw_tos=0,nw_ttl=128,icmp_type=8,icmp_code=0"], [0], [stdout])
428 tail -1 stdout >> results
430 sort results | uniq -c
431 AT_CHECK([sort results | uniq], [0],
432 [Datapath actions: 10
437 # Try a bunch of different flows and make sure that they are not distributed
438 # as they only vary a field that is not hashed
439 for d in 0 1 2 3 4 5 6 7 8 9 a b c d e f; do
440 AT_CHECK([ovs-appctl ofproto/trace br0 "in_port=1,dl_src=50:54:00:00:00:0$d,dl_dst=50:54:00:00:00:07,dl_type=0x0800,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=1,nw_tos=0,nw_ttl=128,icmp_type=8,icmp_code=0"], [0], [stdout])
441 tail -1 stdout >> results
443 sort results | uniq -c
444 AT_CHECK([sort results | uniq | sed 's/1[[01]]/1?/'], [0],
445 [Datapath actions: 1?
451 AT_SETUP([ofproto-dpif - fast failover group])
453 add_of_ports br0 1 10 11
454 AT_CHECK([ovs-ofctl -O OpenFlow12 add-group br0 'group_id=1234,type=ff,bucket=watch_port:10,output:10,bucket=watch_port:11,output:11'])
455 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 'ip actions=write_actions(group:1234)'])
456 AT_CHECK([ovs-appctl ofproto/trace br0 'in_port=1,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,dl_type=0x0800,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=1,nw_tos=0,nw_ttl=128,icmp_type=8,icmp_code=0'], [0], [stdout])
457 AT_CHECK([tail -1 stdout], [0],
458 [Datapath actions: drop
463 AT_SETUP([ofproto-dpif - group stats single bucket])
465 add_of_ports br0 1 10 11
466 AT_CHECK([ovs-ofctl -O OpenFlow12 add-group br0 'group_id=1234,type=select,bucket=output:10,weight=2000,bucket=output:11,weight=0'])
467 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 'ip actions=write_actions(group:1234)'])
471 pkt="in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:01:00),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)"
472 AT_CHECK([ovs-appctl netdev-dummy/receive p1 $pkt])
475 AT_CHECK([ovs-appctl revalidator/purge], [0])
476 AT_CHECK([ovs-ofctl -O OpenFlow12 -vwarn dump-group-stats br0], [0], [stdout])
477 AT_CHECK([strip_xids < stdout | sort], [0], [dnl
478 group_id=1234,ref_count=1,packet_count=3,byte_count=180,bucket0:packet_count=3,byte_count=180,bucket1:packet_count=0,byte_count=0
479 OFPST_GROUP reply (OF1.2):
484 AT_SETUP([ofproto-dpif - group stats all buckets])
486 add_of_ports br0 1 10 11
487 AT_CHECK([ovs-ofctl -O OpenFlow12 add-group br0 'group_id=1234,type=all,bucket=output:10,bucket=output:11'])
488 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 'ip actions=write_actions(group:1234)'])
492 pkt="in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:01:00),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)"
493 AT_CHECK([ovs-appctl netdev-dummy/receive p1 $pkt])
496 AT_CHECK([ovs-appctl revalidator/purge], [0])
497 AT_CHECK([ovs-ofctl -O OpenFlow12 -vwarn dump-group-stats br0], [0], [stdout])
498 AT_CHECK([strip_xids < stdout | sort], [0], [dnl
499 group_id=1234,ref_count=1,packet_count=3,byte_count=180,bucket0:packet_count=3,byte_count=180,bucket1:packet_count=3,byte_count=180
500 OFPST_GROUP reply (OF1.2):
505 AT_SETUP([ofproto-dpif - registers])
507 add_of_ports br0 20 21 22 33 90
508 AT_DATA([flows.txt], [dnl
509 in_port=90 actions=resubmit:2,resubmit:3,resubmit:4,resubmit:91
510 in_port=91 actions=resubmit:5,resubmit:6,resubmit:7,resubmit:92
511 in_port=92 actions=resubmit:8,resubmit:9,resubmit:10,resubmit:11,resubmit:93
512 in_port=93 actions=resubmit:12,resubmit:13,resubmit:14,resubmit:15
514 in_port=2 actions=load:0x000db000->NXM_NX_REG0[[]]
515 in_port=3 actions=load:0xdea->NXM_NX_REG0[[20..31]]
516 in_port=4 actions=load:0xeef->NXM_NX_REG0[[0..11]]
517 in_port=5 actions=move:NXM_NX_REG0[[]]->NXM_NX_REG1[[]]
518 in_port=6 actions=load:0x22222222->NXM_NX_REG2[[]]
519 in_port=7 actions=move:NXM_NX_REG1[[20..31]]->NXM_NX_REG2[[0..11]]
520 in_port=8 actions=move:NXM_NX_REG1[[0..11]]->NXM_NX_REG2[[20..31]]
521 in_port=9,reg0=0xdeadbeef actions=output:20
522 in_port=10,reg1=0xdeadbeef actions=output:21
523 in_port=11,reg2=0xeef22dea actions=output:22
525 dnl Sanilty check all registers
526 in_port=12 actions=load:0x10->NXM_NX_REG0[[]],load:0x11->NXM_NX_REG1[[]],load:0x12->NXM_NX_REG2[[]]
527 in_port=13 actions=load:0x13->NXM_NX_REG3[[]],load:0x14->NXM_NX_REG4[[]],load:0x15->NXM_NX_REG5[[]]
528 in_port=14 actions=load:0x16->NXM_NX_REG6[[]],load:0x17->NXM_NX_REG7[[]]
529 in_port=15,reg0=0x10,reg1=0x11,reg2=0x12,reg3=0x13,reg4=0x14,reg5=0x15,reg6=0x16,reg7=0x17 actions=output:33
532 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
533 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(90),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)'], [0], [stdout])
534 AT_CHECK([tail -1 stdout], [0],
535 [Datapath actions: 20,21,22,33
540 dnl Tests that the standardized xregs are mapped onto the legacy OVS registers
541 dnl in the manner documented in ovs-ofctl(8).
542 AT_SETUP([ofproto-dpif - extended registers])
544 add_of_ports br0 1 2 3
545 AT_DATA([flows.txt], [dnl
546 table=0 actions=load:0xfedcba9876543210->OXM_OF_PKT_REG1[[]],resubmit(,1)
547 table=1,reg2=0xfedcba98,reg3=0x76543210 actions=2
549 # These low-priority rules shouldn't match. They're here only to make really
550 # sure that the test fails if either of the above rules fails to match.
551 table=0,priority=0 actions=3
552 table=1,priority=0 actions=3
554 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
555 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)'], [0], [stdout])
556 AT_CHECK([tail -1 stdout], [0], [Datapath actions: 2
561 dnl Tests that the standardized xxregs are mapped onto the legacy OVS
562 dnl registers in the manner documented in ovs-ofctl(8).
563 AT_SETUP([ofproto-dpif - extended-extended registers])
565 add_of_ports br0 1 2 3
566 AT_DATA([flows.txt], [dnl
567 table=0 actions=load:0x0123456789abcdeffedcba9876543210->NXM_NX_XXREG1[[]],resubmit(,1)
568 table=1,reg4=0x01234567,reg5=0x89abcdef,reg6=0xfedcba98,reg7=0x76543210 actions=2
570 # These low-priority rules shouldn't match. They're here only to make really
571 # sure that the test fails if either of the above rules fails to match.
572 table=0,priority=0 actions=3
573 table=1,priority=0 actions=3
575 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
576 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)'], [0], [stdout])
577 AT_CHECK([tail -1 stdout], [0], [Datapath actions: 2
582 AT_SETUP([ofproto-dpif - load and move order])
584 add_of_ports br0 1 10 11
585 AT_CHECK([ovs-ofctl -O OpenFlow12 add-group br0 'group_id=1234,type=all,bucket=output:10,move:NXM_NX_REG1[[]]->NXM_OF_IP_SRC[[]],bucket=output:11'])
586 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 'ip actions=write_actions(load:0xffffffff->NXM_NX_REG1[[]],move:NXM_NX_REG1[[]]->NXM_NX_REG2[[]],group:1234)'])
587 AT_CHECK([ovs-appctl ofproto/trace br0 'in_port=1,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,dl_type=0x0800,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=1,nw_tos=0,nw_ttl=128,icmp_type=8,icmp_code=0'], [0], [stdout])
588 AT_CHECK([tail -2 stdout], [0],
589 [Megaflow: recirc_id=0,ip,in_port=1,nw_src=192.168.0.1,nw_frag=no
590 Datapath actions: set(ipv4(src=255.255.255.255)),10,set(ipv4(src=192.168.0.1)),11
595 dnl Tests that 1.5 copy-field can copy into the standardized xregs.
596 AT_SETUP([ofproto-dpif - copy-field into extended registers])
598 add_of_ports br0 1 2 3
599 AT_DATA([flows.txt], [dnl
600 table=0 actions=move:OXM_OF_ETH_SRC[[0..47]]->OXM_OF_PKT_REG0[[0..47]],goto_table(1)
601 table=1,xreg0=0x0000505400000005 actions=2
603 # These low-priority rules shouldn't match. They're here only to make really
604 # sure that the test fails if either of the above rules fails to match.
605 table=0,priority=0 actions=3
606 table=1,priority=0 actions=3
608 AT_CHECK([ovs-ofctl -O OpenFlow15 add-flows br0 flows.txt])
609 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)'], [0], [stdout])
610 AT_CHECK([tail -1 stdout], [0], [Datapath actions: 2
615 dnl Tests that 1.5 set-field with mask in the metadata register.
616 AT_SETUP([ofproto-dpif - masked set-field into metadata])
618 add_of_ports br0 1 2 3
619 AT_DATA([flows.txt], [dnl
620 table=0 actions=set_field:0xfafafafa5a5a5a5a->metadata,goto_table(1)
621 table=1 actions=set_field:0x6b/0xff->metadata,goto_table(2)
622 table=2,metadata=0xfafafafa5a5a5a6b actions=2
624 # These low-priority rules shouldn't match. They're here only to make really
625 # sure that the test fails if either of the above rules fails to match.
626 table=0,priority=0 actions=3
627 table=1,priority=0 actions=3
628 table=2,priority=0 actions=3
630 AT_CHECK([ovs-ofctl -O OpenFlow15 add-flows br0 flows.txt])
631 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)'], [0], [stdout])
632 AT_CHECK([tail -1 stdout], [0], [Datapath actions: 2
638 AT_SETUP([ofproto-dpif - actset_output])
640 add_of_ports br0 1 2 3 4 5 6 7 8 9 10 11 12 13
641 AT_DATA([flows.txt], [dnl
642 table=0,actset_output=unset actions=write_actions(output(2)),goto_table(1)
643 table=1 actions=move:ONFOXM_ET_ACTSET_OUTPUT[[0..31]]->OXM_OF_PKT_REG0[[0..31]],goto_table(2)
645 # Verify that actset_output got set.
646 table=2,priority=20,actset_output=2 actions=4,goto_table(3)
647 table=2,priority=10 actions=5,goto_table(3)
649 # Verify that xreg0 got copied properly from actset_output.
650 table=3,priority=20,xreg0=2 actions=6,goto_table(4)
651 table=3,priority=10 actions=7,goto_table(4)
653 # Verify that xxreg0 got copied properly from actset_output.
654 table=3,priority=20,xxreg0=2 actions=6,goto_table(4)
655 table=3,priority=10 actions=7,goto_table(4)
657 # Verify that adding a group action unsets actset_output,
658 # even if output follows group.
659 table=4 actions=write_actions(group(5),output(10)),goto_table(5)
660 table=5,priority=20,actset_output=unset actions=8,goto_table(6)
661 table=5,priority=10 actions=9,goto_table(6)
663 # Verify that adding another output action doesn't change actset_output
664 # (since there's still a group).
665 table=6 actions=write_actions(output(3)),goto_table(7)
666 table=7,priority=20,actset_output=unset actions=10,goto_table(8)
667 table=7,priority=10 actions=11,goto_table(8)
669 # Verify that clearing the action set, then writing an output action,
670 # causes actset_output to be set again.
671 table=8,actions=clear_actions,write_actions(output(3),output(2)),goto_table(9)
672 table=9,priority=20,actset_output=2 actions=12
673 table=9,priority=10 actions=13
675 AT_CHECK([ovs-ofctl -O OpenFlow13 add-group br0 'group_id=5,type=all,bucket=output:1'])
676 AT_CHECK([ovs-ofctl -O OpenFlow13 add-flows br0 flows.txt])
677 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)'], [0], [stdout])
678 AT_CHECK([tail -1 stdout], [0], [Datapath actions: 4,6,8,10,12,2
682 AT_SETUP([ofproto-dpif - push-pop])
684 add_of_ports br0 20 21 22 33 90
685 AT_DATA([flows.txt], [dnl
686 in_port=90 actions=load:20->NXM_NX_REG0[[0..7]],load:21->NXM_NX_REG1[[0..7]],load:22->NXM_NX_REG2[[0..7]], load:33->NXM_NX_REG3[[0..7]], push:NXM_NX_REG0[[]], push:NXM_NX_REG1[[0..7]],push:NXM_NX_REG2[[0..15]], push:NXM_NX_REG3[[]], resubmit:2, resubmit:3, resubmit:4, resubmit:5
687 in_port=2 actions=pop:NXM_NX_REG0[[0..7]],output:NXM_NX_REG0[[]]
688 in_port=3 actions=pop:NXM_NX_REG1[[0..7]],output:NXM_NX_REG1[[]]
689 in_port=4 actions=pop:NXM_NX_REG2[[0..15]],output:NXM_NX_REG2[[]]
690 in_port=5 actions=pop:NXM_NX_REG3[[]],output:NXM_NX_REG3[[]]
693 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
694 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(90),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)'], [0], [stdout])
695 AT_CHECK([tail -1 stdout], [0],
696 [Datapath actions: 33,22,21,20
701 AT_SETUP([ofproto-dpif - output])
703 add_of_ports br0 1 9 10 11 55 66 77 88
704 AT_DATA([flows.txt], [dnl
705 in_port=1 actions=resubmit:2,resubmit:3,resubmit:4,resubmit:5,resubmit:6,resubmit:7,resubmit:8
706 in_port=2 actions=output:9
707 in_port=3 actions=load:55->NXM_NX_REG0[[]],output:NXM_NX_REG0[[]],load:66->NXM_NX_REG1[[]]
708 in_port=4 actions=output:10,output:NXM_NX_REG0[[]],output:NXM_NX_REG1[[]],output:11
709 in_port=5 actions=load:77->NXM_NX_REG0[[0..15]],load:88->NXM_NX_REG0[[16..31]]
710 in_port=6 actions=output:NXM_NX_REG0[[0..15]],output:NXM_NX_REG0[[16..31]]
711 in_port=7 actions=load:0x110000ff->NXM_NX_REG0[[]],output:NXM_NX_REG0[[]]
712 in_port=8 actions=1,9,load:9->NXM_OF_IN_PORT[[]],1,9
714 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
715 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)'], [0], [stdout])
716 AT_CHECK([tail -1 stdout], [0],
717 [Datapath actions: 9,55,10,55,66,11,77,88,9,1
722 AT_SETUP([ofproto-dpif - dec_ttl])
724 add_of_ports br0 1 2 3 4
725 AT_DATA([flows.txt], [dnl
726 table=0 in_port=1 action=dec_ttl,output:2,resubmit(1,1),output:4
727 table=1 in_port=1 action=dec_ttl,output:3
729 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
730 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=111,tos=0,ttl=2,frag=no)' -generate], [0], [stdout])
731 AT_CHECK([tail -4 stdout], [0],
732 [Megaflow: recirc_id=0,ip,in_port=1,nw_ttl=2,nw_frag=no
733 Datapath actions: set(ipv4(ttl=1)),2,4
734 This flow is handled by the userspace slow path because it:
735 - Sends "packet-in" messages to the OpenFlow controller.
737 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=111,tos=0,ttl=3,frag=no)'], [0], [stdout])
738 AT_CHECK([tail -2 stdout], [0],
739 [Megaflow: recirc_id=0,ip,in_port=1,nw_ttl=3,nw_frag=no
740 Datapath actions: set(ipv4(ttl=2)),2,set(ipv4(ttl=1)),3,4
742 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x86dd),ipv6(src=::1,dst=::2,label=0,proto=10,tclass=0x70,hlimit=128,frag=no)'], [0], [stdout])
743 AT_CHECK([tail -2 stdout], [0],
744 [Megaflow: recirc_id=0,ipv6,in_port=1,nw_ttl=128,nw_frag=no
745 Datapath actions: set(ipv6(hlimit=127)),2,set(ipv6(hlimit=126)),3,4
748 AT_CAPTURE_FILE([ofctl_monitor.log])
749 AT_CHECK([ovs-ofctl -P nxt_packet_in monitor br0 65534 invalid_ttl --detach --no-chdir --pidfile 2> ofctl_monitor.log])
750 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=111,tos=0,ttl=2,frag=no)' -generate], [0], [stdout])
751 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
752 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
753 NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=34 in_port=1 (via invalid_ttl) data_len=34 (unbuffered)
754 ip,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=111,nw_tos=0,nw_ecn=0,nw_ttl=1
759 dnl A dec_ttl action at offset 32 in ofpacts will cause the ofpacts
760 dnl buffer to be resized just before pushing the id of the dec_ttl action.
761 dnl Thus the implementation must account for this by using the
762 dnl reallocated buffer rather than the original buffer.
764 dnl A number of similar rules are added to try and exercise
765 dnl xrealloc sufficiently that it returns a different base pointer
766 AT_SETUP([ofproto-dpif - dec_ttl without arguments at offset 32 in ofpacts])
769 (for i in `seq 0 255`; do
770 printf "dl_src=10:11:11:11:11:%02x actions=output:1,output:1,output:1,dec_ttl,controller\n" $i
772 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
776 dnl A dec_ttl action at offset 32 in ofpacts will cause the ofpacts
777 dnl buffer to be resized just before pushing the id of the dec_ttl action.
778 dnl Thus the implementation must account for this by using the
779 dnl reallocated buffer rather than the original buffer.
781 dnl A number of similar rules are added to try and exercise
782 dnl xrealloc sufficiently that it returns a different base pointer
783 AT_SETUP([ofproto-dpif - dec_ttl with arguments at offset 32 in ofpacts])
786 (for i in `seq 0 255`; do
787 printf "dl_src=10:11:11:11:11:%02x actions=output:1,output:1,output:1,dec_ttl(1),controller\n" $i
789 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
793 dnl A note action at offset 24 in ofpacts will cause the ofpacts
794 dnl buffer to be resized just before pushing the id of the dec_ttl action.
795 dnl Thus the implementation must account for this by using the
796 dnl reallocated buffer rather than the original buffer.
798 dnl A number of similar rules are added to try and exercise
799 dnl xrealloc sufficiently that it returns a different base pointer
800 AT_SETUP([ofproto-dpif - note at offset 24 in ofpacts])
803 (for i in `seq 0 255`; do
804 printf "dl_src=10:11:11:11:11:%02x actions=output:1,output:1,note:ff,controller\n" $i
806 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
810 dnl As of OVS-2.5, a note action after 4 set_field actions are likely to
811 dnl trigger ofpbuf reallocation during decode (~1KB into ofpacts buffer).
812 dnl Using `make check-valgrind' here checks for use-after-free in this
814 AT_SETUP([ofproto-dpif - note action deep inside ofpacts])
816 AT_CHECK([ovs-ofctl add-flow br0 'actions=set_field:0x1->metadata,set_field:0x2->metadata,set_field:0x3->metadata,set_field:0x4->metadata,note:00000000000000000000000000000000,note:00000000000000000000000000000000'])
820 AT_SETUP([ofproto-dpif - output, OFPP_NONE ingress port])
824 AT_CHECK([ovs-ofctl add-flow br0 action=normal])
826 # "in_port" defaults to OFPP_NONE if it's not specified.
827 flow="icmp,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,icmp_type=8,icmp_code=0"
828 AT_CHECK([ovs-appctl ofproto/trace br0 "$flow"], [0], [stdout])
829 AT_CHECK([tail -1 stdout | sed 's/Datapath actions: //' | tr "," "\n" | sort -n], [0], [dnl
838 AT_SETUP([ofproto-dpif - DSCP])
839 OVS_VSWITCHD_START([add-port br0 p1 -- set Interface p1 type=dummy])
841 AT_DATA([flows.txt], [dnl
842 actions=output:LOCAL,enqueue:1:1,enqueue:1:2,enqueue:1:2,enqueue:1:1,output:1,mod_nw_tos:0,output:1,output:LOCAL
844 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
845 AT_CHECK([ovs-vsctl -- \
846 set Port p1 qos=@newqos --\
847 --id=@newqos create QoS type=linux-htb queues=1=@q1,2=@q2 --\
848 --id=@q1 create Queue dscp=1 --\
849 --id=@q2 create Queue dscp=2], [0], [ignore])
850 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(9),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=1.1.1.1,dst=2.2.2.2,proto=1,tos=0xff,ttl=128,frag=no),icmp(type=8,code=0)'], [0], [stdout])
851 AT_CHECK([tail -2 stdout], [0],
852 [Megaflow: recirc_id=0,skb_priority=0,ip,in_port=9,nw_tos=252,nw_frag=no
853 Datapath actions: dnl
855 set(ipv4(tos=0x4/0xfc)),set(skb_priority(0x1)),1,dnl
856 set(ipv4(tos=0x8/0xfc)),set(skb_priority(0x2)),1,dnl
858 set(ipv4(tos=0x4/0xfc)),set(skb_priority(0x1)),1,dnl
859 set(ipv4(tos=0xfc/0xfc)),set(skb_priority(0)),1,dnl
860 set(ipv4(tos=0/0xfc)),1,100
865 AT_SETUP([ofproto-dpif - output/flood flags])
867 add_of_ports br0 1 2 3 4 5 6 7
869 AT_DATA([flows.txt], [dnl
870 in_port=local actions=local,flood
871 in_port=1 actions=flood
872 in_port=2 actions=all
873 in_port=3 actions=output:LOCAL,output:1,output:2,output:3,output:4,output:5,output:6,output:7
874 in_port=4 actions=enqueue:LOCAL:1,enqueue:1:1,enqueue:2:1,enqueue:3:2,enqueue:4:1,enqueue:5:1,enqueue:6:1,enqueue:7:1
876 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
877 AT_CHECK([ovs-ofctl mod-port br0 5 noforward])
878 AT_CHECK([ovs-ofctl mod-port br0 6 noflood])
880 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(100),eth(src=00:00:00:00:00:01,dst=00:00:00:00:00:02),eth_type(0x0900)'], [0], [stdout])
881 AT_CHECK([tail -1 stdout \
882 | sed -e 's/Datapath actions: //' | tr ',' '\n' | sort], [0], [dnl
890 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(1),eth(src=00:00:00:00:00:01,dst=00:00:00:00:00:02),eth_type(0x0900)'], [0], [stdout])
891 AT_CHECK([tail -1 stdout \
892 | sed -e 's/Datapath actions: //' | tr ',' '\n' | sort], [0], [dnl
900 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(2),eth(src=00:00:00:00:00:01,dst=00:00:00:00:00:02),eth_type(0x0900)'], [0], [stdout])
901 AT_CHECK([tail -1 stdout \
902 | sed -e 's/Datapath actions: //' | tr ',' '\n' | sort], [0], [dnl
911 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(3),eth(src=00:00:00:00:00:01,dst=00:00:00:00:00:02),eth_type(0x0900)'], [0], [stdout])
912 AT_CHECK([tail -1 stdout], [0],
913 [Datapath actions: 100,1,2,4,6,7
916 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(4),eth(src=00:00:00:00:00:01,dst=00:00:00:00:00:02),eth_type(0x0900)'], [0], [stdout])
917 AT_CHECK([tail -1 stdout], [0],
918 [Datapath actions: set(skb_priority(0x1)),100,1,2,set(skb_priority(0x2)),3,set(skb_priority(0x1)),6,7
923 AT_SETUP([ofproto-dpif - Default Table Miss - OF1.0 (OFPTC_TABLE_MISS_CONTROLLER)])
924 OVS_VSWITCHD_START([dnl
925 add-port br0 p1 -- set Interface p1 type=dummy
927 on_exit 'kill `cat ovs-ofctl.pid`'
929 AT_CAPTURE_FILE([ofctl_monitor.log])
931 AT_CHECK([ovs-ofctl -P nxt_packet_in monitor br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
934 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9),tcp_flags(syn)'
936 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
937 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
938 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
939 NXT_PACKET_IN (xid=0x0): cookie=0x0 total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
940 tcp,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=syn tcp_csum:0
942 NXT_PACKET_IN (xid=0x0): cookie=0x0 total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
943 tcp,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=syn tcp_csum:0
945 NXT_PACKET_IN (xid=0x0): cookie=0x0 total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
946 tcp,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=syn tcp_csum:0
949 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
950 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
957 AT_SETUP([ofproto-dpif - Default Table Miss - OF1.3 (OFPTC_TABLE_MISS_DROP)])
958 OVS_VSWITCHD_START([dnl
959 add-port br0 p1 -- set Interface p1 type=dummy
961 on_exit 'kill `cat ovs-ofctl.pid`'
963 AT_CAPTURE_FILE([ofctl_monitor.log])
964 AT_CHECK([ovs-ofctl del-flows br0])
966 AT_CHECK([ovs-ofctl monitor -OOpenFlow13 -P standard br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
968 dnl Test that missed packets are dropped
970 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9),tcp_flags(ack,syn)'
972 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
974 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
977 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
978 AT_CHECK([ovs-ofctl -OOpenFlow13 dump-flows br0 | ofctl_strip | sort], [0], [dnl
979 OFPST_FLOW reply (OF1.3):
985 AT_SETUP([ofproto-dpif - Table Miss - goto table and OFPTC_TABLE_MISS_CONTROLLER])
986 OVS_VSWITCHD_START([dnl
987 add-port br0 p1 -- set Interface p1 type=dummy
989 on_exit 'kill `cat ovs-ofctl.pid`'
991 AT_CAPTURE_FILE([ofctl_monitor.log])
992 AT_CHECK([ovs-ofctl -OOpenFlow12 add-flow br0 'table=0 actions=goto_table(1)'])
994 AT_CHECK([ovs-ofctl monitor -P standard br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
997 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9),tcp_flags(urg|rst)'
999 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1000 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
1001 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1002 OFPT_PACKET_IN (xid=0x0): total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
1003 tcp,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=rst|urg tcp_csum:0
1005 OFPT_PACKET_IN (xid=0x0): total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
1006 tcp,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=rst|urg tcp_csum:0
1008 OFPT_PACKET_IN (xid=0x0): total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
1009 tcp,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=rst|urg tcp_csum:0
1012 AT_CHECK([ovs-appctl revalidator/purge], [0])
1013 AT_CHECK([ovs-ofctl -OOpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1014 n_packets=3, n_bytes=180, actions=goto_table:1
1015 OFPST_FLOW reply (OF1.2):
1021 AT_SETUP([ofproto-dpif - Table Miss - resubmit and OFPTC_TABLE_MISS_CONTROLLER])
1022 OVS_VSWITCHD_START([dnl
1023 add-port br0 p1 -- set Interface p1 type=dummy
1025 on_exit 'kill `cat ovs-ofctl.pid`'
1027 AT_CAPTURE_FILE([ofctl_monitor.log])
1028 AT_CHECK([ovs-ofctl -OOpenFlow12 add-flow br0 'table=0 actions=resubmit(1,1)'])
1030 AT_CHECK([ovs-ofctl monitor -P standard br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
1033 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9),tcp_flags(0x010)'
1036 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
1037 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1040 AT_CHECK([ovs-appctl revalidator/purge], [0])
1041 AT_CHECK([ovs-ofctl -OOpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1042 n_packets=3, n_bytes=180, actions=resubmit(1,1)
1043 OFPST_FLOW reply (OF1.2):
1049 AT_SETUP([ofproto-dpif - Table Miss - OFPTC_TABLE_MISS_CONTINUE])
1050 OVS_VSWITCHD_START([dnl
1051 add-port br0 p1 -- set Interface p1 type=dummy
1053 on_exit 'kill `cat ovs-ofctl.pid`'
1055 AT_CAPTURE_FILE([ofctl_monitor.log])
1056 AT_CHECK([ovs-ofctl add-flow br0 'table=1 dl_src=10:11:11:11:11:11 actions=controller'])
1057 AT_CHECK([ovs-ofctl -OOpenFlow11 mod-table br0 all continue])
1059 dnl Miss table 0, Hit table 1
1060 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
1063 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=10:11:11:11:11:11,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9),tcp_flags(0x010)'
1065 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1066 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
1068 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1069 NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
1070 tcp,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=ack tcp_csum:0
1072 NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
1073 tcp,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=ack tcp_csum:0
1075 NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
1076 tcp,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=ack tcp_csum:0
1079 dnl Hit table 0, Miss all other tables, sent to controller
1080 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
1083 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9),tcp_flags(0x010)'
1085 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1086 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
1088 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1089 NXT_PACKET_IN (xid=0x0): table_id=253 cookie=0x0 total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
1090 tcp,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=ack tcp_csum:0
1092 NXT_PACKET_IN (xid=0x0): table_id=253 cookie=0x0 total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
1093 tcp,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=ack tcp_csum:0
1095 NXT_PACKET_IN (xid=0x0): table_id=253 cookie=0x0 total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
1096 tcp,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=ack tcp_csum:0
1099 AT_CHECK([ovs-appctl revalidator/purge], [0])
1100 AT_CHECK([ovs-ofctl -OOpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1101 table=1, n_packets=3, n_bytes=180, dl_src=10:11:11:11:11:11 actions=CONTROLLER:65535
1102 OFPST_FLOW reply (OF1.2):
1108 AT_SETUP([ofproto-dpif - Table Miss - goto table and OFPTC_TABLE_MISS_CONTINUE])
1109 OVS_VSWITCHD_START([dnl
1110 add-port br0 p1 -- set Interface p1 type=dummy
1112 on_exit 'kill `cat ovs-ofctl.pid`'
1114 AT_CAPTURE_FILE([ofctl_monitor.log])
1115 AT_DATA([flows.txt], [dnl
1116 table=0 actions=goto_table(1)
1117 table=2 dl_src=10:11:11:11:11:11 actions=controller
1119 AT_CHECK([ovs-ofctl -OOpenFlow12 add-flows br0 flows.txt])
1120 AT_CHECK([ovs-ofctl -OOpenFlow11 mod-table br0 all continue])
1122 dnl Hit table 0, Miss table 1, Hit table 2
1123 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
1126 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=10:11:11:11:11:11,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9),tcp_flags(0x010)'
1128 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1129 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1131 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1132 NXT_PACKET_IN (xid=0x0): table_id=2 cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
1133 tcp,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=ack tcp_csum:0
1135 NXT_PACKET_IN (xid=0x0): table_id=2 cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
1136 tcp,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=ack tcp_csum:0
1138 NXT_PACKET_IN (xid=0x0): table_id=2 cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
1139 tcp,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=ack tcp_csum:0
1142 dnl Hit table 1, Miss all other tables, sent to controller
1143 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
1146 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9),tcp_flags(0x010)'
1148 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1149 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
1151 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1152 NXT_PACKET_IN (xid=0x0): table_id=253 cookie=0x0 total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
1153 tcp,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=ack tcp_csum:0
1155 NXT_PACKET_IN (xid=0x0): table_id=253 cookie=0x0 total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
1156 tcp,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=ack tcp_csum:0
1158 NXT_PACKET_IN (xid=0x0): table_id=253 cookie=0x0 total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
1159 tcp,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=ack tcp_csum:0
1162 AT_CHECK([ovs-appctl revalidator/purge], [0])
1163 AT_CHECK([ovs-ofctl -OOpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1164 n_packets=6, n_bytes=360, actions=goto_table:1
1165 table=2, n_packets=3, n_bytes=180, dl_src=10:11:11:11:11:11 actions=CONTROLLER:65535
1166 OFPST_FLOW reply (OF1.2):
1172 AT_SETUP([ofproto-dpif - Table Miss - resubmit and OFPTC_TABLE_MISS_CONTINUE])
1173 OVS_VSWITCHD_START([dnl
1174 add-port br0 p1 -- set Interface p1 type=dummy
1176 on_exit 'kill `cat ovs-ofctl.pid`'
1178 AT_CAPTURE_FILE([ofctl_monitor.log])
1179 AT_DATA([flows.txt], [dnl
1180 table=0 actions=resubmit(1,1)
1181 table=2 dl_src=10:11:11:11:11:11 actions=controller
1183 AT_CHECK([ovs-ofctl -OOpenFlow12 add-flows br0 flows.txt])
1184 AT_CHECK([ovs-ofctl -OOpenFlow11 mod-table br0 all continue])
1186 dnl Hit table 0, Miss table 1, Dropped
1187 AT_CHECK([ovs-ofctl monitor br0 65534 -P standard --detach --no-chdir --pidfile 2> ofctl_monitor.log])
1190 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=10:11:11:11:11:11,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9),tcp_flags(0x010)'
1192 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1194 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1197 dnl Hit table 1, Dropped
1198 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
1201 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9),tcp_flags(0x010)'
1203 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
1205 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1208 AT_CHECK([ovs-appctl revalidator/purge], [0])
1209 AT_CHECK([ovs-ofctl -OOpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1210 n_packets=6, n_bytes=360, actions=resubmit(1,1)
1211 table=2, dl_src=10:11:11:11:11:11 actions=CONTROLLER:65535
1212 OFPST_FLOW reply (OF1.2):
1218 AT_SETUP([ofproto-dpif - Table Miss - OFPTC_TABLE_MISS_DROP])
1219 OVS_VSWITCHD_START([dnl
1220 add-port br0 p1 -- set Interface p1 type=dummy
1222 on_exit 'kill `cat ovs-ofctl.pid`'
1224 AT_CAPTURE_FILE([ofctl_monitor.log])
1225 AT_CHECK([ovs-ofctl -OOpenFlow11 mod-table br0 all drop])
1227 AT_CHECK([ovs-ofctl monitor -P standard br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
1229 dnl Test that missed packets are dropped
1231 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9),tcp_flags(0x010)'
1233 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
1235 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1238 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
1239 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1246 AT_SETUP([ofproto-dpif - Table Miss - goto table and OFPTC_TABLE_MISS_DROP])
1247 OVS_VSWITCHD_START([dnl
1248 add-port br0 p1 -- set Interface p1 type=dummy
1250 on_exit 'kill `cat ovs-ofctl.pid`'
1252 AT_CAPTURE_FILE([ofctl_monitor.log])
1253 AT_CHECK([ovs-ofctl del-flows br0])
1254 AT_CHECK([ovs-ofctl -OOpenFlow12 add-flow br0 'table=0 actions=goto_table(1)'])
1255 AT_CHECK([ovs-ofctl -OOpenFlow11 mod-table br0 all drop])
1257 AT_CHECK([ovs-ofctl monitor -P standard br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
1259 dnl Test that missed packets are dropped
1261 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9),tcp_flags(0x010)'
1263 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
1265 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1268 AT_CHECK([ovs-appctl revalidator/purge], [0])
1269 AT_CHECK([ovs-ofctl -OOpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1270 n_packets=3, n_bytes=180, actions=goto_table:1
1271 OFPST_FLOW reply (OF1.2):
1277 AT_SETUP([ofproto-dpif - Table Miss - resubmit and OFPTC_TABLE_MISS_DROP])
1278 OVS_VSWITCHD_START([dnl
1279 add-port br0 p1 -- set Interface p1 type=dummy
1281 on_exit 'kill `cat ovs-ofctl.pid`'
1283 AT_CAPTURE_FILE([ofctl_monitor.log])
1284 AT_CHECK([ovs-ofctl del-flows br0])
1285 AT_CHECK([ovs-ofctl -OOpenFlow12 add-flow br0 'table=0 actions=resubmit(1,1)'])
1286 AT_CHECK([ovs-ofctl -OOpenFlow11 mod-table br0 all drop])
1288 AT_CHECK([ovs-ofctl monitor -P standard br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
1290 dnl Test that missed packets are dropped
1292 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9),tcp_flags(0x010)'
1294 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
1296 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1299 AT_CHECK([ovs-appctl revalidator/purge], [0])
1300 AT_CHECK([ovs-ofctl -OOpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1301 n_packets=3, n_bytes=180, actions=resubmit(1,1)
1302 OFPST_FLOW reply (OF1.2):
1308 AT_SETUP([ofproto-dpif - controller])
1309 OVS_VSWITCHD_START([dnl
1310 add-port br0 p1 -- set Interface p1 type=dummy
1312 on_exit 'kill `cat ovs-ofctl.pid`'
1314 AT_CAPTURE_FILE([ofctl_monitor.log])
1315 AT_DATA([flows.txt], [dnl
1316 cookie=0x0 dl_src=10:11:11:11:11:11 actions=controller
1317 cookie=0x1 dl_src=20:22:22:22:22:22 actions=controller,resubmit(80,1)
1318 cookie=0x2 dl_src=30:33:33:33:33:33 actions=mod_vlan_vid:15,controller
1320 cookie=0x3 table=1 in_port=80 actions=load:1->NXM_NX_REG0[[]],mod_vlan_vid:80,controller,resubmit(81,2)
1321 cookie=0x4 table=2 in_port=81 actions=load:2->NXM_NX_REG1[[]],mod_dl_src:80:81:81:81:81:81,controller,resubmit(82,3)
1322 cookie=0x5 table=3 in_port=82 actions=load:3->NXM_NX_REG2[[]],mod_dl_dst:82:82:82:82:82:82,controller,resubmit(83,4)
1323 cookie=0x6 table=4 in_port=83 actions=load:4->NXM_NX_REG3[[]],mod_nw_src:83.83.83.83,controller,resubmit(84,5)
1324 cookie=0x7 table=5 in_port=84 actions=load:5->NXM_NX_REG4[[]],load:6->NXM_NX_TUN_ID[[]],mod_nw_dst:84.84.84.84,controller,resubmit(85,6)
1325 cookie=0x8 table=6 in_port=85 actions=mod_tp_src:85,controller,resubmit(86,7)
1326 cookie=0x9 table=7 in_port=86 actions=mod_tp_dst:86,controller,controller
1327 cookie=0xa dl_src=40:44:44:44:44:41 actions=mod_vlan_vid:99,mod_vlan_pcp:1,controller
1328 cookie=0xd dl_src=80:88:88:88:88:88 arp actions=load:2->OXM_OF_ARP_OP[[]],controller,load:0xc0a88001->OXM_OF_ARP_SPA[[]],controller,load:0x404444444441->OXM_OF_ARP_THA[[]],load:0x01010101->OXM_OF_ARP_SPA[[]],load:0x02020202->OXM_OF_ARP_TPA[[]],controller
1330 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
1333 AT_CHECK([ovs-ofctl monitor -P standard br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
1336 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=9),tcp_flags(0x010)'
1338 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1339 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1341 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1342 OFPT_PACKET_IN (xid=0x0): total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
1343 tcp,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=ack tcp_csum:0
1345 OFPT_PACKET_IN (xid=0x0): total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
1346 tcp,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=ack tcp_csum:0
1348 OFPT_PACKET_IN (xid=0x0): total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
1349 tcp,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=ack tcp_csum:0
1352 dnl Singleton controller action.
1353 AT_CHECK([ovs-ofctl monitor -P standard br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
1356 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=10:11:11:11:11:11,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=10),tcp_flags(0x002)'
1358 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1359 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1361 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1362 OFPT_PACKET_IN (xid=0x0): total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
1363 tcp,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:0
1365 OFPT_PACKET_IN (xid=0x0): total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
1366 tcp,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:0
1368 OFPT_PACKET_IN (xid=0x0): total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
1369 tcp,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:0
1372 dnl Modified controller action.
1373 AT_CHECK([ovs-ofctl monitor -P standard br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
1376 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=30:33:33:33:33:33,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=10),tcp_flags(0x001)'
1378 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1379 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1381 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1382 OFPT_PACKET_IN (xid=0x0): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1383 tcp,dl_vlan=15,dl_vlan_pcp=0,dl_src=30:33:33:33:33:33,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=fin tcp_csum:0
1385 OFPT_PACKET_IN (xid=0x0): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1386 tcp,dl_vlan=15,dl_vlan_pcp=0,dl_src=30:33:33:33:33:33,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=fin tcp_csum:0
1388 OFPT_PACKET_IN (xid=0x0): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1389 tcp,dl_vlan=15,dl_vlan_pcp=0,dl_src=30:33:33:33:33:33,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=fin tcp_csum:0
1392 dnl Modified VLAN controller action.
1393 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --pidfile 2> ofctl_monitor.log])
1396 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=40:44:44:44:44:41,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=16,tos=0,ttl=64,frag=no)'
1398 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1399 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1401 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1402 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1403 ip,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:44:41,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=16,nw_tos=0,nw_ecn=0,nw_ttl=64
1405 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1406 ip,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:44:41,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=16,nw_tos=0,nw_ecn=0,nw_ttl=64
1408 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1409 ip,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:44:41,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=16,nw_tos=0,nw_ecn=0,nw_ttl=64
1413 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
1416 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=20:22:22:22:22:22,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=11),tcp_flags(0x001)'
1418 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 18])
1419 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
1421 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1422 NXT_PACKET_IN (xid=0x0): cookie=0x1 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
1423 tcp,vlan_tci=0x0000,dl_src=20:22:22:22:22:22,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=11,tcp_flags=fin tcp_csum:0
1425 NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x3 total_len=64 reg0=0x1,in_port=1 (via action) data_len=64 (unbuffered)
1426 tcp,dl_vlan=80,dl_vlan_pcp=0,dl_src=20:22:22:22:22:22,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=11,tcp_flags=fin tcp_csum:0
1428 NXT_PACKET_IN (xid=0x0): table_id=2 cookie=0x4 total_len=64 reg0=0x1,reg1=0x2,in_port=1 (via action) data_len=64 (unbuffered)
1429 tcp,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=11,tcp_flags=fin tcp_csum:0
1431 NXT_PACKET_IN (xid=0x0): table_id=3 cookie=0x5 total_len=64 reg0=0x1,reg1=0x2,reg2=0x3,in_port=1 (via action) data_len=64 (unbuffered)
1432 tcp,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=11,tcp_flags=fin tcp_csum:0
1434 NXT_PACKET_IN (xid=0x0): table_id=4 cookie=0x6 total_len=64 reg0=0x1,reg1=0x2,reg2=0x3,reg3=0x4,in_port=1 (via action) data_len=64 (unbuffered)
1435 tcp,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=83.83.83.83,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=11,tcp_flags=fin tcp_csum:1a03
1437 NXT_PACKET_IN (xid=0x0): table_id=5 cookie=0x7 total_len=64 reg0=0x1,reg1=0x2,reg2=0x3,reg3=0x4,reg4=0x5,tun_id=0x6,in_port=1 (via action) data_len=64 (unbuffered)
1438 tcp,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=83.83.83.83,nw_dst=84.84.84.84,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=11,tcp_flags=fin tcp_csum:3205
1440 NXT_PACKET_IN (xid=0x0): table_id=6 cookie=0x8 total_len=64 reg0=0x1,reg1=0x2,reg2=0x3,reg3=0x4,reg4=0x5,tun_id=0x6,in_port=1 (via action) data_len=64 (unbuffered)
1441 tcp,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=83.83.83.83,nw_dst=84.84.84.84,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=85,tp_dst=11,tcp_flags=fin tcp_csum:31b8
1443 NXT_PACKET_IN (xid=0x0): table_id=7 cookie=0x9 total_len=64 reg0=0x1,reg1=0x2,reg2=0x3,reg3=0x4,reg4=0x5,tun_id=0x6,in_port=1 (via action) data_len=64 (unbuffered)
1444 tcp,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=83.83.83.83,nw_dst=84.84.84.84,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=85,tp_dst=86,tcp_flags=fin tcp_csum:316d
1446 NXT_PACKET_IN (xid=0x0): table_id=7 cookie=0x9 total_len=64 reg0=0x1,reg1=0x2,reg2=0x3,reg3=0x4,reg4=0x5,tun_id=0x6,in_port=1 (via action) data_len=64 (unbuffered)
1447 tcp,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=83.83.83.83,nw_dst=84.84.84.84,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=85,tp_dst=86,tcp_flags=fin tcp_csum:316d
1451 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
1454 ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 20 22 22 22 22 22 08 00 45 00 00 1C 00 00 00 00 00 11 00 00 C0 A8 00 01 C0 A8 00 02 00 08 00 0B 00 00 12 34 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00'
1456 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 18])
1457 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
1459 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1460 NXT_PACKET_IN (xid=0x0): cookie=0x1 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
1461 udp,vlan_tci=0x0000,dl_src=20:22:22:22:22:22,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=8,tp_dst=11 udp_csum:1234
1463 NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x3 total_len=64 reg0=0x1,in_port=1 (via action) data_len=64 (unbuffered)
1464 udp,dl_vlan=80,dl_vlan_pcp=0,dl_src=20:22:22:22:22:22,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=8,tp_dst=11 udp_csum:1234
1466 NXT_PACKET_IN (xid=0x0): table_id=2 cookie=0x4 total_len=64 reg0=0x1,reg1=0x2,in_port=1 (via action) data_len=64 (unbuffered)
1467 udp,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=8,tp_dst=11 udp_csum:1234
1469 NXT_PACKET_IN (xid=0x0): table_id=3 cookie=0x5 total_len=64 reg0=0x1,reg1=0x2,reg2=0x3,in_port=1 (via action) data_len=64 (unbuffered)
1470 udp,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=8,tp_dst=11 udp_csum:1234
1472 NXT_PACKET_IN (xid=0x0): table_id=4 cookie=0x6 total_len=64 reg0=0x1,reg1=0x2,reg2=0x3,reg3=0x4,in_port=1 (via action) data_len=64 (unbuffered)
1473 udp,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=83.83.83.83,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=8,tp_dst=11 udp_csum:2c37
1475 NXT_PACKET_IN (xid=0x0): table_id=5 cookie=0x7 total_len=64 reg0=0x1,reg1=0x2,reg2=0x3,reg3=0x4,reg4=0x5,tun_id=0x6,in_port=1 (via action) data_len=64 (unbuffered)
1476 udp,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=83.83.83.83,nw_dst=84.84.84.84,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=8,tp_dst=11 udp_csum:4439
1478 NXT_PACKET_IN (xid=0x0): table_id=6 cookie=0x8 total_len=64 reg0=0x1,reg1=0x2,reg2=0x3,reg3=0x4,reg4=0x5,tun_id=0x6,in_port=1 (via action) data_len=64 (unbuffered)
1479 udp,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=83.83.83.83,nw_dst=84.84.84.84,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=85,tp_dst=11 udp_csum:43ec
1481 NXT_PACKET_IN (xid=0x0): table_id=7 cookie=0x9 total_len=64 reg0=0x1,reg1=0x2,reg2=0x3,reg3=0x4,reg4=0x5,tun_id=0x6,in_port=1 (via action) data_len=64 (unbuffered)
1482 udp,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=83.83.83.83,nw_dst=84.84.84.84,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=85,tp_dst=86 udp_csum:43a1
1484 NXT_PACKET_IN (xid=0x0): table_id=7 cookie=0x9 total_len=64 reg0=0x1,reg1=0x2,reg2=0x3,reg3=0x4,reg4=0x5,tun_id=0x6,in_port=1 (via action) data_len=64 (unbuffered)
1485 udp,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=83.83.83.83,nw_dst=84.84.84.84,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=85,tp_dst=86 udp_csum:43a1
1488 dnl Modified ARP controller action.
1489 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --pidfile 2> ofctl_monitor.log])
1492 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=80:88:88:88:88:88,dst=ff:ff:ff:ff:ff:ff),eth_type(0x0806),arp(sip=192.168.0.1,tip=192.168.0.2,op=1,sha=50:54:00:00:00:05,tha=00:00:00:00:00:00)'
1495 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 18])
1496 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
1497 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1498 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
1499 arp,vlan_tci=0x0000,dl_src=80:88:88:88:88:88,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=192.168.0.1,arp_tpa=192.168.0.2,arp_op=2,arp_sha=50:54:00:00:00:05,arp_tha=00:00:00:00:00:00
1500 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
1501 arp,vlan_tci=0x0000,dl_src=80:88:88:88:88:88,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=192.168.128.1,arp_tpa=192.168.0.2,arp_op=2,arp_sha=50:54:00:00:00:05,arp_tha=00:00:00:00:00:00
1502 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
1503 arp,vlan_tci=0x0000,dl_src=80:88:88:88:88:88,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=1.1.1.1,arp_tpa=2.2.2.2,arp_op=2,arp_sha=50:54:00:00:00:05,arp_tha=40:44:44:44:44:41
1504 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
1505 arp,vlan_tci=0x0000,dl_src=80:88:88:88:88:88,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=192.168.0.1,arp_tpa=192.168.0.2,arp_op=2,arp_sha=50:54:00:00:00:05,arp_tha=00:00:00:00:00:00
1506 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
1507 arp,vlan_tci=0x0000,dl_src=80:88:88:88:88:88,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=192.168.128.1,arp_tpa=192.168.0.2,arp_op=2,arp_sha=50:54:00:00:00:05,arp_tha=00:00:00:00:00:00
1508 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
1509 arp,vlan_tci=0x0000,dl_src=80:88:88:88:88:88,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=1.1.1.1,arp_tpa=2.2.2.2,arp_op=2,arp_sha=50:54:00:00:00:05,arp_tha=40:44:44:44:44:41
1510 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
1511 arp,vlan_tci=0x0000,dl_src=80:88:88:88:88:88,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=192.168.0.1,arp_tpa=192.168.0.2,arp_op=2,arp_sha=50:54:00:00:00:05,arp_tha=00:00:00:00:00:00
1512 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
1513 arp,vlan_tci=0x0000,dl_src=80:88:88:88:88:88,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=192.168.128.1,arp_tpa=192.168.0.2,arp_op=2,arp_sha=50:54:00:00:00:05,arp_tha=00:00:00:00:00:00
1514 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
1515 arp,vlan_tci=0x0000,dl_src=80:88:88:88:88:88,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=1.1.1.1,arp_tpa=2.2.2.2,arp_op=2,arp_sha=50:54:00:00:00:05,arp_tha=40:44:44:44:44:41
1518 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
1521 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
1524 ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 20 22 22 22 22 22 08 00 45 00 00 24 00 00 00 00 00 84 00 00 C0 A8 00 01 C0 A8 00 02 04 58 08 af 00 00 00 00 d9 d7 91 57 01 00 00 34 cf 28 ec 4e 00 01 40 00 00 0a ff ff b7 53 24 19 00 05 00 08 7f 00 00 01 00 05 00 08 c0 a8 02 07 00 0c 00 06 00 05 00 00 80 00 00 04 c0 00 00 04'
1527 AT_CHECK([ovs-appctl time/warp 1000], [0], [ignore])
1528 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 18])
1529 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
1530 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1531 NXT_PACKET_IN (xid=0x0): cookie=0x1 total_len=98 in_port=1 (via action) data_len=98 (unbuffered)
1532 sctp,vlan_tci=0x0000,dl_src=20:22:22:22:22:22,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=1112,tp_dst=2223 sctp_csum:d9d79157
1534 NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x3 total_len=102 reg0=0x1,in_port=1 (via action) data_len=102 (unbuffered)
1535 sctp,dl_vlan=80,dl_vlan_pcp=0,dl_src=20:22:22:22:22:22,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=1112,tp_dst=2223 sctp_csum:d9d79157
1537 NXT_PACKET_IN (xid=0x0): table_id=2 cookie=0x4 total_len=102 reg0=0x1,reg1=0x2,in_port=1 (via action) data_len=102 (unbuffered)
1538 sctp,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=1112,tp_dst=2223 sctp_csum:d9d79157
1540 NXT_PACKET_IN (xid=0x0): table_id=3 cookie=0x5 total_len=102 reg0=0x1,reg1=0x2,reg2=0x3,in_port=1 (via action) data_len=102 (unbuffered)
1541 sctp,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=1112,tp_dst=2223 sctp_csum:d9d79157
1543 NXT_PACKET_IN (xid=0x0): table_id=4 cookie=0x6 total_len=102 reg0=0x1,reg1=0x2,reg2=0x3,reg3=0x4,in_port=1 (via action) data_len=102 (unbuffered)
1544 sctp,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=83.83.83.83,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=1112,tp_dst=2223 sctp_csum:d9d79157
1546 NXT_PACKET_IN (xid=0x0): table_id=5 cookie=0x7 total_len=102 reg0=0x1,reg1=0x2,reg2=0x3,reg3=0x4,reg4=0x5,tun_id=0x6,in_port=1 (via action) data_len=102 (unbuffered)
1547 sctp,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=83.83.83.83,nw_dst=84.84.84.84,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=1112,tp_dst=2223 sctp_csum:d9d79157
1549 NXT_PACKET_IN (xid=0x0): table_id=6 cookie=0x8 total_len=102 reg0=0x1,reg1=0x2,reg2=0x3,reg3=0x4,reg4=0x5,tun_id=0x6,in_port=1 (via action) data_len=102 (unbuffered)
1550 sctp,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=83.83.83.83,nw_dst=84.84.84.84,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=85,tp_dst=2223 sctp_csum:dd778f5f
1552 NXT_PACKET_IN (xid=0x0): table_id=7 cookie=0x9 total_len=102 reg0=0x1,reg1=0x2,reg2=0x3,reg3=0x4,reg4=0x5,tun_id=0x6,in_port=1 (via action) data_len=102 (unbuffered)
1553 sctp,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=83.83.83.83,nw_dst=84.84.84.84,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=85,tp_dst=86 sctp_csum:62051f56
1555 NXT_PACKET_IN (xid=0x0): table_id=7 cookie=0x9 total_len=102 reg0=0x1,reg1=0x2,reg2=0x3,reg3=0x4,reg4=0x5,tun_id=0x6,in_port=1 (via action) data_len=102 (unbuffered)
1556 sctp,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=83.83.83.83,nw_dst=84.84.84.84,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=85,tp_dst=86 sctp_csum:62051f56
1559 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1560 cookie=0x1, n_packets=3, n_bytes=218, dl_src=20:22:22:22:22:22 actions=CONTROLLER:65535,resubmit(80,1)
1561 cookie=0x2, n_packets=3, n_bytes=180, dl_src=30:33:33:33:33:33 actions=mod_vlan_vid:15,CONTROLLER:65535
1562 cookie=0x3, table=1, n_packets=3, n_bytes=218, in_port=80 actions=load:0x1->NXM_NX_REG0[[]],mod_vlan_vid:80,CONTROLLER:65535,resubmit(81,2)
1563 cookie=0x4, table=2, n_packets=3, n_bytes=218, in_port=81 actions=load:0x2->NXM_NX_REG1[[]],mod_dl_src:80:81:81:81:81:81,CONTROLLER:65535,resubmit(82,3)
1564 cookie=0x5, table=3, n_packets=3, n_bytes=218, in_port=82 actions=load:0x3->NXM_NX_REG2[[]],mod_dl_dst:82:82:82:82:82:82,CONTROLLER:65535,resubmit(83,4)
1565 cookie=0x6, table=4, n_packets=3, n_bytes=218, in_port=83 actions=load:0x4->NXM_NX_REG3[[]],mod_nw_src:83.83.83.83,CONTROLLER:65535,resubmit(84,5)
1566 cookie=0x7, table=5, n_packets=3, n_bytes=218, in_port=84 actions=load:0x5->NXM_NX_REG4[[]],load:0x6->NXM_NX_TUN_ID[[]],mod_nw_dst:84.84.84.84,CONTROLLER:65535,resubmit(85,6)
1567 cookie=0x8, table=6, n_packets=3, n_bytes=218, in_port=85 actions=mod_tp_src:85,CONTROLLER:65535,resubmit(86,7)
1568 cookie=0x9, table=7, n_packets=3, n_bytes=218, in_port=86 actions=mod_tp_dst:86,CONTROLLER:65535,CONTROLLER:65535
1569 cookie=0xa, n_packets=3, n_bytes=180, dl_src=40:44:44:44:44:41 actions=mod_vlan_vid:99,mod_vlan_pcp:1,CONTROLLER:65535
1570 cookie=0xd, n_packets=3, n_bytes=180, arp,dl_src=80:88:88:88:88:88 actions=load:0x2->NXM_OF_ARP_OP[[]],CONTROLLER:65535,load:0xc0a88001->NXM_OF_ARP_SPA[[]],CONTROLLER:65535,load:0x404444444441->NXM_NX_ARP_THA[[]],load:0x1010101->NXM_OF_ARP_SPA[[]],load:0x2020202->NXM_OF_ARP_TPA[[]],CONTROLLER:65535
1571 n_packets=3, n_bytes=180, dl_src=10:11:11:11:11:11 actions=CONTROLLER:65535
1578 AT_SETUP([ofproto-dpif - MPLS handling])
1579 OVS_VSWITCHD_START([dnl
1580 add-port br0 p1 -- set Interface p1 type=dummy
1582 on_exit 'kill `cat ovs-ofctl.pid`'
1584 AT_CAPTURE_FILE([ofctl_monitor.log])
1585 AT_DATA([flows.txt], [dnl
1586 cookie=0xa dl_src=40:44:44:44:44:42 actions=push_mpls:0x8847,load:10->OXM_OF_MPLS_LABEL[[]],load:3->OXM_OF_MPLS_TC[[]],controller
1587 cookie=0xa dl_src=41:44:44:44:44:42 actions=push_mpls:0x8847,load:10->OXM_OF_MPLS_LABEL[[]],load:3->OXM_OF_MPLS_TC[[]],pop_mpls:0x0800,controller
1588 cookie=0xa dl_src=40:44:44:44:44:43 actions=push_mpls:0x8847,load:10->OXM_OF_MPLS_LABEL[[]],load:3->OXM_OF_MPLS_TC[[]],controller
1589 cookie=0xa dl_src=40:44:44:44:44:44 actions=push_mpls:0x8847,load:10->OXM_OF_MPLS_LABEL[[]],load:3->OXM_OF_MPLS_TC[[]],controller
1590 cookie=0xa dl_src=40:44:44:44:44:45 actions=push_mpls:0x8847,load:10->OXM_OF_MPLS_LABEL[[]],load:3->OXM_OF_MPLS_TC[[]],dec_mpls_ttl,controller
1591 cookie=0xa dl_src=40:44:44:44:44:46 actions=push_mpls:0x8847,load:10->OXM_OF_MPLS_LABEL[[]],load:3->OXM_OF_MPLS_TC[[]],set_mpls_ttl(10),controller
1592 cookie=0xa dl_src=40:44:44:44:44:47 actions=push_mpls:0x8847,load:10->OXM_OF_MPLS_LABEL[[]],load:3->OXM_OF_MPLS_TC[[]],dec_mpls_ttl,set_mpls_ttl(10),controller
1593 cookie=0xa dl_src=40:44:44:44:44:48 actions=push_mpls:0x8847,load:10->OXM_OF_MPLS_LABEL[[]],load:3->OXM_OF_MPLS_TC[[]],set_mpls_ttl(10),dec_mpls_ttl,controller
1594 cookie=0xa mpls,dl_src=40:44:44:44:44:49 actions=push_mpls:0x8848,load:10->OXM_OF_MPLS_LABEL[[]],CONTROLLER:65535
1595 cookie=0xb dl_src=50:55:55:55:55:55 dl_type=0x8847 actions=load:1000->OXM_OF_MPLS_LABEL[[]],controller
1596 cookie=0xd dl_src=60:66:66:66:66:66 actions=pop_mpls:0x0800,controller
1597 cookie=0xc dl_src=70:77:77:77:77:77 actions=push_mpls:0x8848,load:1000->OXM_OF_MPLS_LABEL[[]],load:7->OXM_OF_MPLS_TC[[]],controller
1599 cookie=0xd dl_src=60:66:66:66:00:01 actions=pop_mpls:0x0800,dec_ttl,controller
1600 cookie=0xd dl_src=60:66:66:66:00:02 actions=pop_mpls:0x0800,load:0xa000001->OXM_OF_IPV4_DST[[]],controller
1601 cookie=0xd dl_src=60:66:66:66:00:03 actions=pop_mpls:0x0800,move:OXM_OF_IPV4_DST[[]]->OXM_OF_IPV4_SRC[[]],controller
1602 cookie=0xd dl_src=60:66:66:66:00:04 actions=pop_mpls:0x0800,push:OXM_OF_IPV4_DST[[]],pop:OXM_OF_IPV4_SRC[[]],controller
1603 cookie=0xd dl_src=60:66:66:66:00:05 actions=pop_mpls:0x0800,multipath(eth_src,50,modulo_n,1,0,OXM_OF_IPV4_SRC[[0..7]]),controller
1604 cookie=0xd dl_src=60:66:66:66:00:06 actions=pop_mpls:0x0800,bundle_load(eth_src,50,hrw,ofport,OXM_OF_IPV4_SRC[[0..15]],slaves:1,2),controller
1605 cookie=0xd dl_src=60:66:66:66:00:07 actions=pop_mpls:0x0800,learn(table=1,hard_timeout=60,eth_type=0x800,nw_proto=6,OXM_OF_IPV4_SRC[[]]=OXM_OF_IPV4_DST[[]]),controller
1607 cookie=0xd dl_src=60:66:66:66:00:08 actions=pop_mpls:0x0806,resubmit(1,1)
1608 cookie=0xd table=1 arp actions=controller
1610 cookie=0xdeadbeef table=2 dl_src=60:66:66:66:00:09 actions=pop_mpls:0x0800,mod_nw_tos:48
1611 cookie=0xd dl_src=60:66:66:66:00:09 actions=resubmit(,2),controller
1612 cookie=0xd dl_src=60:66:66:66:00:0a actions=pop_mpls:0x0800,mod_nw_dst:10.0.0.1,controller
1613 cookie=0xd dl_src=60:66:66:66:00:0b actions=pop_mpls:0x0800,mod_nw_src:10.0.0.1,controller
1615 cookie=0xd dl_src=60:66:66:66:01:00 actions=pop_mpls:0x8848,controller
1616 cookie=0xd dl_src=60:66:66:66:01:01 actions=pop_mpls:0x8847,dec_mpls_ttl,controller
1617 cookie=0xd dl_src=60:66:66:66:01:02 actions=pop_mpls:0x8848,load:3->OXM_OF_MPLS_TC[[]],controller
1619 cookie=0xd dl_src=60:66:66:66:02:00 actions=pop_mpls:0x8847,pop_mpls:0x0800,controller
1620 cookie=0xe dl_src=60:66:66:66:02:01 actions=pop_mpls:0x8848,pop_mpls:0x0800,dec_ttl,controller
1621 cookie=0xe dl_src=60:66:66:66:02:10 actions=pop_mpls:0x8847,dec_mpls_ttl,pop_mpls:0x0800,dec_ttl,controller
1623 cookie=0xe dl_src=60:66:66:66:03:00 actions=pop_mpls:0x8848,pop_mpls:0x8848,controller
1624 cookie=0xe dl_src=60:66:66:66:03:01 actions=pop_mpls:0x8847,pop_mpls:0x8847,dec_mpls_ttl,controller
1625 cookie=0xe dl_src=60:66:66:66:03:10 actions=pop_mpls:0x8848,dec_mpls_ttl,pop_mpls:0x8848,dec_mpls_ttl,controller
1627 cookie=0xf dl_src=60:66:66:66:04:00 actions=pop_mpls:0x0800,push_mpls:0x8847,controller
1628 cookie=0xf dl_src=60:66:66:66:04:01 actions=pop_mpls:0x0800,push_mpls:0x8848,dec_mpls_ttl,controller
1629 cookie=0xf dl_src=60:66:66:66:04:10 actions=pop_mpls:0x0800,dec_ttl,push_mpls:0x8848,dec_mpls_ttl,controller
1631 cookie=0x5 dl_src=60:66:66:66:05:00 actions=push_mpls:0x8848,pop_mpls:0x8847,controller
1632 cookie=0x5 dl_src=60:66:66:66:05:01 actions=push_mpls:0x8847,pop_mpls:0x8848,dec_mpls_ttl,controller
1633 cookie=0x5 dl_src=60:66:66:66:05:10 actions=push_mpls:0x8848,dec_mpls_ttl,pop_mpls:0x8847,dec_mpls_ttl,controller
1635 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
1637 dnl Modified MPLS controller action.
1638 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --pidfile 2> ofctl_monitor.log])
1641 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=40:44:44:44:44:42,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=17,tos=0,ttl=64,frag=no),udp(src=7777,dst=80)'
1643 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1644 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1646 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1647 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1648 mpls,vlan_tci=0x0000,dl_src=40:44:44:44:44:42,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=64,mpls_bos=1
1650 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1651 mpls,vlan_tci=0x0000,dl_src=40:44:44:44:44:42,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=64,mpls_bos=1
1653 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1654 mpls,vlan_tci=0x0000,dl_src=40:44:44:44:44:42,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=64,mpls_bos=1
1657 dnl Modified MPLS controller action.
1658 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --pidfile 2> ofctl_monitor.log])
1661 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=41:44:44:44:44:42,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=16,tos=0,ttl=64,frag=no)'
1663 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1664 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1666 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1667 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
1668 ip,vlan_tci=0x0000,dl_src=41:44:44:44:44:42,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=16,nw_tos=0,nw_ecn=0,nw_ttl=64
1670 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
1671 ip,vlan_tci=0x0000,dl_src=41:44:44:44:44:42,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=16,nw_tos=0,nw_ecn=0,nw_ttl=64
1673 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
1674 ip,vlan_tci=0x0000,dl_src=41:44:44:44:44:42,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=16,nw_tos=0,nw_ecn=0,nw_ttl=64
1677 dnl Modified MPLS controller action.
1678 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --pidfile 2> ofctl_monitor.log])
1680 dnl in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x8847),mpls(label=100,tc=3,ttl=64,bos=1)
1683 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=40:44:44:44:44:43,dst=50:54:00:00:00:07),eth_type(0x8847),mpls(label=11,tc=3,ttl=64,bos=1)'
1685 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1686 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1688 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1689 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1690 mpls,vlan_tci=0x0000,dl_src=40:44:44:44:44:43,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=64,mpls_bos=0,mpls_lse1=46912
1692 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1693 mpls,vlan_tci=0x0000,dl_src=40:44:44:44:44:43,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=64,mpls_bos=0,mpls_lse1=46912
1695 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1696 mpls,vlan_tci=0x0000,dl_src=40:44:44:44:44:43,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=64,mpls_bos=0,mpls_lse1=46912
1699 dnl Modified MPLS controller action.
1700 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --pidfile 2> ofctl_monitor.log])
1703 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=40:44:44:44:44:44,dst=50:54:00:00:00:07),eth_type(0x8100),vlan(vid=99,pcp=7),encap(eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=16,tos=0,ttl=64,frag=no))'
1705 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1706 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1708 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1709 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1710 mpls,dl_vlan=99,dl_vlan_pcp=7,dl_src=40:44:44:44:44:44,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=64,mpls_bos=1
1712 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1713 mpls,dl_vlan=99,dl_vlan_pcp=7,dl_src=40:44:44:44:44:44,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=64,mpls_bos=1
1715 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1716 mpls,dl_vlan=99,dl_vlan_pcp=7,dl_src=40:44:44:44:44:44,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=64,mpls_bos=1
1719 dnl Modified MPLS controller action.
1720 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --pidfile 2> ofctl_monitor.log])
1723 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=40:44:44:44:44:45,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=16,tos=0,ttl=64,frag=no)'
1725 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1726 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1728 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1729 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1730 mpls,vlan_tci=0x0000,dl_src=40:44:44:44:44:45,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=63,mpls_bos=1
1732 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1733 mpls,vlan_tci=0x0000,dl_src=40:44:44:44:44:45,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=63,mpls_bos=1
1735 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1736 mpls,vlan_tci=0x0000,dl_src=40:44:44:44:44:45,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=63,mpls_bos=1
1739 dnl Modified MPLS controller action.
1740 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --pidfile 2> ofctl_monitor.log])
1743 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=40:44:44:44:44:46,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=16,tos=0,ttl=64,frag=no)'
1745 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1746 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1748 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1749 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1750 mpls,vlan_tci=0x0000,dl_src=40:44:44:44:44:46,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=10,mpls_bos=1
1752 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1753 mpls,vlan_tci=0x0000,dl_src=40:44:44:44:44:46,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=10,mpls_bos=1
1755 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1756 mpls,vlan_tci=0x0000,dl_src=40:44:44:44:44:46,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=10,mpls_bos=1
1759 dnl Modified MPLS controller action.
1760 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --pidfile 2> ofctl_monitor.log])
1763 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=40:44:44:44:44:47,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=16,tos=0,ttl=64,frag=no)'
1765 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1766 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1768 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1769 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1770 mpls,vlan_tci=0x0000,dl_src=40:44:44:44:44:47,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=10,mpls_bos=1
1772 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1773 mpls,vlan_tci=0x0000,dl_src=40:44:44:44:44:47,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=10,mpls_bos=1
1775 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1776 mpls,vlan_tci=0x0000,dl_src=40:44:44:44:44:47,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=10,mpls_bos=1
1779 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
1781 dnl Modified MPLS controller action.
1782 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --pidfile 2> ofctl_monitor.log])
1785 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=40:44:44:44:44:49,dst=50:54:00:00:00:07),eth_type(0x8847),mpls(label=10,tc=3,ttl=64,bos=1)'
1787 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1788 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
1790 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1791 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1792 mplsm,vlan_tci=0x0000,dl_src=40:44:44:44:44:49,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=64,mpls_bos=0,mpls_lse1=42816
1794 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1795 mplsm,vlan_tci=0x0000,dl_src=40:44:44:44:44:49,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=64,mpls_bos=0,mpls_lse1=42816
1797 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1798 mplsm,vlan_tci=0x0000,dl_src=40:44:44:44:44:49,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=64,mpls_bos=0,mpls_lse1=42816
1801 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
1803 dnl Modified MPLS controller action.
1804 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --pidfile 2> ofctl_monitor.log])
1807 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=40:44:44:44:44:48,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=16,tos=0,ttl=64,frag=no)'
1809 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1810 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1812 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1813 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1814 mpls,vlan_tci=0x0000,dl_src=40:44:44:44:44:48,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=9,mpls_bos=1
1816 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1817 mpls,vlan_tci=0x0000,dl_src=40:44:44:44:44:48,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=9,mpls_bos=1
1819 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1820 mpls,vlan_tci=0x0000,dl_src=40:44:44:44:44:48,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=9,mpls_bos=1
1823 dnl Modified MPLS actions.
1824 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --pidfile 2> ofctl_monitor.log])
1827 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:55:55:55:55:55,dst=50:54:00:00:00:07),eth_type(0x8847),mpls(label=100,tc=7,ttl=64,bos=1)'
1829 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1830 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1832 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1833 NXT_PACKET_IN (xid=0x0): cookie=0xb total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
1834 mpls,vlan_tci=0x0000,dl_src=50:55:55:55:55:55,dl_dst=50:54:00:00:00:07,mpls_label=1000,mpls_tc=7,mpls_ttl=64,mpls_bos=1
1836 NXT_PACKET_IN (xid=0x0): cookie=0xb total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
1837 mpls,vlan_tci=0x0000,dl_src=50:55:55:55:55:55,dl_dst=50:54:00:00:00:07,mpls_label=1000,mpls_tc=7,mpls_ttl=64,mpls_bos=1
1839 NXT_PACKET_IN (xid=0x0): cookie=0xb total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
1840 mpls,vlan_tci=0x0000,dl_src=50:55:55:55:55:55,dl_dst=50:54:00:00:00:07,mpls_label=1000,mpls_tc=7,mpls_ttl=64,mpls_bos=1
1843 dnl Modified MPLS ipv6 controller action.
1844 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --pidfile 2> ofctl_monitor.log])
1847 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=70:77:77:77:77:77,dst=50:54:00:00:00:07),eth_type(0x86dd),ipv6(src=::1,dst=::2,label=0,proto=10,tclass=0x70,hlimit=128,frag=no)'
1849 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1850 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1852 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1853 NXT_PACKET_IN (xid=0x0): cookie=0xc total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1854 mplsm,vlan_tci=0x0000,dl_src=70:77:77:77:77:77,dl_dst=50:54:00:00:00:07,mpls_label=1000,mpls_tc=7,mpls_ttl=128,mpls_bos=1
1856 NXT_PACKET_IN (xid=0x0): cookie=0xc total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1857 mplsm,vlan_tci=0x0000,dl_src=70:77:77:77:77:77,dl_dst=50:54:00:00:00:07,mpls_label=1000,mpls_tc=7,mpls_ttl=128,mpls_bos=1
1859 NXT_PACKET_IN (xid=0x0): cookie=0xc total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1860 mplsm,vlan_tci=0x0000,dl_src=70:77:77:77:77:77,dl_dst=50:54:00:00:00:07,mpls_label=1000,mpls_tc=7,mpls_ttl=128,mpls_bos=1
1864 dnl Modified MPLS pop action.
1865 dnl The input is a frame with two MPLS headers which tcpdump -vve shows as:
1866 dnl 60:66:66:66:66:66 > 50:54:00:00:00:07, ethertype MPLS multicast (0x8847), length 66: MPLS (label 20, exp 0, ttl 32)
1867 dnl (tos 0x0, ttl 64, id 0, offset 0, flags [none], proto TCP (6), length 44)
1869 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --pidfile 2> ofctl_monitor.log])
1872 ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 60 66 66 66 66 66 88 47 00 01 41 20 45 00 00 2c 00 00 00 00 40 06 3b 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45'
1875 # ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=60:66:66:66:66:66,dst=50:54:00:00:00:07),eth_type(0x8847),mpls(label=10,tc=3,ttl=100,bos=1)'
1877 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1878 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1880 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1881 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
1882 tcp,vlan_tci=0x0000,dl_src=60:66:66:66:66:66,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744
1884 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
1885 tcp,vlan_tci=0x0000,dl_src=60:66:66:66:66:66,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744
1887 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
1888 tcp,vlan_tci=0x0000,dl_src=60:66:66:66:66:66,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744
1891 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
1893 dnl Modified MPLS pop action.
1894 dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as:
1895 dnl 60:66:66:66:00:01 > 50:54:00:00:00:07, ethertype MPLS multicast (0x8848), length 62: MPLS (label 20, exp 0, [S], ttl 32)
1896 dnl (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44)
1897 dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4
1898 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --pidfile 2> ofctl_monitor.log])
1901 ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 60 66 66 66 00 01 88 48 00 01 41 20 45 00 00 2c 00 00 00 00 ff 06 3a 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45'
1903 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1904 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1906 AT_CHECK([strip_metadata < ofctl_monitor.log], [0], [dnl
1907 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
1908 tcp,vlan_tci=0x0000,dl_src=60:66:66:66:00:01,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=254,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744
1910 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
1911 tcp,vlan_tci=0x0000,dl_src=60:66:66:66:00:01,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=254,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744
1913 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
1914 tcp,vlan_tci=0x0000,dl_src=60:66:66:66:00:01,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=254,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744
1917 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
1919 dnl Modified MPLS pop action.
1920 dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as:
1921 dnl 60:66:66:66:00:02 > 50:54:00:00:00:07, ethertype MPLS unicast (0x8847), length 62: MPLS (label 20, exp 0, [S], ttl 32)
1922 dnl (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44)
1923 dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4
1924 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --pidfile 2> ofctl_monitor.log])
1927 ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 60 66 66 66 00 02 88 47 00 01 41 20 45 00 00 2c 00 00 00 00 ff 06 3a 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45'
1929 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1930 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1932 AT_CHECK([strip_metadata < ofctl_monitor.log], [0], [dnl
1933 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
1934 tcp,vlan_tci=0x0000,dl_src=60:66:66:66:00:02,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=10.0.0.1,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:2dee
1936 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
1937 tcp,vlan_tci=0x0000,dl_src=60:66:66:66:00:02,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=10.0.0.1,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:2dee
1939 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
1940 tcp,vlan_tci=0x0000,dl_src=60:66:66:66:00:02,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=10.0.0.1,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:2dee
1943 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
1945 dnl Modified MPLS pop action.
1946 dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as:
1947 dnl 60:66:66:66:00:03 > 50:54:00:00:00:07, ethertype MPLS multicast (0x8848), length 62: MPLS (label 20, exp 0, [S], ttl 32)
1948 dnl (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44)
1949 dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4
1950 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --pidfile 2> ofctl_monitor.log])
1953 ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 60 66 66 66 00 03 88 48 00 01 41 20 45 00 00 2c 00 00 00 00 ff 06 3a 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45'
1955 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1956 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1958 AT_CHECK([strip_metadata < ofctl_monitor.log], [0], [dnl
1959 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
1960 tcp,vlan_tci=0x0000,dl_src=60:66:66:66:00:03,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.2,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7743
1962 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
1963 tcp,vlan_tci=0x0000,dl_src=60:66:66:66:00:03,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.2,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7743
1965 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
1966 tcp,vlan_tci=0x0000,dl_src=60:66:66:66:00:03,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.2,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7743
1969 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
1971 dnl Modified MPLS pop action.
1972 dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as:
1973 dnl 60:66:66:66:00:04 > 50:54:00:00:00:07, ethertype MPLS unicast (0x8847), length 62: MPLS (label 20, exp 0, [S], ttl 32)
1974 dnl (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44)
1975 dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4
1976 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --pidfile 2> ofctl_monitor.log])
1979 ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 60 66 66 66 00 04 88 47 00 01 41 20 45 00 00 2c 00 00 00 00 ff 06 3a 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45'
1981 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1982 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1984 AT_CHECK([strip_metadata < ofctl_monitor.log], [0], [dnl
1985 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
1986 tcp,vlan_tci=0x0000,dl_src=60:66:66:66:00:04,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.2,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7743
1988 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
1989 tcp,vlan_tci=0x0000,dl_src=60:66:66:66:00:04,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.2,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7743
1991 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
1992 tcp,vlan_tci=0x0000,dl_src=60:66:66:66:00:04,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.2,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7743
1995 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
1997 dnl Modified MPLS pop action.
1998 dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as:
1999 dnl 60:66:66:66:00:05 > 50:54:00:00:00:07, ethertype MPLS unicast (0x8847), length 62: MPLS (label 20, exp 0, [S], ttl 32)
2000 dnl (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44)
2001 dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4
2002 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --pidfile 2> ofctl_monitor.log])
2005 ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 60 66 66 66 00 05 88 48 00 01 41 20 45 00 00 2c 00 00 00 00 ff 06 3a 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45'
2007 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2008 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2010 AT_CHECK([strip_metadata < ofctl_monitor.log], [0], [dnl
2011 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2012 tcp,vlan_tci=0x0000,dl_src=60:66:66:66:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.0,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7745
2014 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2015 tcp,vlan_tci=0x0000,dl_src=60:66:66:66:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.0,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7745
2017 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2018 tcp,vlan_tci=0x0000,dl_src=60:66:66:66:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.0,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7745
2021 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2023 dnl Modified MPLS pop action.
2024 dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as:
2025 dnl 60:66:66:66:00:06 > 50:54:00:00:00:07, ethertype MPLS multicast (0x8848), length 62: MPLS (label 20, exp 0, [S], ttl 32)
2026 dnl (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44)
2027 dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4
2028 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --pidfile 2> ofctl_monitor.log])
2031 ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 60 66 66 66 00 06 88 47 00 01 41 20 45 00 00 2c 00 00 00 00 ff 06 3a 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45'
2033 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2034 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2036 AT_CHECK([strip_metadata < ofctl_monitor.log], [0], [dnl
2037 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2038 tcp,vlan_tci=0x0000,dl_src=60:66:66:66:00:06,dl_dst=50:54:00:00:00:07,nw_src=192.168.255.255,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7745
2040 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2041 tcp,vlan_tci=0x0000,dl_src=60:66:66:66:00:06,dl_dst=50:54:00:00:00:07,nw_src=192.168.255.255,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7745
2043 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2044 tcp,vlan_tci=0x0000,dl_src=60:66:66:66:00:06,dl_dst=50:54:00:00:00:07,nw_src=192.168.255.255,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7745
2047 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2049 dnl Modified MPLS pop action.
2050 dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as:
2051 dnl 60:66:66:66:00:07 > 50:54:00:00:00:07, ethertype MPLS multicast (0x8848), length 62: MPLS (label 20, exp 0, [S], ttl 32)
2052 dnl (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44)
2053 dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4
2054 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --pidfile 2> ofctl_monitor.log])
2057 ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 60 66 66 66 00 07 88 48 00 01 41 20 45 00 00 2c 00 00 00 00 ff 06 3a 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45'
2059 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2060 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2062 AT_CHECK([strip_metadata < ofctl_monitor.log], [0], [dnl
2063 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2064 tcp,vlan_tci=0x0000,dl_src=60:66:66:66:00:07,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744
2066 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2067 tcp,vlan_tci=0x0000,dl_src=60:66:66:66:00:07,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744
2069 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2070 tcp,vlan_tci=0x0000,dl_src=60:66:66:66:00:07,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744
2073 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2075 dnl Modified MPLS pop action.
2076 dnl The input is an ARP frame with a single MPLS label stack entry which tcpdump -vve shows as:
2077 dnl 60:66:66:66:00:08 > ff:ff:ff:ff:ff:ff, ethertype MPLS unicast (0x8847), length 46: MPLS (label 20, exp 0, [S], ttl 32)
2078 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --pidfile 2> ofctl_monitor.log])
2081 ovs-appctl netdev-dummy/receive p1 'ff ff ff ff ff ff 60 66 66 66 00 08 88 47 00 01 41 20 00 01 08 00 06 04 00 02 60 66 66 66 00 08 c0 a8 00 01 ff ff ff ff ff ff ff ff ff ff'
2083 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2084 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2086 AT_CHECK([strip_metadata < ofctl_monitor.log], [0], [dnl
2087 NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0xd total_len=56 in_port=1 (via action) data_len=56 (unbuffered)
2088 arp,vlan_tci=0x0000,dl_src=60:66:66:66:00:08,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=192.168.0.1,arp_tpa=255.255.255.255,arp_op=2,arp_sha=60:66:66:66:00:08,arp_tha=ff:ff:ff:ff:ff:ff
2090 NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0xd total_len=56 in_port=1 (via action) data_len=56 (unbuffered)
2091 arp,vlan_tci=0x0000,dl_src=60:66:66:66:00:08,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=192.168.0.1,arp_tpa=255.255.255.255,arp_op=2,arp_sha=60:66:66:66:00:08,arp_tha=ff:ff:ff:ff:ff:ff
2093 NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0xd total_len=56 in_port=1 (via action) data_len=56 (unbuffered)
2094 arp,vlan_tci=0x0000,dl_src=60:66:66:66:00:08,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=192.168.0.1,arp_tpa=255.255.255.255,arp_op=2,arp_sha=60:66:66:66:00:08,arp_tha=ff:ff:ff:ff:ff:ff
2097 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2099 dnl Modified MPLS pop action.
2100 dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as:
2101 dnl 60:66:66:66:00:09 > 50:54:00:00:00:07, ethertype MPLS multicast (0x8848), length 62: MPLS (label 20, exp 0, [S], ttl 32)
2102 dnl (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44)
2103 dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4
2104 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --pidfile 2> ofctl_monitor.log])
2107 ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 60 66 66 66 00 09 88 48 00 01 41 20 45 00 00 2c 00 00 00 00 ff 06 3a 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45'
2109 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2110 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2112 AT_CHECK([strip_metadata < ofctl_monitor.log], [0], [dnl
2113 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2114 tcp,vlan_tci=0x0000,dl_src=60:66:66:66:00:09,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=48,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744
2116 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2117 tcp,vlan_tci=0x0000,dl_src=60:66:66:66:00:09,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=48,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744
2119 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2120 tcp,vlan_tci=0x0000,dl_src=60:66:66:66:00:09,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=48,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744
2123 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2125 dnl Modified MPLS pop action.
2126 dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as:
2127 dnl 60:66:66:66:00:0a > 50:54:00:00:00:07, ethertype MPLS multicast (0x8848), length 62: MPLS (label 20, exp 0, [S], ttl 32)
2128 dnl (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44)
2129 dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4
2130 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --pidfile 2> ofctl_monitor.log])
2133 ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 60 66 66 66 00 0a 88 48 00 01 41 20 45 00 00 2c 00 00 00 00 ff 06 3a 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45'
2135 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2136 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2138 AT_CHECK([strip_metadata < ofctl_monitor.log], [0], [dnl
2139 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2140 tcp,vlan_tci=0x0000,dl_src=60:66:66:66:00:0a,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=10.0.0.1,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:2dee
2142 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2143 tcp,vlan_tci=0x0000,dl_src=60:66:66:66:00:0a,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=10.0.0.1,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:2dee
2145 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2146 tcp,vlan_tci=0x0000,dl_src=60:66:66:66:00:0a,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=10.0.0.1,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:2dee
2149 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2151 dnl Modified MPLS pop action.
2152 dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as:
2153 dnl 60:66:66:66:00:0b > 50:54:00:00:00:07, ethertype MPLS multicast (0x8848), length 62: MPLS (label 20, exp 0, [S], ttl 32)
2154 dnl (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44)
2155 dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4
2156 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --pidfile 2> ofctl_monitor.log])
2159 ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 60 66 66 66 00 0b 88 48 00 01 41 20 45 00 00 2c 00 00 00 00 ff 06 3a 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45'
2161 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2162 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2164 AT_CHECK([strip_metadata < ofctl_monitor.log], [0], [dnl
2165 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2166 tcp,vlan_tci=0x0000,dl_src=60:66:66:66:00:0b,dl_dst=50:54:00:00:00:07,nw_src=10.0.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:2ded
2168 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2169 tcp,vlan_tci=0x0000,dl_src=60:66:66:66:00:0b,dl_dst=50:54:00:00:00:07,nw_src=10.0.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:2ded
2171 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2172 tcp,vlan_tci=0x0000,dl_src=60:66:66:66:00:0b,dl_dst=50:54:00:00:00:07,nw_src=10.0.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:2ded
2175 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2177 dnl Modified MPLS pop action.
2178 dnl The input is a frame with two MPLS label stack entries which tcpdump -vve shows as:
2179 dnl 60:66:66:66:01:00 > 50:54:00:00:00:07, ethertype MPLS multicast (0x8848), length 66: MPLS (label 20, exp 0, ttl 32)
2180 dnl (label 20, exp 0, [S], ttl 31)
2181 dnl (tos 0x0, ttl 254, id 0, offset 0, flags [none], proto TCP (6), length 44)
2182 dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x7744 (correct), seq 42:46, win 10000, length 4
2183 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --pidfile 2> ofctl_monitor.log])
2186 ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 60 66 66 66 01 00 88 48 00 01 40 20 00 01 41 1f 45 00 00 2c 00 00 00 00 ff 06 3b 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45'
2188 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2189 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2191 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
2192 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2193 mplsm,vlan_tci=0x0000,dl_src=60:66:66:66:01:00,dl_dst=50:54:00:00:00:07,mpls_label=20,mpls_tc=0,mpls_ttl=31,mpls_bos=1
2195 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2196 mplsm,vlan_tci=0x0000,dl_src=60:66:66:66:01:00,dl_dst=50:54:00:00:00:07,mpls_label=20,mpls_tc=0,mpls_ttl=31,mpls_bos=1
2198 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2199 mplsm,vlan_tci=0x0000,dl_src=60:66:66:66:01:00,dl_dst=50:54:00:00:00:07,mpls_label=20,mpls_tc=0,mpls_ttl=31,mpls_bos=1
2202 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2204 dnl Modified MPLS pop action.
2205 dnl The input is a frame with two MPLS label stack entries which tcpdump -vve shows as:
2206 dnl 60:66:66:66:01:01 > 50:54:00:00:00:07, ethertype MPLS unicast (0x8847), length 66: MPLS (label 20, exp 0, ttl 32)
2207 dnl (label 20, exp 0, [S], ttl 31)
2208 dnl (tos 0x0, ttl 254, id 0, offset 0, flags [none], proto TCP (6), length 44)
2209 dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x7744 (correct), seq 42:46, win 10000, length 4
2210 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --pidfile 2> ofctl_monitor.log])
2213 ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 60 66 66 66 01 01 88 47 00 01 40 20 00 01 41 1f 45 00 00 2c 00 00 00 00 ff 06 3b 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45'
2215 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2216 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2218 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
2219 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2220 mpls,vlan_tci=0x0000,dl_src=60:66:66:66:01:01,dl_dst=50:54:00:00:00:07,mpls_label=20,mpls_tc=0,mpls_ttl=30,mpls_bos=1
2222 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2223 mpls,vlan_tci=0x0000,dl_src=60:66:66:66:01:01,dl_dst=50:54:00:00:00:07,mpls_label=20,mpls_tc=0,mpls_ttl=30,mpls_bos=1
2225 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2226 mpls,vlan_tci=0x0000,dl_src=60:66:66:66:01:01,dl_dst=50:54:00:00:00:07,mpls_label=20,mpls_tc=0,mpls_ttl=30,mpls_bos=1
2229 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2231 dnl Modified MPLS pop action.
2232 dnl The input is a frame with two MPLS label stack entries which tcpdump -vve shows as:
2233 dnl 60:66:66:66:01:02 > 50:54:00:00:00:07, ethertype MPLS multicast (0x8848), length 66: MPLS (label 20, exp 0, ttl 32)
2234 dnl (label 20, exp 0, [S], ttl 31)
2235 dnl (tos 0x0, ttl 254, id 0, offset 0, flags [none], proto TCP (6), length 44)
2236 dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x7744 (correct), seq 42:46, win 10000, length 4
2237 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --pidfile 2> ofctl_monitor.log])
2240 ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 60 66 66 66 01 02 88 48 00 01 40 20 00 01 41 1f 45 00 00 2c 00 00 00 00 ff 06 3b 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45'
2242 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2243 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2245 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
2246 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2247 mplsm,vlan_tci=0x0000,dl_src=60:66:66:66:01:02,dl_dst=50:54:00:00:00:07,mpls_label=20,mpls_tc=3,mpls_ttl=31,mpls_bos=1
2249 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2250 mplsm,vlan_tci=0x0000,dl_src=60:66:66:66:01:02,dl_dst=50:54:00:00:00:07,mpls_label=20,mpls_tc=3,mpls_ttl=31,mpls_bos=1
2252 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2253 mplsm,vlan_tci=0x0000,dl_src=60:66:66:66:01:02,dl_dst=50:54:00:00:00:07,mpls_label=20,mpls_tc=3,mpls_ttl=31,mpls_bos=1
2256 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2258 dnl Modified MPLS pop action.
2259 dnl The input is a frame with two MPLS label stack entries which tcpdump -vve shows as:
2260 dnl 60:66:66:66:02:00 > 50:54:00:00:02:00, ethertype MPLS unicast (0x8847), length 66: MPLS (label 20, exp 0, ttl 32)
2261 dnl (label 20, exp 0, [S], ttl 31)
2262 dnl (tos 0x0, ttl 254, id 0, offset 0, flags [none], proto TCP (6), length 44)
2263 dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x7744 (correct), seq 42:46, win 10000, length 4
2264 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --pidfile 2> ofctl_monitor.log])
2267 ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 60 66 66 66 02 00 88 47 00 01 40 20 00 01 41 1f 45 00 00 2c 00 00 00 00 ff 06 3b 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45'
2269 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2270 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2272 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
2273 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2274 tcp,vlan_tci=0x0000,dl_src=60:66:66:66:02:00,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744
2276 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2277 tcp,vlan_tci=0x0000,dl_src=60:66:66:66:02:00,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744
2279 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2280 tcp,vlan_tci=0x0000,dl_src=60:66:66:66:02:00,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744
2283 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2285 dnl Modified MPLS pop action.
2286 dnl The input is a frame with two MPLS label stack entries which tcpdump -vve shows as:
2287 dnl 60:66:66:66:02:01 > 50:54:00:00:02:01, ethertype MPLS multicast (0x8848), length 66: MPLS (label 20, exp 0, ttl 32)
2288 dnl (label 20, exp 0, [S], ttl 31)
2289 dnl (tos 0x0, ttl 254, id 0, offset 0, flags [none], proto TCP (6), length 44)
2290 dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x7744 (correct), seq 42:46, win 10000, length 4
2291 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --pidfile 2> ofctl_monitor.log])
2294 ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 60 66 66 66 02 01 88 48 00 01 40 20 00 01 41 1f 45 00 00 2c 00 00 00 00 ff 06 3b 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45'
2297 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2298 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2300 AT_CHECK([strip_metadata < ofctl_monitor.log], [0], [dnl
2301 NXT_PACKET_IN (xid=0x0): cookie=0xe total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2302 tcp,vlan_tci=0x0000,dl_src=60:66:66:66:02:01,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=254,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744
2304 NXT_PACKET_IN (xid=0x0): cookie=0xe total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2305 tcp,vlan_tci=0x0000,dl_src=60:66:66:66:02:01,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=254,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744
2307 NXT_PACKET_IN (xid=0x0): cookie=0xe total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2308 tcp,vlan_tci=0x0000,dl_src=60:66:66:66:02:01,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=254,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744
2311 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2313 dnl Modified MPLS pop action.
2314 dnl The input is a frame with two MPLS label stack entries which tcpdump -vve shows as:
2315 dnl 60:66:66:66:02:10 > 50:54:00:00:00:07, ethertype MPLS unicast (0x8847), length 66: MPLS (label 20, exp 0, ttl 32)
2316 dnl (label 20, exp 0, [S], ttl 31)
2317 dnl (tos 0x0, ttl 254, id 0, offset 0, flags [none], proto TCP (6), length 44)
2318 dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x7744 (correct), seq 42:46, win 10000, length 4
2319 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --pidfile 2> ofctl_monitor.log])
2322 ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 60 66 66 66 02 10 88 47 00 01 40 20 00 01 41 1f 45 00 00 2c 00 00 00 00 ff 06 3b 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45'
2324 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2325 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2327 AT_CHECK([strip_metadata < ofctl_monitor.log], [0], [dnl
2328 NXT_PACKET_IN (xid=0x0): cookie=0xe total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2329 tcp,vlan_tci=0x0000,dl_src=60:66:66:66:02:10,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=254,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744
2331 NXT_PACKET_IN (xid=0x0): cookie=0xe total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2332 tcp,vlan_tci=0x0000,dl_src=60:66:66:66:02:10,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=254,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744
2334 NXT_PACKET_IN (xid=0x0): cookie=0xe total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2335 tcp,vlan_tci=0x0000,dl_src=60:66:66:66:02:10,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=254,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744
2338 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2340 dnl Modified MPLS pop action.
2341 dnl The input is a frame with three MPLS label stack entries which tcpdump -vve shows as:
2342 dnl 60:66:66:66:03:00 > 50:54:00:00:00:07, ethertype MPLS unicast (0x8847), length 66: MPLS (label 20, exp 0, ttl 32)
2343 dnl (label 20, exp 0, ttl 31)
2344 dnl (label 20, exp 0, [S], ttl 30)
2345 dnl (tos 0x0, ttl 254, id 0, offset 0, flags [none], proto TCP (6), length 44)
2346 dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x7744 (correct), seq 42:46, win 10000, length 4
2347 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --pidfile 2> ofctl_monitor.log])
2350 ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 60 66 66 66 03 00 88 47 00 01 40 20 00 01 40 1f 00 01 41 1e 45 00 00 2c 00 00 00 00 ff 06 3b 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45'
2352 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2353 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2355 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
2356 NXT_PACKET_IN (xid=0x0): cookie=0xe total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2357 mplsm,vlan_tci=0x0000,dl_src=60:66:66:66:03:00,dl_dst=50:54:00:00:00:07,mpls_label=20,mpls_tc=0,mpls_ttl=30,mpls_bos=1
2359 NXT_PACKET_IN (xid=0x0): cookie=0xe total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2360 mplsm,vlan_tci=0x0000,dl_src=60:66:66:66:03:00,dl_dst=50:54:00:00:00:07,mpls_label=20,mpls_tc=0,mpls_ttl=30,mpls_bos=1
2362 NXT_PACKET_IN (xid=0x0): cookie=0xe total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2363 mplsm,vlan_tci=0x0000,dl_src=60:66:66:66:03:00,dl_dst=50:54:00:00:00:07,mpls_label=20,mpls_tc=0,mpls_ttl=30,mpls_bos=1
2366 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2368 dnl Modified MPLS pop action.
2369 dnl The input is a frame with three MPLS label stack entries which tcpdump -vve shows as:
2370 dnl 60:66:66:66:03:01 > 50:54:00:00:00:00, ethertype MPLS multicast (0x8848), length 66: MPLS (label 20, exp 0, ttl 32)
2371 dnl (label 20, exp 0, ttl 31)
2372 dnl (label 20, exp 0, [S], ttl 30)
2373 dnl (tos 0x0, ttl 254, id 0, offset 0, flags [none], proto TCP (6), length 44)
2374 dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x7744 (correct), seq 42:46, win 10000, length 4
2375 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --pidfile 2> ofctl_monitor.log])
2378 ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 60 66 66 66 03 01 88 48 00 01 40 20 00 01 40 1f 00 01 41 1e 45 00 00 2c 00 00 00 00 ff 06 3b 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45'
2380 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2381 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2383 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
2384 NXT_PACKET_IN (xid=0x0): cookie=0xe total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2385 mpls,vlan_tci=0x0000,dl_src=60:66:66:66:03:01,dl_dst=50:54:00:00:00:07,mpls_label=20,mpls_tc=0,mpls_ttl=29,mpls_bos=1
2387 NXT_PACKET_IN (xid=0x0): cookie=0xe total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2388 mpls,vlan_tci=0x0000,dl_src=60:66:66:66:03:01,dl_dst=50:54:00:00:00:07,mpls_label=20,mpls_tc=0,mpls_ttl=29,mpls_bos=1
2390 NXT_PACKET_IN (xid=0x0): cookie=0xe total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2391 mpls,vlan_tci=0x0000,dl_src=60:66:66:66:03:01,dl_dst=50:54:00:00:00:07,mpls_label=20,mpls_tc=0,mpls_ttl=29,mpls_bos=1
2394 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2396 dnl Modified MPLS pop action.
2397 dnl The input is a frame with three MPLS label stack entries which tcpdump -vve shows as:
2398 dnl 60:66:66:66:03:10 > 50:54:00:00:00:00, ethertype MPLS unicast (0x8847), length 66: MPLS (label 20, exp 0, ttl 32)
2399 dnl (label 20, exp 0, ttl 31)
2400 dnl (label 20, exp 0, [S], ttl 30)
2401 dnl (tos 0x0, ttl 254, id 0, offset 0, flags [none], proto TCP (6), length 44)
2402 dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x7744 (correct), seq 42:46, win 10000, length 4
2403 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --pidfile 2> ofctl_monitor.log])
2406 ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 60 66 66 66 03 10 88 47 00 01 40 20 00 01 40 1f 00 01 41 1e 45 00 00 2c 00 00 00 00 ff 06 3b 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45'
2408 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2409 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2411 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
2412 NXT_PACKET_IN (xid=0x0): cookie=0xe total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2413 mplsm,vlan_tci=0x0000,dl_src=60:66:66:66:03:10,dl_dst=50:54:00:00:00:07,mpls_label=20,mpls_tc=0,mpls_ttl=29,mpls_bos=1
2415 NXT_PACKET_IN (xid=0x0): cookie=0xe total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2416 mplsm,vlan_tci=0x0000,dl_src=60:66:66:66:03:10,dl_dst=50:54:00:00:00:07,mpls_label=20,mpls_tc=0,mpls_ttl=29,mpls_bos=1
2418 NXT_PACKET_IN (xid=0x0): cookie=0xe total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2419 mplsm,vlan_tci=0x0000,dl_src=60:66:66:66:03:10,dl_dst=50:54:00:00:00:07,mpls_label=20,mpls_tc=0,mpls_ttl=29,mpls_bos=1
2422 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2424 dnl Modified MPLS pop action.
2425 dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as:
2426 dnl 60:66:66:66:04:00 > 50:54:00:00:00:07, ethertype MPLS multicast (0x8848), length 62: MPLS (label 20, exp 0, [S], ttl 32)
2427 dnl (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44)
2428 dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4
2429 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --pidfile 2> ofctl_monitor.log])
2432 ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 60 66 66 66 04 00 88 48 00 01 41 20 45 00 00 2c 00 00 00 00 ff 06 3a 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45'
2434 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2435 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2437 AT_CHECK([strip_metadata < ofctl_monitor.log], [0], [dnl
2438 NXT_PACKET_IN (xid=0x0): cookie=0xf total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2439 mpls,vlan_tci=0x0000,dl_src=60:66:66:66:04:00,dl_dst=50:54:00:00:00:07,mpls_label=0,mpls_tc=0,mpls_ttl=255,mpls_bos=1
2441 NXT_PACKET_IN (xid=0x0): cookie=0xf total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2442 mpls,vlan_tci=0x0000,dl_src=60:66:66:66:04:00,dl_dst=50:54:00:00:00:07,mpls_label=0,mpls_tc=0,mpls_ttl=255,mpls_bos=1
2444 NXT_PACKET_IN (xid=0x0): cookie=0xf total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2445 mpls,vlan_tci=0x0000,dl_src=60:66:66:66:04:00,dl_dst=50:54:00:00:00:07,mpls_label=0,mpls_tc=0,mpls_ttl=255,mpls_bos=1
2448 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2450 dnl Modified MPLS pop action.
2451 dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as:
2452 dnl 60:66:66:66:04:01 > 50:54:00:00:00:07, ethertype MPLS unicast (0x8847), length 62: MPLS (label 20, exp 0, [S], ttl 32)
2453 dnl (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44)
2454 dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4
2455 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --pidfile 2> ofctl_monitor.log])
2458 ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 60 66 66 66 04 01 88 47 00 01 41 20 45 00 00 2c 00 00 00 00 ff 06 3a 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45'
2460 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2461 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2463 AT_CHECK([strip_metadata < ofctl_monitor.log], [0], [dnl
2464 NXT_PACKET_IN (xid=0x0): cookie=0xf total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2465 mplsm,vlan_tci=0x0000,dl_src=60:66:66:66:04:01,dl_dst=50:54:00:00:00:07,mpls_label=0,mpls_tc=0,mpls_ttl=254,mpls_bos=1
2467 NXT_PACKET_IN (xid=0x0): cookie=0xf total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2468 mplsm,vlan_tci=0x0000,dl_src=60:66:66:66:04:01,dl_dst=50:54:00:00:00:07,mpls_label=0,mpls_tc=0,mpls_ttl=254,mpls_bos=1
2470 NXT_PACKET_IN (xid=0x0): cookie=0xf total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2471 mplsm,vlan_tci=0x0000,dl_src=60:66:66:66:04:01,dl_dst=50:54:00:00:00:07,mpls_label=0,mpls_tc=0,mpls_ttl=254,mpls_bos=1
2474 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2476 dnl Modified MPLS pop action.
2477 dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as:
2478 dnl 60:66:66:66:04:10 > 50:54:00:00:00:07, ethertype MPLS multicast (0x8848), length 62: MPLS (label 20, exp 0, [S], ttl 32)
2479 dnl (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44)
2480 dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4
2481 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --pidfile 2> ofctl_monitor.log])
2484 ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 60 66 66 66 04 10 88 48 00 01 41 20 45 00 00 2c 00 00 00 00 ff 06 3a 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45'
2486 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2487 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2489 AT_CHECK([strip_metadata < ofctl_monitor.log], [0], [dnl
2490 NXT_PACKET_IN (xid=0x0): cookie=0xf total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2491 mplsm,vlan_tci=0x0000,dl_src=60:66:66:66:04:10,dl_dst=50:54:00:00:00:07,mpls_label=0,mpls_tc=0,mpls_ttl=253,mpls_bos=1
2493 NXT_PACKET_IN (xid=0x0): cookie=0xf total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2494 mplsm,vlan_tci=0x0000,dl_src=60:66:66:66:04:10,dl_dst=50:54:00:00:00:07,mpls_label=0,mpls_tc=0,mpls_ttl=253,mpls_bos=1
2496 NXT_PACKET_IN (xid=0x0): cookie=0xf total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2497 mplsm,vlan_tci=0x0000,dl_src=60:66:66:66:04:10,dl_dst=50:54:00:00:00:07,mpls_label=0,mpls_tc=0,mpls_ttl=253,mpls_bos=1
2500 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2502 dnl Modified MPLS pop action.
2503 dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as:
2504 dnl 60:66:66:66:05:00 > 50:54:00:00:00:07, ethertype MPLS unicast (0x8847), length 62: MPLS (label 20, exp 0, [S], ttl 32)
2505 dnl (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44)
2506 dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4
2507 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --pidfile 2> ofctl_monitor.log])
2510 ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 60 66 66 66 05 00 88 47 00 01 41 20 45 00 00 2c 00 00 00 00 ff 06 3a 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45'
2513 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2514 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2516 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
2517 NXT_PACKET_IN (xid=0x0): cookie=0x5 total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2518 mpls,vlan_tci=0x0000,dl_src=60:66:66:66:05:00,dl_dst=50:54:00:00:00:07,mpls_label=20,mpls_tc=0,mpls_ttl=32,mpls_bos=1
2520 NXT_PACKET_IN (xid=0x0): cookie=0x5 total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2521 mpls,vlan_tci=0x0000,dl_src=60:66:66:66:05:00,dl_dst=50:54:00:00:00:07,mpls_label=20,mpls_tc=0,mpls_ttl=32,mpls_bos=1
2523 NXT_PACKET_IN (xid=0x0): cookie=0x5 total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2524 mpls,vlan_tci=0x0000,dl_src=60:66:66:66:05:00,dl_dst=50:54:00:00:00:07,mpls_label=20,mpls_tc=0,mpls_ttl=32,mpls_bos=1
2527 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2529 dnl Modified MPLS pop action.
2530 dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as:
2531 dnl 60:66:66:66:05:01 > 50:54:00:00:00:07, ethertype MPLS multicast (0x8848), length 62: MPLS (label 20, exp 0, [S], ttl 32)
2532 dnl (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44)
2533 dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4
2534 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --pidfile 2> ofctl_monitor.log])
2537 ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 60 66 66 66 05 01 88 48 00 01 41 20 45 00 00 2c 00 00 00 00 ff 06 3a 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45'
2539 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2540 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2542 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
2543 NXT_PACKET_IN (xid=0x0): cookie=0x5 total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2544 mplsm,vlan_tci=0x0000,dl_src=60:66:66:66:05:01,dl_dst=50:54:00:00:00:07,mpls_label=20,mpls_tc=0,mpls_ttl=31,mpls_bos=1
2546 NXT_PACKET_IN (xid=0x0): cookie=0x5 total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2547 mplsm,vlan_tci=0x0000,dl_src=60:66:66:66:05:01,dl_dst=50:54:00:00:00:07,mpls_label=20,mpls_tc=0,mpls_ttl=31,mpls_bos=1
2549 NXT_PACKET_IN (xid=0x0): cookie=0x5 total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2550 mplsm,vlan_tci=0x0000,dl_src=60:66:66:66:05:01,dl_dst=50:54:00:00:00:07,mpls_label=20,mpls_tc=0,mpls_ttl=31,mpls_bos=1
2553 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2555 dnl Modified MPLS pop action.
2556 dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as:
2557 dnl 60:66:66:66:05:10 > 50:54:00:00:00:07, ethertype MPLS unicast (0x8847), length 62: MPLS (label 20, exp 0, [S], ttl 32)
2558 dnl (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44)
2559 dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4
2560 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --pidfile 2> ofctl_monitor.log])
2563 ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 07 60 66 66 66 05 10 88 47 00 01 41 20 45 00 00 2c 00 00 00 00 ff 06 3a 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45'
2566 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2567 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2569 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
2570 NXT_PACKET_IN (xid=0x0): cookie=0x5 total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2571 mpls,vlan_tci=0x0000,dl_src=60:66:66:66:05:10,dl_dst=50:54:00:00:00:07,mpls_label=20,mpls_tc=0,mpls_ttl=31,mpls_bos=1
2573 NXT_PACKET_IN (xid=0x0): cookie=0x5 total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2574 mpls,vlan_tci=0x0000,dl_src=60:66:66:66:05:10,dl_dst=50:54:00:00:00:07,mpls_label=20,mpls_tc=0,mpls_ttl=31,mpls_bos=1
2576 NXT_PACKET_IN (xid=0x0): cookie=0x5 total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2577 mpls,vlan_tci=0x0000,dl_src=60:66:66:66:05:10,dl_dst=50:54:00:00:00:07,mpls_label=20,mpls_tc=0,mpls_ttl=31,mpls_bos=1
2580 AT_CHECK([ovs-appctl revalidator/purge], [0])
2581 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
2582 cookie=0x5, n_packets=3, n_bytes=186, dl_src=60:66:66:66:05:00 actions=push_mpls:0x8848,pop_mpls:0x8847,CONTROLLER:65535
2583 cookie=0x5, n_packets=3, n_bytes=186, dl_src=60:66:66:66:05:01 actions=push_mpls:0x8847,pop_mpls:0x8848,dec_mpls_ttl,CONTROLLER:65535
2584 cookie=0x5, n_packets=3, n_bytes=186, dl_src=60:66:66:66:05:10 actions=push_mpls:0x8848,dec_mpls_ttl,pop_mpls:0x8847,dec_mpls_ttl,CONTROLLER:65535
2585 cookie=0xa, n_packets=3, n_bytes=180, dl_src=40:44:44:44:44:42 actions=push_mpls:0x8847,load:0xa->OXM_OF_MPLS_LABEL[[]],load:0x3->OXM_OF_MPLS_TC[[]],CONTROLLER:65535
2586 cookie=0xa, n_packets=3, n_bytes=180, dl_src=40:44:44:44:44:43 actions=push_mpls:0x8847,load:0xa->OXM_OF_MPLS_LABEL[[]],load:0x3->OXM_OF_MPLS_TC[[]],CONTROLLER:65535
2587 cookie=0xa, n_packets=3, n_bytes=180, dl_src=40:44:44:44:44:44 actions=push_mpls:0x8847,load:0xa->OXM_OF_MPLS_LABEL[[]],load:0x3->OXM_OF_MPLS_TC[[]],CONTROLLER:65535
2588 cookie=0xa, n_packets=3, n_bytes=180, dl_src=40:44:44:44:44:45 actions=push_mpls:0x8847,load:0xa->OXM_OF_MPLS_LABEL[[]],load:0x3->OXM_OF_MPLS_TC[[]],dec_mpls_ttl,CONTROLLER:65535
2589 cookie=0xa, n_packets=3, n_bytes=180, dl_src=40:44:44:44:44:46 actions=push_mpls:0x8847,load:0xa->OXM_OF_MPLS_LABEL[[]],load:0x3->OXM_OF_MPLS_TC[[]],set_mpls_ttl(10),CONTROLLER:65535
2590 cookie=0xa, n_packets=3, n_bytes=180, dl_src=40:44:44:44:44:47 actions=push_mpls:0x8847,load:0xa->OXM_OF_MPLS_LABEL[[]],load:0x3->OXM_OF_MPLS_TC[[]],dec_mpls_ttl,set_mpls_ttl(10),CONTROLLER:65535
2591 cookie=0xa, n_packets=3, n_bytes=180, dl_src=40:44:44:44:44:48 actions=push_mpls:0x8847,load:0xa->OXM_OF_MPLS_LABEL[[]],load:0x3->OXM_OF_MPLS_TC[[]],set_mpls_ttl(10),dec_mpls_ttl,CONTROLLER:65535
2592 cookie=0xa, n_packets=3, n_bytes=180, dl_src=41:44:44:44:44:42 actions=push_mpls:0x8847,load:0xa->OXM_OF_MPLS_LABEL[[]],load:0x3->OXM_OF_MPLS_TC[[]],pop_mpls:0x0800,CONTROLLER:65535
2593 cookie=0xa, n_packets=3, n_bytes=180, mpls,dl_src=40:44:44:44:44:49 actions=push_mpls:0x8848,load:0xa->OXM_OF_MPLS_LABEL[[]],CONTROLLER:65535
2594 cookie=0xb, n_packets=3, n_bytes=180, mpls,dl_src=50:55:55:55:55:55 actions=load:0x3e8->OXM_OF_MPLS_LABEL[[]],CONTROLLER:65535
2595 cookie=0xc, n_packets=3, n_bytes=180, dl_src=70:77:77:77:77:77 actions=push_mpls:0x8848,load:0x3e8->OXM_OF_MPLS_LABEL[[]],load:0x7->OXM_OF_MPLS_TC[[]],CONTROLLER:65535
2596 cookie=0xd, n_packets=3, n_bytes=180, dl_src=60:66:66:66:00:08 actions=pop_mpls:0x0806,resubmit(1,1)
2597 cookie=0xd, n_packets=3, n_bytes=186, dl_src=60:66:66:66:00:01 actions=pop_mpls:0x0800,dec_ttl,CONTROLLER:65535
2598 cookie=0xd, n_packets=3, n_bytes=186, dl_src=60:66:66:66:00:02 actions=pop_mpls:0x0800,load:0xa000001->NXM_OF_IP_DST[[]],CONTROLLER:65535
2599 cookie=0xd, n_packets=3, n_bytes=186, dl_src=60:66:66:66:00:03 actions=pop_mpls:0x0800,move:NXM_OF_IP_DST[[]]->NXM_OF_IP_SRC[[]],CONTROLLER:65535
2600 cookie=0xd, n_packets=3, n_bytes=186, dl_src=60:66:66:66:00:04 actions=pop_mpls:0x0800,push:NXM_OF_IP_DST[[]],pop:NXM_OF_IP_SRC[[]],CONTROLLER:65535
2601 cookie=0xd, n_packets=3, n_bytes=186, dl_src=60:66:66:66:00:05 actions=pop_mpls:0x0800,multipath(eth_src,50,modulo_n,1,0,NXM_OF_IP_SRC[[0..7]]),CONTROLLER:65535
2602 cookie=0xd, n_packets=3, n_bytes=186, dl_src=60:66:66:66:00:06 actions=pop_mpls:0x0800,bundle_load(eth_src,50,hrw,ofport,NXM_OF_IP_SRC[[0..15]],slaves:1,2),CONTROLLER:65535
2603 cookie=0xd, n_packets=3, n_bytes=186, dl_src=60:66:66:66:00:07 actions=pop_mpls:0x0800,learn(table=1,hard_timeout=60,eth_type=0x800,nw_proto=6,NXM_OF_IP_SRC[[]]=NXM_OF_IP_DST[[]]),CONTROLLER:65535
2604 cookie=0xd, n_packets=3, n_bytes=186, dl_src=60:66:66:66:00:09 actions=resubmit(,2),CONTROLLER:65535
2605 cookie=0xd, n_packets=3, n_bytes=186, dl_src=60:66:66:66:00:0a actions=pop_mpls:0x0800,mod_nw_dst:10.0.0.1,CONTROLLER:65535
2606 cookie=0xd, n_packets=3, n_bytes=186, dl_src=60:66:66:66:00:0b actions=pop_mpls:0x0800,mod_nw_src:10.0.0.1,CONTROLLER:65535
2607 cookie=0xd, n_packets=3, n_bytes=186, dl_src=60:66:66:66:66:66 actions=pop_mpls:0x0800,CONTROLLER:65535
2608 cookie=0xd, n_packets=3, n_bytes=198, dl_src=60:66:66:66:01:00 actions=pop_mpls:0x8848,CONTROLLER:65535
2609 cookie=0xd, n_packets=3, n_bytes=198, dl_src=60:66:66:66:01:01 actions=pop_mpls:0x8847,dec_mpls_ttl,CONTROLLER:65535
2610 cookie=0xd, n_packets=3, n_bytes=198, dl_src=60:66:66:66:01:02 actions=pop_mpls:0x8848,load:0x3->OXM_OF_MPLS_TC[[]],CONTROLLER:65535
2611 cookie=0xd, n_packets=3, n_bytes=198, dl_src=60:66:66:66:02:00 actions=pop_mpls:0x8847,pop_mpls:0x0800,CONTROLLER:65535
2612 cookie=0xd, table=1, n_packets=3, n_bytes=168, arp actions=CONTROLLER:65535
2613 cookie=0xdeadbeef, table=2, n_packets=3, n_bytes=186, dl_src=60:66:66:66:00:09 actions=pop_mpls:0x0800,mod_nw_tos:48
2614 cookie=0xe, n_packets=3, n_bytes=198, dl_src=60:66:66:66:02:01 actions=pop_mpls:0x8848,pop_mpls:0x0800,dec_ttl,CONTROLLER:65535
2615 cookie=0xe, n_packets=3, n_bytes=198, dl_src=60:66:66:66:02:10 actions=pop_mpls:0x8847,dec_mpls_ttl,pop_mpls:0x0800,dec_ttl,CONTROLLER:65535
2616 cookie=0xe, n_packets=3, n_bytes=210, dl_src=60:66:66:66:03:00 actions=pop_mpls:0x8848,pop_mpls:0x8848,CONTROLLER:65535
2617 cookie=0xe, n_packets=3, n_bytes=210, dl_src=60:66:66:66:03:01 actions=pop_mpls:0x8847,pop_mpls:0x8847,dec_mpls_ttl,CONTROLLER:65535
2618 cookie=0xe, n_packets=3, n_bytes=210, dl_src=60:66:66:66:03:10 actions=pop_mpls:0x8848,dec_mpls_ttl,pop_mpls:0x8848,dec_mpls_ttl,CONTROLLER:65535
2619 cookie=0xf, n_packets=3, n_bytes=186, dl_src=60:66:66:66:04:00 actions=pop_mpls:0x0800,push_mpls:0x8847,CONTROLLER:65535
2620 cookie=0xf, n_packets=3, n_bytes=186, dl_src=60:66:66:66:04:01 actions=pop_mpls:0x0800,push_mpls:0x8848,dec_mpls_ttl,CONTROLLER:65535
2621 cookie=0xf, n_packets=3, n_bytes=186, dl_src=60:66:66:66:04:10 actions=pop_mpls:0x0800,dec_ttl,push_mpls:0x8848,dec_mpls_ttl,CONTROLLER:65535
2628 AT_SETUP([ofproto-dpif - MPLS handling with goto_table])
2629 OVS_VSWITCHD_START([dnl
2630 add-port br0 p1 -- set Interface p1 type=dummy
2632 on_exit 'kill `cat ovs-ofctl.pid`'
2634 AT_CAPTURE_FILE([ofctl_monitor.log])
2635 AT_DATA([flows.txt], [dnl
2636 table=0 mplsm actions=pop_mpls:0x800,goto_table(1)
2637 table=1 ip,ip_dscp=8 actions=controller
2639 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flows br0 flows.txt])
2642 dnl Modified MPLS pop action.
2643 dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as:
2644 dnl 60:66:66:66:00:08 > 50:54:00:00:00:01, ethertype MPLS multicast (0x8848), length 62: MPLS (label 20, exp 0, [S], ttl 32)
2645 dnl (tos 0x20, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44)
2646 dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4
2647 AT_CHECK([ovs-ofctl -O OpenFlow12 monitor br0 65534 -P standard --detach --pidfile 2> ofctl_monitor.log])
2650 ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 01 60 66 66 66 00 08 88 48 00 01 41 20 45 20 00 2c 00 00 00 00 ff 06 3a 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45'
2652 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2653 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2655 AT_CHECK([strip_metadata < ofctl_monitor.log], [0], [dnl
2656 OFPT_PACKET_IN (OF1.2) (xid=0x0): table_id=1 total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2657 tcp,vlan_tci=0x0000,dl_src=60:66:66:66:00:08,dl_dst=50:54:00:00:00:01,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=32,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744
2659 OFPT_PACKET_IN (OF1.2) (xid=0x0): table_id=1 total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2660 tcp,vlan_tci=0x0000,dl_src=60:66:66:66:00:08,dl_dst=50:54:00:00:00:01,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=32,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744
2662 OFPT_PACKET_IN (OF1.2) (xid=0x0): table_id=1 total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2663 tcp,vlan_tci=0x0000,dl_src=60:66:66:66:00:08,dl_dst=50:54:00:00:00:01,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=32,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744
2666 AT_CHECK([ovs-appctl revalidator/purge], [0])
2667 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
2668 n_packets=3, n_bytes=186, mplsm actions=pop_mpls:0x0800,goto_table:1
2669 table=1, n_packets=3, n_bytes=174, ip,nw_tos=32 actions=CONTROLLER:65535
2670 OFPST_FLOW reply (OF1.2):
2676 AT_SETUP([ofproto-dpif - MPLS handling with write_actions])
2677 OVS_VSWITCHD_START([dnl
2678 add-port br0 p1 -- set Interface p1 type=dummy
2680 on_exit 'kill `cat ovs-ofctl.pid`'
2682 dnl N.B: The first (and only) action that accesses L3 data after the
2683 dnl pop_mpls action is present in write_actions. This exercises recirculation
2684 dnl triggered in write_actions due to a previous action not in write actions.
2685 AT_CAPTURE_FILE([ofctl_monitor.log])
2686 AT_DATA([flows.txt], [dnl
2687 mplsm actions=pop_mpls:0x800,write_actions(dec_ttl,controller)
2689 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flows br0 flows.txt])
2691 dnl Modified MPLS pop action.
2692 dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as:
2693 dnl 60:66:66:66:00:08 > 50:54:00:00:00:01, ethertype MPLS multicast (0x8848), length 62: MPLS (label 20, exp 0, [S], ttl 32)
2694 dnl (tos 0x20, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44)
2695 dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4
2696 AT_CHECK([ovs-ofctl -O OpenFlow12 monitor br0 65534 -P standard --detach --pidfile 2> ofctl_monitor.log])
2699 ovs-appctl netdev-dummy/receive p1 '50 54 00 00 00 01 60 66 66 66 00 08 88 48 00 01 41 20 45 20 00 2c 00 00 00 00 ff 06 3a 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45'
2701 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2702 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2704 AT_CHECK([strip_metadata < ofctl_monitor.log], [0], [dnl
2705 OFPT_PACKET_IN (OF1.2) (xid=0x0): total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2706 tcp,vlan_tci=0x0000,dl_src=60:66:66:66:00:08,dl_dst=50:54:00:00:00:01,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=32,nw_ecn=0,nw_ttl=254,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744
2708 OFPT_PACKET_IN (OF1.2) (xid=0x0): total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2709 tcp,vlan_tci=0x0000,dl_src=60:66:66:66:00:08,dl_dst=50:54:00:00:00:01,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=32,nw_ecn=0,nw_ttl=254,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744
2711 OFPT_PACKET_IN (OF1.2) (xid=0x0): total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2712 tcp,vlan_tci=0x0000,dl_src=60:66:66:66:00:08,dl_dst=50:54:00:00:00:01,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=32,nw_ecn=0,nw_ttl=254,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744
2715 AT_CHECK([ovs-appctl revalidator/purge], [0])
2716 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
2717 n_packets=3, n_bytes=186, mplsm actions=pop_mpls:0x0800,write_actions(dec_ttl,CONTROLLER:65535)
2718 OFPST_FLOW reply (OF1.2):
2724 AT_SETUP([ofproto-dpif - table-miss flow (OpenFlow 1.0)])
2725 OVS_VSWITCHD_START([dnl
2726 add-port br0 p1 -- set Interface p1 type=dummy
2728 on_exit 'kill `cat ovs-ofctl.pid`'
2730 AT_CAPTURE_FILE([ofctl_monitor.log])
2731 # A table-miss flow has priority 0 and no match
2732 AT_CHECK([ovs-ofctl --protocols=OpenFlow10 add-flow br0 'priority=0 actions=output:CONTROLLER'])
2734 dnl Singleton controller action.
2735 AT_CHECK([ovs-ofctl monitor -P standard --protocols=OpenFlow10 br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
2738 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=10:11:11:11:11:11,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=10),tcp_flags(0x002)'
2740 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2741 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
2743 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
2744 OFPT_PACKET_IN (xid=0x0): total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
2745 tcp,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:0
2747 OFPT_PACKET_IN (xid=0x0): total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
2748 tcp,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:0
2750 OFPT_PACKET_IN (xid=0x0): total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
2751 tcp,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:0
2754 AT_CHECK([ovs-appctl revalidator/purge], [0])
2755 AT_CHECK([ovs-ofctl --protocols=OpenFlow10 dump-flows br0 | ofctl_strip | sort], [0], [dnl
2756 n_packets=3, n_bytes=180, priority=0 actions=CONTROLLER:65535
2764 AT_SETUP([ofproto-dpif - table-miss flow (OpenFlow 1.3)])
2765 OVS_VSWITCHD_START([dnl
2766 add-port br0 p1 -- set Interface p1 type=dummy
2768 on_exit 'kill `cat ovs-ofctl.pid`'
2770 AT_CAPTURE_FILE([ofctl_monitor.log])
2771 # A table-miss flow has priority 0 and no match
2772 AT_CHECK([ovs-ofctl --protocols=OpenFlow13 add-flow br0 'priority=0 actions=output:CONTROLLER'])
2774 dnl Singleton controller action.
2775 AT_CHECK([ovs-ofctl monitor -P standard --protocols=OpenFlow13 br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
2778 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=10:11:11:11:11:11,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=10),tcp_flags(0x002)'
2780 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2781 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
2783 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2785 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
2786 OFPT_PACKET_IN (OF1.3) (xid=0x0): cookie=0x0 total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
2787 tcp,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:0
2789 OFPT_PACKET_IN (OF1.3) (xid=0x0): cookie=0x0 total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
2790 tcp,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:0
2792 OFPT_PACKET_IN (OF1.3) (xid=0x0): cookie=0x0 total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
2793 tcp,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:0
2796 AT_CHECK([ovs-appctl revalidator/purge], [0])
2797 AT_CHECK([ovs-ofctl --protocols=OpenFlow13 dump-flows br0 | ofctl_strip | sort], [0], [dnl
2798 n_packets=3, n_bytes=180, priority=0 actions=CONTROLLER:65535
2799 OFPST_FLOW reply (OF1.3):
2805 AT_SETUP([ofproto-dpif - table-miss flow with async config (OpenFlow 1.3)])
2806 OVS_VSWITCHD_START([dnl
2807 add-port br0 p1 -- set Interface p1 type=dummy
2809 on_exit 'kill `cat ovs-ofctl.pid`'
2811 ovs-appctl time/stop
2813 AT_CAPTURE_FILE([ofctl_monitor.log])
2814 # A table-miss flow has priority 0 and no match
2815 AT_CHECK([ovs-ofctl --protocols=OpenFlow13 add-flow br0 'priority=0 actions=output:CONTROLLER'])
2817 dnl Singleton controller action.
2818 AT_CHECK([ovs-ofctl monitor -P standard --protocols=OpenFlow13 br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
2820 # Become slave (OF 1.3), which should disable everything except port status.
2821 ovs-appctl -t ovs-ofctl ofctl/send 041800180000000200000003000000000000000000000001
2823 # Ensure that ovs-vswitchd gets a chance to reply before sending another command.
2824 ovs-appctl time/warp 500 100
2826 # Use OF 1.3 OFPT_SET_ASYNC to enable OFPR_NO_MATCH for slave only.
2827 ovs-appctl -t ovs-ofctl ofctl/send 041c002000000002000000000000000100000000000000000000000000000000
2829 ovs-appctl time/warp 500 100
2831 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=10:11:11:11:11:11,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=10),tcp_flags(0x002)'
2833 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2834 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
2836 AT_CHECK([ovs-appctl revalidator/purge], [0])
2837 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
2838 send: OFPT_ROLE_REQUEST (OF1.3) (xid=0x2): role=slave generation_id=1
2839 OFPT_ROLE_REPLY (OF1.3) (xid=0x2): role=slave generation_id=1
2841 send: OFPT_SET_ASYNC (OF1.3) (xid=0x2):
2848 REQUESTFORWARD: (off)
2856 REQUESTFORWARD: (off)
2858 OFPT_PACKET_IN (OF1.3) (xid=0x0): cookie=0x0 total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
2859 tcp,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:0
2861 OFPT_PACKET_IN (OF1.3) (xid=0x0): cookie=0x0 total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
2862 tcp,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:0
2864 OFPT_PACKET_IN (OF1.3) (xid=0x0): cookie=0x0 total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
2865 tcp,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:0
2868 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2870 AT_CHECK([ovs-ofctl --protocols=OpenFlow13 dump-flows br0 | ofctl_strip | sort], [0], [dnl
2871 n_packets=3, n_bytes=180, priority=0 actions=CONTROLLER:65535
2872 OFPST_FLOW reply (OF1.3):
2879 AT_SETUP([ofproto-dpif - table-miss flow (OpenFlow 1.4)])
2880 OVS_VSWITCHD_START([dnl
2881 add-port br0 p1 -- set Interface p1 type=dummy
2883 on_exit 'kill `cat ovs-ofctl.pid`'
2885 AT_CAPTURE_FILE([ofctl_monitor.log])
2886 # A table-miss flow has priority 0 and no match
2887 AT_CHECK([ovs-ofctl --protocols=OpenFlow14 add-flow br0 'priority=0 actions=output:CONTROLLER'])
2889 dnl Singleton controller action.
2890 AT_CHECK([ovs-ofctl monitor -P standard --protocols=OpenFlow14 br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
2893 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=10:11:11:11:11:11,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=10),tcp_flags(0x002)'
2895 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2896 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
2898 AT_CHECK([ovs-appctl revalidator/purge], [0])
2899 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
2900 OFPT_PACKET_IN (OF1.4) (xid=0x0): cookie=0x0 total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
2901 tcp,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:0
2903 OFPT_PACKET_IN (OF1.4) (xid=0x0): cookie=0x0 total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
2904 tcp,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:0
2906 OFPT_PACKET_IN (OF1.4) (xid=0x0): cookie=0x0 total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
2907 tcp,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:0
2910 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2912 AT_CHECK([ovs-ofctl --protocols=OpenFlow14 dump-flows br0 | ofctl_strip | sort], [0], [dnl
2913 n_packets=3, n_bytes=180, priority=0 actions=CONTROLLER:65535
2914 OFPST_FLOW reply (OF1.4):
2921 AT_SETUP([ofproto-dpif - packet-in reasons (Openflow 1.3)])
2922 OVS_VSWITCHD_START([dnl
2923 add-port br0 p1 -- set Interface p1 type=dummy
2925 on_exit 'kill `cat ovs-ofctl.pid`'
2927 AT_CAPTURE_FILE([ofctl_monitor.log])
2928 AT_DATA([flows.txt], [dnl
2929 table=0 in_port=1 actions=write_actions(output(CONTROLLER)),goto_table(1)
2930 table=1 actions=output(CONTROLLER),goto_table(2)
2931 table=2 actions=group:1234
2933 AT_CHECK([ovs-ofctl --protocols=OpenFlow13 add-group br0 'group_id=1234,type=all,bucket=output:10,bucket=output:CONTROLLER'])
2934 AT_CHECK([ovs-ofctl --protocols=OpenFlow13 add-flows br0 flows.txt])
2936 dnl Singleton controller action.
2937 AT_CHECK([ovs-ofctl monitor -P standard --protocols=OpenFlow13 br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
2940 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=10:11:11:11:11:11,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=10),tcp_flags(0x002)'
2942 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2943 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
2945 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2947 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
2948 OFPT_PACKET_IN (OF1.3) (xid=0x0): table_id=1 cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
2949 tcp,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:0
2951 OFPT_PACKET_IN (OF1.3) (xid=0x0): table_id=2 cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
2952 tcp,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:0
2954 OFPT_PACKET_IN (OF1.3) (xid=0x0): cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
2955 tcp,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:0
2957 OFPT_PACKET_IN (OF1.3) (xid=0x0): table_id=1 cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
2958 tcp,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:0
2960 OFPT_PACKET_IN (OF1.3) (xid=0x0): table_id=2 cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
2961 tcp,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:0
2963 OFPT_PACKET_IN (OF1.3) (xid=0x0): cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
2964 tcp,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:0
2966 OFPT_PACKET_IN (OF1.3) (xid=0x0): table_id=1 cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
2967 tcp,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:0
2969 OFPT_PACKET_IN (OF1.3) (xid=0x0): table_id=2 cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
2970 tcp,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:0
2972 OFPT_PACKET_IN (OF1.3) (xid=0x0): cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
2973 tcp,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:0
2976 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2978 AT_CHECK([ovs-ofctl --protocols=OpenFlow13 dump-flows br0 | ofctl_strip | sort], [0], [dnl
2979 n_packets=3, n_bytes=180, in_port=1 actions=write_actions(CONTROLLER:65535),goto_table:1
2980 table=1, n_packets=3, n_bytes=180, actions=CONTROLLER:65535,goto_table:2
2981 table=2, n_packets=3, n_bytes=180, actions=group:1234
2982 OFPST_FLOW reply (OF1.3):
2989 AT_SETUP([ofproto-dpif - packet-in reasons (Openflow 1.4)])
2990 OVS_VSWITCHD_START([dnl
2991 add-port br0 p1 -- set Interface p1 type=dummy
2993 on_exit 'kill `cat ovs-ofctl.pid`'
2995 AT_CAPTURE_FILE([ofctl_monitor.log])
2996 AT_DATA([flows.txt], [dnl
2997 table=0 in_port=1 actions=write_actions(output(CONTROLLER)),goto_table(1)
2998 table=1 actions=output(CONTROLLER),goto_table(2)
2999 table=2 actions=group:1234
3001 AT_CHECK([ovs-ofctl --protocols=OpenFlow14 add-group br0 'group_id=1234,type=all,bucket=output:10,bucket=output:CONTROLLER'])
3002 AT_CHECK([ovs-ofctl --protocols=OpenFlow14 add-flows br0 flows.txt])
3004 dnl Singleton controller action.
3005 AT_CHECK([ovs-ofctl monitor -P standard --protocols=OpenFlow14 br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
3008 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=10:11:11:11:11:11,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=10),tcp_flags(0x002)'
3010 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
3011 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
3013 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
3015 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
3016 OFPT_PACKET_IN (OF1.4) (xid=0x0): table_id=1 cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
3017 tcp,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:0
3019 OFPT_PACKET_IN (OF1.4) (xid=0x0): table_id=2 cookie=0x0 total_len=60 in_port=1 (via group) data_len=60 (unbuffered)
3020 tcp,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:0
3022 OFPT_PACKET_IN (OF1.4) (xid=0x0): cookie=0x0 total_len=60 in_port=1 (via action_set) data_len=60 (unbuffered)
3023 tcp,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:0
3025 OFPT_PACKET_IN (OF1.4) (xid=0x0): table_id=1 cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
3026 tcp,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:0
3028 OFPT_PACKET_IN (OF1.4) (xid=0x0): table_id=2 cookie=0x0 total_len=60 in_port=1 (via group) data_len=60 (unbuffered)
3029 tcp,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:0
3031 OFPT_PACKET_IN (OF1.4) (xid=0x0): cookie=0x0 total_len=60 in_port=1 (via action_set) data_len=60 (unbuffered)
3032 tcp,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:0
3034 OFPT_PACKET_IN (OF1.4) (xid=0x0): table_id=1 cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
3035 tcp,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:0
3037 OFPT_PACKET_IN (OF1.4) (xid=0x0): table_id=2 cookie=0x0 total_len=60 in_port=1 (via group) data_len=60 (unbuffered)
3038 tcp,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:0
3040 OFPT_PACKET_IN (OF1.4) (xid=0x0): cookie=0x0 total_len=60 in_port=1 (via action_set) data_len=60 (unbuffered)
3041 tcp,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:0
3044 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
3046 AT_CHECK([ovs-ofctl --protocols=OpenFlow14 dump-flows br0 | ofctl_strip | sort], [0], [dnl
3047 n_packets=3, n_bytes=180, in_port=1 actions=write_actions(CONTROLLER:65535),goto_table:1
3048 table=1, n_packets=3, n_bytes=180, actions=CONTROLLER:65535,goto_table:2
3049 table=2, n_packets=3, n_bytes=180, actions=group:1234
3050 OFPST_FLOW reply (OF1.4):
3057 AT_SETUP([ofproto-dpif - ARP modification slow-path])
3059 add_of_ports br0 1 2
3061 ovs-vsctl -- set Interface p2 type=dummy options:pcap=p2.pcap
3062 ovs-ofctl add-flow br0 'in_port=1,arp actions=load:2->OXM_OF_ARP_OP[[]],2,load:0xc0a88001->OXM_OF_ARP_SPA[[]],2,load:0x404444444441->OXM_OF_ARP_THA[[]],2'
3064 # Input some packets that should follow the arp modification slow-path.
3066 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=80:88:88:88:88:88,dst=ff:ff:ff:ff:ff:ff),eth_type(0x0806),arp(sip=192.168.0.1,tip=192.168.0.2,op=1,sha=50:54:00:00:00:05,tha=00:00:00:00:00:00)'
3068 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
3070 # Check the packets that were output.
3071 AT_CHECK([ovs-ofctl parse-pcap p2.pcap], [0], [dnl
3072 arp,in_port=ANY,vlan_tci=0x0000,dl_src=80:88:88:88:88:88,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=192.168.0.1,arp_tpa=192.168.0.2,arp_op=2,arp_sha=50:54:00:00:00:05,arp_tha=00:00:00:00:00:00
3073 arp,in_port=ANY,vlan_tci=0x0000,dl_src=80:88:88:88:88:88,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=192.168.128.1,arp_tpa=192.168.0.2,arp_op=2,arp_sha=50:54:00:00:00:05,arp_tha=00:00:00:00:00:00
3074 arp,in_port=ANY,vlan_tci=0x0000,dl_src=80:88:88:88:88:88,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=192.168.128.1,arp_tpa=192.168.0.2,arp_op=2,arp_sha=50:54:00:00:00:05,arp_tha=40:44:44:44:44:41
3075 arp,in_port=ANY,vlan_tci=0x0000,dl_src=80:88:88:88:88:88,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=192.168.0.1,arp_tpa=192.168.0.2,arp_op=2,arp_sha=50:54:00:00:00:05,arp_tha=00:00:00:00:00:00
3076 arp,in_port=ANY,vlan_tci=0x0000,dl_src=80:88:88:88:88:88,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=192.168.128.1,arp_tpa=192.168.0.2,arp_op=2,arp_sha=50:54:00:00:00:05,arp_tha=00:00:00:00:00:00
3077 arp,in_port=ANY,vlan_tci=0x0000,dl_src=80:88:88:88:88:88,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=192.168.128.1,arp_tpa=192.168.0.2,arp_op=2,arp_sha=50:54:00:00:00:05,arp_tha=40:44:44:44:44:41
3078 arp,in_port=ANY,vlan_tci=0x0000,dl_src=80:88:88:88:88:88,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=192.168.0.1,arp_tpa=192.168.0.2,arp_op=2,arp_sha=50:54:00:00:00:05,arp_tha=00:00:00:00:00:00
3079 arp,in_port=ANY,vlan_tci=0x0000,dl_src=80:88:88:88:88:88,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=192.168.128.1,arp_tpa=192.168.0.2,arp_op=2,arp_sha=50:54:00:00:00:05,arp_tha=00:00:00:00:00:00
3080 arp,in_port=ANY,vlan_tci=0x0000,dl_src=80:88:88:88:88:88,dl_dst=ff:ff:ff:ff:ff:ff,arp_spa=192.168.128.1,arp_tpa=192.168.0.2,arp_op=2,arp_sha=50:54:00:00:00:05,arp_tha=40:44:44:44:44:41
3086 AT_SETUP([ofproto-dpif - VLAN handling])
3088 [set Bridge br0 fail-mode=standalone -- \
3089 add-port br0 p1 trunks=10,12 -- \
3090 add-port br0 p2 tag=10 -- \
3091 add-port br0 p3 tag=12 \
3092 other-config:priority-tags=true -- \
3093 add-port br0 p4 tag=12 -- \
3094 add-port br0 p5 vlan_mode=native-tagged tag=10 -- \
3095 add-port br0 p6 vlan_mode=native-tagged tag=10 trunks=10,12 -- \
3096 add-port br0 p7 vlan_mode=native-untagged tag=12 -- \
3097 add-port br0 p8 vlan_mode=native-untagged tag=12 trunks=10,12 \
3098 other-config:priority-tags=true -- \
3099 set Interface p1 type=dummy -- \
3100 set Interface p2 type=dummy -- \
3101 set Interface p3 type=dummy -- \
3102 set Interface p4 type=dummy -- \
3103 set Interface p5 type=dummy -- \
3104 set Interface p6 type=dummy -- \
3105 set Interface p7 type=dummy -- \
3106 set Interface p8 type=dummy --])
3108 dnl Each of these specifies an in_port by number, a VLAN VID (or "none"),
3109 dnl a VLAN PCP (used if the VID isn't "none") and the expected set of datapath
3115 "100 10 0 1,5,6,7,8,pop_vlan,2" \
3116 "100 10 1 1,5,6,7,8,pop_vlan,2" \
3119 "100 12 0 1,5,6,pop_vlan,3,4,7,8" \
3120 "100 12 1 1,5,6,pop_vlan,4,7,push_vlan(vid=0,pcp=1),3,8" \
3124 "1 10 0 5,6,7,8,100,pop_vlan,2" \
3125 "1 10 1 5,6,7,8,100,pop_vlan,2" \
3128 "1 12 0 5,6,100,pop_vlan,3,4,7,8" \
3129 "1 12 1 5,6,100,pop_vlan,4,7,push_vlan(vid=0,pcp=1),3,8" \
3130 "2 none 0 push_vlan(vid=10,pcp=0),1,5,6,7,8,100" \
3131 "2 0 0 pop_vlan,push_vlan(vid=10,pcp=0),1,5,6,7,8,100" \
3132 "2 0 1 pop_vlan,push_vlan(vid=10,pcp=1),1,5,6,7,8,100" \
3139 "3 none 0 4,7,8,push_vlan(vid=12,pcp=0),1,5,6,100" \
3140 "3 0 0 pop_vlan,4,7,8,push_vlan(vid=12,pcp=0),1,5,6,100" \
3141 "3 0 1 8,pop_vlan,4,7,push_vlan(vid=12,pcp=1),1,5,6,100" \
3148 "4 none 0 3,7,8,push_vlan(vid=12,pcp=0),1,5,6,100" \
3149 "4 0 0 pop_vlan,3,7,8,push_vlan(vid=12,pcp=0),1,5,6,100" \
3150 "4 0 1 3,8,pop_vlan,7,push_vlan(vid=12,pcp=1),1,5,6,100" \
3157 "5 none 0 2,push_vlan(vid=10,pcp=0),1,6,7,8,100" \
3158 "5 0 0 pop_vlan,2,push_vlan(vid=10,pcp=0),1,6,7,8,100" \
3159 "5 0 1 pop_vlan,2,push_vlan(vid=10,pcp=1),1,6,7,8,100" \
3160 "5 10 0 1,6,7,8,100,pop_vlan,2" \
3161 "5 10 1 1,6,7,8,100,pop_vlan,2" \
3164 "5 12 0 1,6,100,pop_vlan,3,4,7,8" \
3165 "5 12 1 1,6,100,pop_vlan,4,7,push_vlan(vid=0,pcp=1),3,8" \
3166 "6 none 0 2,push_vlan(vid=10,pcp=0),1,5,7,8,100" \
3167 "6 0 0 pop_vlan,2,push_vlan(vid=10,pcp=0),1,5,7,8,100" \
3168 "6 0 1 pop_vlan,2,push_vlan(vid=10,pcp=1),1,5,7,8,100" \
3169 "6 10 0 1,5,7,8,100,pop_vlan,2" \
3170 "6 10 1 1,5,7,8,100,pop_vlan,2" \
3173 "6 12 0 1,5,100,pop_vlan,3,4,7,8" \
3174 "6 12 1 1,5,100,pop_vlan,4,7,push_vlan(vid=0,pcp=1),3,8" \
3175 "7 none 0 3,4,8,push_vlan(vid=12,pcp=0),1,5,6,100" \
3176 "7 0 0 pop_vlan,3,4,8,push_vlan(vid=12,pcp=0),1,5,6,100" \
3177 "7 0 1 3,8,pop_vlan,4,push_vlan(vid=12,pcp=1),1,5,6,100" \
3178 "7 10 0 1,5,6,8,100,pop_vlan,2" \
3179 "7 10 1 1,5,6,8,100,pop_vlan,2" \
3182 "7 12 0 1,5,6,100,pop_vlan,3,4,8" \
3183 "7 12 1 1,5,6,100,pop_vlan,4,push_vlan(vid=0,pcp=1),3,8" \
3184 "8 none 0 3,4,7,push_vlan(vid=12,pcp=0),1,5,6,100" \
3185 "8 0 0 pop_vlan,3,4,7,push_vlan(vid=12,pcp=0),1,5,6,100" \
3186 "8 0 1 3,pop_vlan,4,7,push_vlan(vid=12,pcp=1),1,5,6,100" \
3187 "8 10 0 1,5,6,7,100,pop_vlan,2" \
3188 "8 10 1 1,5,6,7,100,pop_vlan,2" \
3191 "8 12 0 1,5,6,100,pop_vlan,3,4,7" \
3192 "8 12 1 1,5,6,100,pop_vlan,4,7,push_vlan(vid=0,pcp=1),3"
3200 if test $vlan = none; then
3201 flow="in_port($in_port),eth(src=50:54:00:00:00:01,dst=ff:ff:ff:ff:ff:ff),eth_type(0xabcd)"
3203 flow="in_port($in_port),eth(src=50:54:00:00:00:01,dst=ff:ff:ff:ff:ff:ff),eth_type(0x8100),vlan(vid=$vlan,pcp=$pcp),encap(eth_type(0xabcd))"
3206 echo "----------------------------------------------------------------------"
3207 echo "in_port=$in_port vlan=$vlan pcp=$pcp"
3209 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
3210 actual=`tail -1 stdout | sed 's/Datapath actions: //'`
3212 AT_CHECK([ovs-dpctl normalize-actions "$flow" "$expected"], [0], [stdout])
3214 AT_CHECK([ovs-dpctl normalize-actions "$flow" "$actual"], [0], [expout])
3220 AT_SETUP([ofproto-dpif - MPLS handling])
3221 OVS_VSWITCHD_START([dnl
3222 add-port br0 p1 -- set Interface p1 type=dummy
3224 on_exit 'kill `cat ovs-ofctl.pid`'
3226 AT_CAPTURE_FILE([ofctl_monitor.log])
3227 AT_DATA([flows.txt], [dnl
3228 dl_src=40:44:44:44:00:00 actions=push_mpls:0x8847,controller
3229 dl_src=40:44:44:44:00:01,mpls actions=push_mpls:0x8847,controller
3230 dl_src=40:44:44:44:00:02,mpls actions=push_mpls:0x8848,controller
3232 AT_CHECK([ovs-ofctl --protocols=OpenFlow12 add-flows br0 flows.txt])
3234 dnl In this test, we push an MPLS tag to an ethernet packet.
3235 AT_CHECK([ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P standard --detach --pidfile 2> ofctl_monitor.log])
3238 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=40:44:44:44:00:00,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no)'
3240 OVS_WAIT_UNTIL([test `grep OFPT_PACKET_IN ofctl_monitor.log | wc -l` -ge 3])
3241 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
3243 AT_CHECK([ofctl_strip < ofctl_monitor.log], [0], [dnl
3244 OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
3245 mpls,vlan_tci=0x0000,dl_src=40:44:44:44:00:00,dl_dst=50:54:00:00:00:07,mpls_label=0,mpls_tc=0,mpls_ttl=64,mpls_bos=1
3246 00000000 50 54 00 00 00 07 40 44-44 44 00 00 88 47 00 00
3247 00000010 01 40 45 00 00 28 00 00-00 00 40 06 f9 7c c0 a8
3248 00000020 00 01 c0 a8 00 02 00 00-00 00 00 00 00 00 00 00
3249 00000030 00 00 50 00 00 00 00 00-00 00 00 00 00 00 00 00
3251 OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
3252 mpls,vlan_tci=0x0000,dl_src=40:44:44:44:00:00,dl_dst=50:54:00:00:00:07,mpls_label=0,mpls_tc=0,mpls_ttl=64,mpls_bos=1
3253 00000000 50 54 00 00 00 07 40 44-44 44 00 00 88 47 00 00
3254 00000010 01 40 45 00 00 28 00 00-00 00 40 06 f9 7c c0 a8
3255 00000020 00 01 c0 a8 00 02 00 00-00 00 00 00 00 00 00 00
3256 00000030 00 00 50 00 00 00 00 00-00 00 00 00 00 00 00 00
3258 OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
3259 mpls,vlan_tci=0x0000,dl_src=40:44:44:44:00:00,dl_dst=50:54:00:00:00:07,mpls_label=0,mpls_tc=0,mpls_ttl=64,mpls_bos=1
3260 00000000 50 54 00 00 00 07 40 44-44 44 00 00 88 47 00 00
3261 00000010 01 40 45 00 00 28 00 00-00 00 40 06 f9 7c c0 a8
3262 00000020 00 01 c0 a8 00 02 00 00-00 00 00 00 00 00 00 00
3263 00000030 00 00 50 00 00 00 00 00-00 00 00 00 00 00 00 00
3266 dnl In this test, we push an MPLS tag to an MPLS packet. The LSE should be
3267 dnl copied exactly, except for the BOS bit.
3268 AT_CHECK([ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P standard --detach --pidfile 2> ofctl_monitor.log])
3271 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=40:44:44:44:00:01,dst=50:54:00:00:00:07),eth_type(0x8847),mpls(label=10,tc=0,ttl=64,bos=1)'
3273 OVS_WAIT_UNTIL([test `grep OFPT_PACKET_IN ofctl_monitor.log | wc -l` -ge 3])
3274 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
3276 AT_CHECK([ofctl_strip < ofctl_monitor.log], [0], [dnl
3277 OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
3278 mpls,vlan_tci=0x0000,dl_src=40:44:44:44:00:01,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=0,mpls_lse1=41280
3279 00000000 50 54 00 00 00 07 40 44-44 44 00 01 88 47 00 00
3280 00000010 a0 40 00 00 a1 40 00 00-00 00 00 00 00 00 00 00
3281 00000020 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00
3282 00000030 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00
3284 OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
3285 mpls,vlan_tci=0x0000,dl_src=40:44:44:44:00:01,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=0,mpls_lse1=41280
3286 00000000 50 54 00 00 00 07 40 44-44 44 00 01 88 47 00 00
3287 00000010 a0 40 00 00 a1 40 00 00-00 00 00 00 00 00 00 00
3288 00000020 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00
3289 00000030 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00
3291 OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
3292 mpls,vlan_tci=0x0000,dl_src=40:44:44:44:00:01,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=0,mpls_lse1=41280
3293 00000000 50 54 00 00 00 07 40 44-44 44 00 01 88 47 00 00
3294 00000010 a0 40 00 00 a1 40 00 00-00 00 00 00 00 00 00 00
3295 00000020 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00
3296 00000030 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00
3299 dnl In this test, we push an MPLS tag to an MPLS packet. The LSE should be
3300 dnl copied exactly, except for the BOS bit. The ethertype should be updated
3301 dnl to the MPLS ethertype of the MPLS push action which differs to that
3302 dnl of the input packet.
3303 AT_CHECK([ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P standard --detach --pidfile 2> ofctl_monitor.log])
3306 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=40:44:44:44:00:02,dst=50:54:00:00:00:07),eth_type(0x8847),mpls(label=10,tc=0,ttl=64,bos=1)'
3308 OVS_WAIT_UNTIL([test `grep OFPT_PACKET_IN ofctl_monitor.log | wc -l` -ge 3])
3309 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
3311 AT_CHECK([ofctl_strip < ofctl_monitor.log], [0], [dnl
3312 OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
3313 mplsm,vlan_tci=0x0000,dl_src=40:44:44:44:00:02,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=0,mpls_lse1=41280
3314 00000000 50 54 00 00 00 07 40 44-44 44 00 02 88 48 00 00
3315 00000010 a0 40 00 00 a1 40 00 00-00 00 00 00 00 00 00 00
3316 00000020 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00
3317 00000030 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00
3319 OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
3320 mplsm,vlan_tci=0x0000,dl_src=40:44:44:44:00:02,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=0,mpls_lse1=41280
3321 00000000 50 54 00 00 00 07 40 44-44 44 00 02 88 48 00 00
3322 00000010 a0 40 00 00 a1 40 00 00-00 00 00 00 00 00 00 00
3323 00000020 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00
3324 00000030 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00
3326 OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
3327 mplsm,vlan_tci=0x0000,dl_src=40:44:44:44:00:02,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=0,mpls_lse1=41280
3328 00000000 50 54 00 00 00 07 40 44-44 44 00 02 88 48 00 00
3329 00000010 a0 40 00 00 a1 40 00 00-00 00 00 00 00 00 00 00
3330 00000020 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00
3331 00000030 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00
3337 AT_SETUP([ofproto-dpif - VLAN+MPLS handling])
3338 OVS_VSWITCHD_START([dnl
3339 add-port br0 p1 -- set Interface p1 type=dummy
3341 on_exit 'kill `cat ovs-ofctl.pid`'
3343 AT_CAPTURE_FILE([ofctl_monitor.log])
3344 AT_DATA([flows.txt], [dnl
3345 cookie=0xa dl_src=40:44:44:44:54:50 actions=push_mpls:0x8847,load:10->OXM_OF_MPLS_LABEL[[]],push_vlan:0x8100,set_vlan_vid:99,set_vlan_pcp:1,controller
3346 cookie=0xa dl_src=40:44:44:44:54:51 actions=push_mpls:0x8847,load:10->OXM_OF_MPLS_LABEL[[]],push_vlan:0x8100,set_vlan_vid:99,set_vlan_pcp:1,controller
3347 cookie=0xa dl_src=40:44:44:44:54:52 actions=push_mpls:0x8847,load:10->OXM_OF_MPLS_LABEL[[]],push_vlan:0x8100,load:99->OXM_OF_VLAN_VID[[]],set_vlan_pcp:1,controller
3348 cookie=0xa dl_src=40:44:44:44:54:53 actions=push_mpls:0x8847,load:10->OXM_OF_MPLS_LABEL[[]],push_vlan:0x8100,load:99->OXM_OF_VLAN_VID[[]],set_vlan_pcp:1,controller
3349 cookie=0xa dl_src=40:44:44:44:54:54 actions=push_vlan:0x8100,set_vlan_vid:99,set_vlan_pcp:1,push_mpls:0x8847,load:10->OXM_OF_MPLS_LABEL[[]],controller
3350 cookie=0xa dl_src=40:44:44:44:54:55 actions=push_vlan:0x8100,set_vlan_vid:99,set_vlan_pcp:1,push_mpls:0x8847,load:10->OXM_OF_MPLS_LABEL[[]],controller
3351 cookie=0xa dl_src=40:44:44:44:54:56 actions=push_vlan:0x8100,load:99->OXM_OF_VLAN_VID[[]],set_vlan_pcp:1,push_mpls:0x8847,load:10->OXM_OF_MPLS_LABEL[[]],controller
3352 cookie=0xa dl_src=40:44:44:44:54:57 actions=push_vlan:0x8100,load:99->OXM_OF_VLAN_VID[[]],set_vlan_pcp:1,push_mpls:0x8847,load:10->OXM_OF_MPLS_LABEL[[]],controller
3353 cookie=0xa dl_src=40:44:44:44:54:58,vlan_tci=0x1000/0x1000 actions=load:99->OXM_OF_VLAN_VID[[]],set_vlan_pcp:1,push_mpls:0x8847,load:10->OXM_OF_MPLS_LABEL[[]],controller
3354 cookie=0xa dl_src=40:44:44:44:54:59,vlan_tci=0x1000/0x1000 actions=push_mpls:0x8847,load:10->OXM_OF_MPLS_LABEL[[]],set_vlan_pcp:1,load:99->OXM_OF_VLAN_VID[[]],controller
3356 AT_CHECK([ovs-ofctl --protocols=OpenFlow12 add-flows br0 flows.txt])
3358 dnl Modified MPLS controller action.
3359 dnl In this test, we push the MPLS tag before pushing a VLAN tag, so we see
3360 dnl both of these in the final flow
3361 AT_CHECK([ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P standard --detach --pidfile 2> ofctl_monitor.log])
3364 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=40:44:44:44:54:50,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no)'
3366 OVS_WAIT_UNTIL([test `grep OFPT_PACKET_IN ofctl_monitor.log | wc -l` -ge 3])
3367 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
3369 AT_CHECK([ofctl_strip < ofctl_monitor.log], [0], [dnl
3370 OFPT_PACKET_IN (OF1.2): total_len=68 in_port=1 (via action) data_len=68 (unbuffered)
3371 mpls,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:50,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1
3372 00000000 50 54 00 00 00 07 40 44-44 44 54 50 81 00 20 63
3373 00000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
3374 00000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
3375 00000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
3376 00000040 00 00 00 00
3378 OFPT_PACKET_IN (OF1.2): total_len=68 in_port=1 (via action) data_len=68 (unbuffered)
3379 mpls,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:50,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1
3380 00000000 50 54 00 00 00 07 40 44-44 44 54 50 81 00 20 63
3381 00000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
3382 00000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
3383 00000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
3384 00000040 00 00 00 00
3386 OFPT_PACKET_IN (OF1.2): total_len=68 in_port=1 (via action) data_len=68 (unbuffered)
3387 mpls,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:50,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1
3388 00000000 50 54 00 00 00 07 40 44-44 44 54 50 81 00 20 63
3389 00000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
3390 00000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
3391 00000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
3392 00000040 00 00 00 00
3395 dnl Modified MPLS controller action.
3396 dnl In this test, the input packet is vlan-tagged, which should be stripped
3397 dnl before we push the MPLS and VLAN tags.
3398 AT_CHECK([ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P standard --detach --pidfile 2> ofctl_monitor.log])
3401 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=40:44:44:44:54:51,dst=50:54:00:00:00:07),eth_type(0x8100),vlan(vid=88,pcp=7),encap(eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no))'
3403 OVS_WAIT_UNTIL([test `grep OFPT_PACKET_IN ofctl_monitor.log | wc -l` -ge 3])
3404 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
3406 AT_CHECK([ofctl_strip < ofctl_monitor.log], [0], [dnl
3407 OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
3408 mpls,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:51,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1
3409 00000000 50 54 00 00 00 07 40 44-44 44 54 51 81 00 20 63
3410 00000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
3411 00000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
3412 00000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
3414 OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
3415 mpls,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:51,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1
3416 00000000 50 54 00 00 00 07 40 44-44 44 54 51 81 00 20 63
3417 00000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
3418 00000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
3419 00000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
3421 OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
3422 mpls,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:51,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1
3423 00000000 50 54 00 00 00 07 40 44-44 44 54 51 81 00 20 63
3424 00000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
3425 00000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
3426 00000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
3429 dnl Modified MPLS controller action.
3430 dnl In this test, we push the MPLS tag before pushing a VLAN tag, so we see
3431 dnl both of these in the final flow
3432 AT_CHECK([ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P standard --detach --pidfile 2> ofctl_monitor.log])
3435 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=40:44:44:44:54:52,dst=52:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no)'
3437 OVS_WAIT_UNTIL([test `grep OFPT_PACKET_IN ofctl_monitor.log | wc -l` -ge 3])
3438 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
3440 AT_CHECK([ofctl_strip < ofctl_monitor.log], [0], [dnl
3441 OFPT_PACKET_IN (OF1.2): total_len=68 in_port=1 (via action) data_len=68 (unbuffered)
3442 mpls,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:52,dl_dst=52:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1
3443 00000000 52 54 00 00 00 07 40 44-44 44 54 52 81 00 20 63
3444 00000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
3445 00000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
3446 00000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
3447 00000040 00 00 00 00
3449 OFPT_PACKET_IN (OF1.2): total_len=68 in_port=1 (via action) data_len=68 (unbuffered)
3450 mpls,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:52,dl_dst=52:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1
3451 00000000 52 54 00 00 00 07 40 44-44 44 54 52 81 00 20 63
3452 00000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
3453 00000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
3454 00000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
3455 00000040 00 00 00 00
3457 OFPT_PACKET_IN (OF1.2): total_len=68 in_port=1 (via action) data_len=68 (unbuffered)
3458 mpls,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:52,dl_dst=52:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1
3459 00000000 52 54 00 00 00 07 40 44-44 44 54 52 81 00 20 63
3460 00000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
3461 00000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
3462 00000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
3463 00000040 00 00 00 00
3466 dnl Modified MPLS controller action.
3467 dnl In this test, the input packet is vlan-tagged, which should be stripped
3468 dnl before we push the MPLS and VLAN tags.
3469 AT_CHECK([ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P standard --detach --pidfile 2> ofctl_monitor.log])
3472 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=40:44:44:44:54:53,dst=50:54:00:00:00:07),eth_type(0x8100),vlan(vid=88,pcp=7),encap(eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no))'
3474 OVS_WAIT_UNTIL([test `grep OFPT_PACKET_IN ofctl_monitor.log | wc -l` -ge 3])
3475 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
3477 AT_CHECK([ofctl_strip < ofctl_monitor.log], [0], [dnl
3478 OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
3479 mpls,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:53,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1
3480 00000000 50 54 00 00 00 07 40 44-44 44 54 53 81 00 20 63
3481 00000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
3482 00000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
3483 00000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
3485 OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
3486 mpls,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:53,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1
3487 00000000 50 54 00 00 00 07 40 44-44 44 54 53 81 00 20 63
3488 00000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
3489 00000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
3490 00000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
3492 OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
3493 mpls,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:53,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1
3494 00000000 50 54 00 00 00 07 40 44-44 44 54 53 81 00 20 63
3495 00000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
3496 00000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
3497 00000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
3500 dnl Modified MPLS controller action.
3501 dnl In this test, we push the VLAN tag before pushing a MPLS tag, but these
3502 dnl actions are reordered, so we see both of these in the final flow.
3503 AT_CHECK([ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P standard --detach --pidfile 2> ofctl_monitor.log])
3506 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=40:44:44:44:54:54,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no)'
3508 OVS_WAIT_UNTIL([test `grep OFPT_PACKET_IN ofctl_monitor.log | wc -l` -ge 3])
3509 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
3511 AT_CHECK([ofctl_strip < ofctl_monitor.log], [0], [dnl
3512 OFPT_PACKET_IN (OF1.2): total_len=68 in_port=1 (via action) data_len=68 (unbuffered)
3513 mpls,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:54,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1
3514 00000000 50 54 00 00 00 07 40 44-44 44 54 54 81 00 20 63
3515 00000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
3516 00000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
3517 00000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
3518 00000040 00 00 00 00
3520 OFPT_PACKET_IN (OF1.2): total_len=68 in_port=1 (via action) data_len=68 (unbuffered)
3521 mpls,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:54,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1
3522 00000000 50 54 00 00 00 07 40 44-44 44 54 54 81 00 20 63
3523 00000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
3524 00000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
3525 00000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
3526 00000040 00 00 00 00
3528 OFPT_PACKET_IN (OF1.2): total_len=68 in_port=1 (via action) data_len=68 (unbuffered)
3529 mpls,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:54,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1
3530 00000000 50 54 00 00 00 07 40 44-44 44 54 54 81 00 20 63
3531 00000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
3532 00000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
3533 00000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
3534 00000040 00 00 00 00
3537 dnl Modified MPLS controller action.
3538 dnl In this test, the input packet is vlan-tagged, which should be stripped
3539 dnl before we push the MPLS and VLAN tags.
3540 AT_CHECK([ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P standard --detach --pidfile 2> ofctl_monitor.log])
3543 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=40:44:44:44:54:55,dst=50:54:00:00:00:07),eth_type(0x8100),vlan(vid=88,pcp=7),encap(eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no))'
3545 OVS_WAIT_UNTIL([test `grep OFPT_PACKET_IN ofctl_monitor.log | wc -l` -ge 3])
3546 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
3548 AT_CHECK([ofctl_strip < ofctl_monitor.log], [0], [dnl
3549 OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
3550 mpls,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:55,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1
3551 00000000 50 54 00 00 00 07 40 44-44 44 54 55 81 00 20 63
3552 00000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
3553 00000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
3554 00000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
3556 OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
3557 mpls,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:55,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1
3558 00000000 50 54 00 00 00 07 40 44-44 44 54 55 81 00 20 63
3559 00000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
3560 00000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
3561 00000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
3563 OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
3564 mpls,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:55,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1
3565 00000000 50 54 00 00 00 07 40 44-44 44 54 55 81 00 20 63
3566 00000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
3567 00000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
3568 00000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
3571 dnl Modified MPLS controller action.
3572 dnl In this test, we push the VLAN tag before pushing a MPLS tag, but these
3573 dnl actions are reordered, so we see both of these in the final flow.
3574 AT_CHECK([ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P standard --detach --pidfile 2> ofctl_monitor.log])
3577 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=40:44:44:44:54:56,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no)'
3579 OVS_WAIT_UNTIL([test `grep OFPT_PACKET_IN ofctl_monitor.log | wc -l` -ge 3])
3580 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
3582 AT_CHECK([ofctl_strip < ofctl_monitor.log], [0], [dnl
3583 OFPT_PACKET_IN (OF1.2): total_len=68 in_port=1 (via action) data_len=68 (unbuffered)
3584 mpls,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:56,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1
3585 00000000 50 54 00 00 00 07 40 44-44 44 54 56 81 00 20 63
3586 00000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
3587 00000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
3588 00000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
3589 00000040 00 00 00 00
3591 OFPT_PACKET_IN (OF1.2): total_len=68 in_port=1 (via action) data_len=68 (unbuffered)
3592 mpls,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:56,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1
3593 00000000 50 54 00 00 00 07 40 44-44 44 54 56 81 00 20 63
3594 00000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
3595 00000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
3596 00000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
3597 00000040 00 00 00 00
3599 OFPT_PACKET_IN (OF1.2): total_len=68 in_port=1 (via action) data_len=68 (unbuffered)
3600 mpls,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:56,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1
3601 00000000 50 54 00 00 00 07 40 44-44 44 54 56 81 00 20 63
3602 00000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
3603 00000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
3604 00000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
3605 00000040 00 00 00 00
3608 dnl Modified MPLS controller action.
3609 dnl In this test, the input packet is vlan-tagged, which should be stripped
3610 dnl before we push the MPLS and VLAN tags.
3611 AT_CHECK([ovs-ofctl --protocols=OpenFlow12 monitor br0 -m 65534 -P standard --detach --pidfile 2> ofctl_monitor.log])
3614 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=40:44:44:44:54:57,dst=50:54:00:00:00:07),eth_type(0x8100),vlan(vid=88,pcp=7),encap(eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no))'
3616 OVS_WAIT_UNTIL([test `grep OFPT_PACKET_IN ofctl_monitor.log | wc -l` -ge 3])
3617 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
3619 AT_CHECK([ofctl_strip < ofctl_monitor.log], [0], [dnl
3620 OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
3621 mpls,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:57,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1
3622 00000000 50 54 00 00 00 07 40 44-44 44 54 57 81 00 20 63
3623 00000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
3624 00000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
3625 00000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
3627 OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
3628 mpls,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:57,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1
3629 00000000 50 54 00 00 00 07 40 44-44 44 54 57 81 00 20 63
3630 00000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
3631 00000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
3632 00000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
3634 OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
3635 mpls,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:57,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1
3636 00000000 50 54 00 00 00 07 40 44-44 44 54 57 81 00 20 63
3637 00000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
3638 00000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
3639 00000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
3642 dnl Modified MPLS controller action.
3643 dnl In this test, the input packet is vlan-tagged, which should be stripped
3644 dnl before we push the MPLS and VLAN tags.
3645 AT_CHECK([ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P standard --detach --pidfile 2> ofctl_monitor.log])
3648 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=40:44:44:44:54:58,dst=50:54:00:00:00:07),eth_type(0x8100),vlan(vid=88,pcp=7),encap(eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no))'
3650 OVS_WAIT_UNTIL([test `grep OFPT_PACKET_IN ofctl_monitor.log | wc -l` -ge 3])
3651 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
3653 AT_CHECK([ofctl_strip < ofctl_monitor.log], [0], [dnl
3654 OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
3655 mpls,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:58,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1
3656 00000000 50 54 00 00 00 07 40 44-44 44 54 58 81 00 20 63
3657 00000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
3658 00000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
3659 00000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
3661 OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
3662 mpls,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:58,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1
3663 00000000 50 54 00 00 00 07 40 44-44 44 54 58 81 00 20 63
3664 00000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
3665 00000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
3666 00000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
3668 OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
3669 mpls,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:58,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1
3670 00000000 50 54 00 00 00 07 40 44-44 44 54 58 81 00 20 63
3671 00000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
3672 00000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
3673 00000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
3676 dnl Modified MPLS controller action.
3677 dnl In this test, the input packet is vlan-tagged, which should be modified
3678 dnl before we push MPLS and VLAN tags.
3679 AT_CHECK([ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P standard --detach --pidfile 2> ofctl_monitor.log])
3682 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=40:44:44:44:54:59,dst=50:54:00:00:00:07),eth_type(0x8100),vlan(vid=88,pcp=7),encap(eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no))'
3684 OVS_WAIT_UNTIL([test `grep OFPT_PACKET_IN ofctl_monitor.log | wc -l` -ge 3])
3685 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
3687 AT_CHECK([ofctl_strip < ofctl_monitor.log], [0], [dnl
3688 OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
3689 mpls,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:59,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1
3690 00000000 50 54 00 00 00 07 40 44-44 44 54 59 81 00 20 63
3691 00000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
3692 00000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
3693 00000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
3695 OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
3696 mpls,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:59,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1
3697 00000000 50 54 00 00 00 07 40 44-44 44 54 59 81 00 20 63
3698 00000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
3699 00000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
3700 00000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
3702 OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
3703 mpls,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:59,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1
3704 00000000 50 54 00 00 00 07 40 44-44 44 54 59 81 00 20 63
3705 00000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
3706 00000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
3707 00000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
3710 AT_CHECK([ovs-appctl revalidator/purge], [0])
3711 AT_CHECK([ovs-ofctl --protocols=OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
3712 cookie=0xa, n_packets=3, n_bytes=180, dl_src=40:44:44:44:54:50 actions=push_mpls:0x8847,load:0xa->OXM_OF_MPLS_LABEL[[]],push_vlan:0x8100,set_field:4195->vlan_vid,set_field:1->vlan_pcp,CONTROLLER:65535
3713 cookie=0xa, n_packets=3, n_bytes=180, dl_src=40:44:44:44:54:51 actions=push_mpls:0x8847,load:0xa->OXM_OF_MPLS_LABEL[[]],push_vlan:0x8100,set_field:4195->vlan_vid,set_field:1->vlan_pcp,CONTROLLER:65535
3714 cookie=0xa, n_packets=3, n_bytes=180, dl_src=40:44:44:44:54:52 actions=push_mpls:0x8847,load:0xa->OXM_OF_MPLS_LABEL[[]],push_vlan:0x8100,load:0x63->OXM_OF_VLAN_VID[[]],set_field:1->vlan_pcp,CONTROLLER:65535
3715 cookie=0xa, n_packets=3, n_bytes=180, dl_src=40:44:44:44:54:53 actions=push_mpls:0x8847,load:0xa->OXM_OF_MPLS_LABEL[[]],push_vlan:0x8100,load:0x63->OXM_OF_VLAN_VID[[]],set_field:1->vlan_pcp,CONTROLLER:65535
3716 cookie=0xa, n_packets=3, n_bytes=180, dl_src=40:44:44:44:54:54 actions=push_vlan:0x8100,set_field:4195->vlan_vid,set_field:1->vlan_pcp,push_mpls:0x8847,load:0xa->OXM_OF_MPLS_LABEL[[]],CONTROLLER:65535
3717 cookie=0xa, n_packets=3, n_bytes=180, dl_src=40:44:44:44:54:55 actions=push_vlan:0x8100,set_field:4195->vlan_vid,set_field:1->vlan_pcp,push_mpls:0x8847,load:0xa->OXM_OF_MPLS_LABEL[[]],CONTROLLER:65535
3718 cookie=0xa, n_packets=3, n_bytes=180, dl_src=40:44:44:44:54:56 actions=push_vlan:0x8100,load:0x63->OXM_OF_VLAN_VID[[]],set_field:1->vlan_pcp,push_mpls:0x8847,load:0xa->OXM_OF_MPLS_LABEL[[]],CONTROLLER:65535
3719 cookie=0xa, n_packets=3, n_bytes=180, dl_src=40:44:44:44:54:57 actions=push_vlan:0x8100,load:0x63->OXM_OF_VLAN_VID[[]],set_field:1->vlan_pcp,push_mpls:0x8847,load:0xa->OXM_OF_MPLS_LABEL[[]],CONTROLLER:65535
3720 cookie=0xa, n_packets=3, n_bytes=180, vlan_tci=0x1000/0x1000,dl_src=40:44:44:44:54:58 actions=load:0x63->OXM_OF_VLAN_VID[[]],set_field:1->vlan_pcp,push_mpls:0x8847,load:0xa->OXM_OF_MPLS_LABEL[[]],CONTROLLER:65535
3721 cookie=0xa, n_packets=3, n_bytes=180, vlan_tci=0x1000/0x1000,dl_src=40:44:44:44:54:59 actions=push_mpls:0x8847,load:0xa->OXM_OF_MPLS_LABEL[[]],set_field:1->vlan_pcp,load:0x63->OXM_OF_VLAN_VID[[]],CONTROLLER:65535
3722 OFPST_FLOW reply (OF1.2):
3728 AT_SETUP([ofproto-dpif - fragment handling - trace])
3730 add_of_ports br0 1 2 3 4 5 6 90
3731 AT_DATA([flows.txt], [dnl
3732 priority=75 tcp ip_frag=no tp_dst=80 actions=move:OXM_OF_TCP_DST[[]]->OXM_OF_TCP_SRC[[]],output:1
3733 priority=75 tcp ip_frag=first tp_dst=80 actions=move:OXM_OF_TCP_DST[[]]->OXM_OF_TCP_SRC[[]],output:2
3734 priority=50 tcp ip_frag=no actions=move:OXM_OF_TCP_DST[[]]->OXM_OF_TCP_SRC[[]],output:4
3735 priority=50 tcp ip_frag=first actions=move:OXM_OF_TCP_DST[[]]->OXM_OF_TCP_SRC[[]],output:5
3736 priority=50 tcp ip_frag=later actions=output:6
3738 AT_CHECK([ovs-ofctl replace-flows br0 flows.txt])
3740 base_flow="in_port(90),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=128"
3741 no_flow="$base_flow,frag=no),tcp(src=12345,dst=80)"
3742 first_flow="$base_flow,frag=first),tcp(src=12345,dst=80)"
3743 later_flow="$base_flow,frag=later)"
3745 # mode no first later
3748 'drop 1 drop drop' \
3757 AT_CHECK([ovs-ofctl set-frags br0 $mode])
3758 for type in no first later; do
3759 eval flow=\$${type}_flow exp_output=\$$type
3760 printf "\n%s\n" "----$mode $type-----"
3761 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
3763 if test $mode = drop && test $type != no; then
3764 echo 'Packets dropped because they are IP fragments and the fragment handling mode is "drop".' >> expout
3765 echo "Datapath actions: $exp_output" >> expout
3766 elif test $type = later; then
3767 echo "Datapath actions: $exp_output" >> expout
3769 echo "Datapath actions: set(tcp(src=80,dst=80)),$exp_output" >> expout
3771 AT_CHECK([grep 'IP fragments' stdout; tail -1 stdout], [0], [expout])
3777 AT_SETUP([ofproto-dpif - fragment handling - upcall])
3779 add_of_ports br0 1 2 3 4 5 6 90
3780 AT_DATA([flows.txt], [dnl
3781 priority=75 tcp ip_frag=no tp_dst=80 actions=set_field:81->tcp_dst,output:1
3782 priority=75 tcp ip_frag=first tp_dst=80 actions=set_field:81->tcp_dst,output:2
3783 priority=50 tcp ip_frag=no actions=set_field:81->tcp_dst,output:4
3784 priority=50 tcp ip_frag=first actions=set_field:81->tcp_dst,output:5
3785 priority=50 tcp ip_frag=later actions=output:6
3787 AT_CHECK([ovs-ofctl replace-flows br0 flows.txt])
3789 base_flow="in_port(90),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=128"
3790 no_flow="$base_flow,frag=no),tcp(src=12345,dst=80)"
3791 first_flow="$base_flow,frag=first),tcp(src=12345,dst=80)"
3792 later_flow="$base_flow,frag=later)"
3794 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
3798 AT_CHECK([ovs-ofctl set-frags br0 $mode])
3799 for type in no first later; do
3800 eval flow=\$${type}_flow
3801 printf "\n%s\n" "----$mode $type-----"
3803 AT_CHECK([ovs-appctl netdev-dummy/receive p90 "$flow"], [0], [stdout])
3806 AT_CHECK([ovs-appctl dpctl/dump-flows], [0], [dnl
3807 flow-dump from non-dpdk interfaces:
3808 recirc_id(0),in_port(90),eth_type(0x0800),ipv4(proto=6,frag=no),tcp(dst=80), packets:0, bytes:0, used:never, actions:set(tcp(dst=81)),1
3809 recirc_id(0),in_port(90),eth_type(0x0800),ipv4(proto=6,frag=first),tcp(dst=80), packets:0, bytes:0, used:never, actions:set(tcp(dst=81)),5
3810 recirc_id(0),in_port(90),eth_type(0x0800),ipv4(proto=6,frag=later), packets:0, bytes:0, used:never, actions:6
3815 AT_CHECK([ovs-appctl revalidator/purge], [0])
3816 AT_CHECK([ovs-ofctl set-frags br0 $mode])
3817 for type in no first later; do
3818 eval flow=\$${type}_flow
3819 printf "\n%s\n" "----$mode $type-----"
3821 AT_CHECK([ovs-appctl netdev-dummy/receive p90 "$flow"], [0], [stdout])
3824 AT_CHECK([ovs-appctl dpctl/dump-flows], [0], [dnl
3825 flow-dump from non-dpdk interfaces:
3826 recirc_id(0),in_port(90),eth_type(0x0800),ipv4(proto=6,frag=no),tcp(dst=80), packets:0, bytes:0, used:never, actions:set(tcp(dst=81)),1
3827 recirc_id(0),in_port(90),eth_type(0x0800),ipv4(frag=first), packets:0, bytes:0, used:never, actions:drop
3828 recirc_id(0),in_port(90),eth_type(0x0800),ipv4(frag=later), packets:0, bytes:0, used:never, actions:drop
3833 AT_CHECK([ovs-appctl revalidator/purge], [0])
3834 AT_CHECK([ovs-ofctl set-frags br0 $mode])
3835 for type in no first later; do
3836 eval flow=\$${type}_flow
3837 printf "\n%s\n" "----$mode $type-----"
3839 AT_CHECK([ovs-appctl netdev-dummy/receive p90 "$flow"], [0], [stdout])
3842 AT_CHECK([ovs-appctl dpctl/dump-flows], [0], [dnl
3843 flow-dump from non-dpdk interfaces:
3844 recirc_id(0),in_port(90),eth_type(0x0800),ipv4(proto=6,frag=no),tcp(dst=80), packets:0, bytes:0, used:never, actions:set(tcp(dst=81)),1
3845 recirc_id(0),in_port(90),eth_type(0x0800),ipv4(proto=6,frag=first),tcp(dst=80), packets:0, bytes:0, used:never, actions:set(tcp(dst=81)),2
3846 recirc_id(0),in_port(90),eth_type(0x0800),ipv4(proto=6,frag=later), packets:0, bytes:0, used:never, actions:6
3852 AT_SETUP([ofproto-dpif - fragment handling - actions])
3854 add_of_ports br0 1 2 3 4 5 6 90
3856 AT_CHECK([ovs-ofctl add-flow br0 "tcp,ip_frag=later actions=move:OXM_OF_TCP_DST[[0..7]]->OXM_OF_TCP_SRC[[0..7]],output:1"], [1], [], [stderr])
3857 AT_CHECK([tail -2 stderr | sed 's/^.*|WARN|//'], [0], [dnl
3858 source field tcp_dst lacks correct prerequisites
3859 ovs-ofctl: actions are invalid with specified match (OFPBAC_MATCH_INCONSISTENT)
3862 AT_CHECK([ovs-ofctl -O OpenFlow15 add-flow br0 "tcp,ip_frag=later actions=move:OXM_OF_PKT_REG0[[0..7]]->OXM_OF_TCP_SRC[[0..7]],output:1"], [1], [], [stderr])
3863 AT_CHECK([tail -2 stderr | sed 's/^.*|WARN|//'], [0], [dnl
3864 destination field tcp_src lacks correct prerequisites
3865 ovs-ofctl: actions are invalid with specified match (OFPBAC_MATCH_INCONSISTENT)
3868 AT_CHECK([ovs-ofctl add-flow br0 "udp,ip_frag=later actions=set_field:8888->udp_src,output:1"], [1], [], [stderr])
3869 AT_CHECK([tail -2 stderr | sed 's/^.*|WARN|//'], [0], [dnl
3870 set_field udp_src lacks correct prerequisities
3871 ovs-ofctl: actions are invalid with specified match (OFPBAC_MATCH_INCONSISTENT)
3874 AT_CHECK([ovs-ofctl add-flow br0 "udp,ip_frag=later actions=load:8888->NXM_OF_UDP_DST[[]],output:1"], [1], [], [stderr])
3875 AT_CHECK([tail -2 stderr | sed 's/^.*|WARN|//'], [0], [dnl
3876 set_field udp_dst lacks correct prerequisities
3877 ovs-ofctl: actions are invalid with specified match (OFPBAC_MATCH_INCONSISTENT)
3880 AT_CHECK([ovs-ofctl add-flow br0 "sctp,ip_frag=later actions=set_field:8888->sctp_src,output:1"], [1], [], [stderr])
3881 AT_CHECK([tail -2 stderr | sed 's/^.*|WARN|//'], [0], [dnl
3882 set_field sctp_src lacks correct prerequisities
3883 ovs-ofctl: actions are invalid with specified match (OFPBAC_MATCH_INCONSISTENT)
3886 AT_CHECK([ovs-ofctl add-flow br0 "sctp,ip_frag=later actions=set_field:8888->sctp_dst,output:1"], [1], [], [stderr])
3887 AT_CHECK([tail -2 stderr | sed 's/^.*|WARN|//'], [0], [dnl
3888 set_field sctp_dst lacks correct prerequisities
3889 ovs-ofctl: actions are invalid with specified match (OFPBAC_MATCH_INCONSISTENT)
3892 AT_CHECK([ovs-ofctl add-flow br0 "tcp,ip_frag=later actions=learn(table=1,hard_timeout=60,eth_type=0x800,nw_proto=6,NXM_OF_IP_SRC[[]]=NXM_OF_IP_DST[[]],NXM_OF_TCP_SRC[[]]=NXM_OF_TCP_DST[[]],output:NXM_NX_REG0[[0..15]]),output:1"], [1], [], [stderr])
3893 AT_CHECK([tail -2 stderr | sed 's/^.*|WARN|//'], [0], [dnl
3894 source field tcp_dst lacks correct prerequisites
3895 ovs-ofctl: actions are invalid with specified match (OFPBAC_MATCH_INCONSISTENT)
3898 AT_DATA([flows.txt], [dnl
3899 priority=75 tcp actions=load:42->OXM_OF_TCP_SRC[[0..7]],output:1
3901 AT_CHECK([ovs-ofctl -O OpenFlow12 replace-flows br0 flows.txt])
3903 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
3907 AT_CHECK([ovs-ofctl set-frags br0 $mode])
3908 for frag in 4000 6000 6008 4010; do
3909 printf "\n%s\n" "----$mode $frag-----"
3911 AT_CHECK([ovs-appctl netdev-dummy/receive p90 "0021853763af 0026b98cb0f9 0800 4500 003c 2e24 $frag 40 06 465d ac11370d ac11370b 828b 0016 751e267b 00000000 a002 16d0 1736 0000 02 04 05 b4 04 02 08 0a 2d 25 08 5f 00 00 00 00 01 03 03 07"])
3914 dnl The set_field action only modifies 8 bits of the tcp_src, so both the flow
3915 dnl wildcard and the set_field action have a mask of 0xFF. Up to (including)
3916 dnl OVS-2.5, the wildcards and set_field mask are shared internally.
3917 AT_CHECK([ovs-appctl dpctl/dump-flows | sed 's/used:[[0-9]].[[0-9]]*s/used:0.001s/'], [0], [dnl
3918 flow-dump from non-dpdk interfaces:
3919 recirc_id(0),in_port(90),eth_type(0x0800),ipv4(proto=6,frag=no),tcp(src=33419/0xff), packets:0, bytes:0, used:never, actions:set(tcp(src=42/0xff)),1
3920 recirc_id(0),in_port(90),eth_type(0x0800),ipv4(proto=6,frag=first),tcp(src=33419/0xff), packets:0, bytes:0, used:never, actions:set(tcp(src=42/0xff)),1
3921 recirc_id(0),in_port(90),eth_type(0x0800),ipv4(proto=6,frag=later), packets:1, bytes:74, used:0.001s, actions:1
3924 AT_CHECK([ovs-appctl revalidator/purge], [0])
3925 AT_CHECK([ovs-ofctl set-frags br0 $mode])
3926 for frag in 4000 6000 6008 4010; do
3927 printf "\n%s\n" "----$mode $frag truncated transport header -----"
3929 AT_CHECK([ovs-appctl netdev-dummy/receive p90 "0021853763af 0026b98cb0f9 0800 4500 0018 2e24 $frag 40 06 465d ac11370d ac11370b 828b 0016"])
3932 AT_CHECK([ovs-appctl dpctl/dump-flows | sed 's/used:[[0-9]].[[0-9]]*s/used:0.001s/'], [0], [dnl
3933 flow-dump from non-dpdk interfaces:
3934 recirc_id(0),in_port(90),eth_type(0x0800),ipv4(proto=6,frag=no),tcp(src=0/0xff), packets:0, bytes:0, used:never, actions:set(tcp(src=42/0xff)),1
3935 recirc_id(0),in_port(90),eth_type(0x0800),ipv4(proto=6,frag=first),tcp(src=0/0xff), packets:0, bytes:0, used:never, actions:set(tcp(src=42/0xff)),1
3936 recirc_id(0),in_port(90),eth_type(0x0800),ipv4(proto=6,frag=later), packets:1, bytes:60, used:0.001s, actions:1
3939 AT_CHECK([ovs-appctl revalidator/purge], [0])
3940 AT_CHECK([ovs-ofctl set-frags br0 $mode])
3941 for frag in 4000 6000 6001 4002; do
3942 printf "\n%s\n" "----$mode $frag missing transport header-----"
3944 AT_CHECK([ovs-appctl netdev-dummy/receive p90 "0021853763af 0026b98cb0f9 0800 4500 0014 2e24 $frag 40 06 465d ac11370d ac11370b"])
3947 AT_CHECK([ovs-appctl dpctl/dump-flows | sed 's/used:[[0-9]].[[0-9]]*s/used:0.001s/'], [0], [dnl
3948 flow-dump from non-dpdk interfaces:
3949 recirc_id(0),in_port(90),eth_type(0x0800),ipv4(proto=6,frag=no),tcp(src=0/0xff), packets:0, bytes:0, used:never, actions:set(tcp(src=42/0xff)),1
3950 recirc_id(0),in_port(90),eth_type(0x0800),ipv4(proto=6,frag=first),tcp(src=0/0xff), packets:0, bytes:0, used:never, actions:set(tcp(src=42/0xff)),1
3951 recirc_id(0),in_port(90),eth_type(0x0800),ipv4(proto=6,frag=later), packets:1, bytes:60, used:0.001s, actions:1
3957 AT_SETUP([ofproto-dpif - exit])
3959 add_of_ports br0 1 2 3 10 11 12 13 14
3960 AT_DATA([flows.txt], [dnl
3961 in_port=1 actions=output:10,exit,output:11
3962 in_port=2 actions=output:12,resubmit:1,output:12
3963 in_port=3 actions=output:13,resubmit:2,output:14
3965 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
3966 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)'], [0], [stdout])
3967 AT_CHECK([tail -1 stdout], [0],
3968 [Datapath actions: 10
3970 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(2),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)'], [0], [stdout])
3971 AT_CHECK([tail -1 stdout], [0],
3972 [Datapath actions: 12,10
3974 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(3),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)'], [0], [stdout])
3975 AT_CHECK([tail -1 stdout], [0],
3976 [Datapath actions: 13,12,10
3982 AT_SETUP([ofproto-dpif - mirroring, select_all])
3983 AT_KEYWORDS([mirror mirrors mirroring])
3985 add_of_ports br0 1 2 3
3987 set Bridge br0 mirrors=@m --\
3988 --id=@p3 get Port p3 --\
3989 --id=@m create Mirror name=mymirror select_all=true output_port=@p3
3991 AT_DATA([flows.txt], [dnl
3992 in_port=1 actions=output:2
3993 in_port=2 actions=output:1
3995 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
3997 flow="in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)"
3998 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
3999 AT_CHECK_UNQUOTED([tail -1 stdout], [0],
4000 [Datapath actions: 3,2
4003 flow="in_port(2),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)"
4004 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
4005 AT_CHECK_UNQUOTED([tail -1 stdout], [0],
4006 [Datapath actions: 3,1
4013 AT_SETUP([ofproto-dpif - mirroring, select_src])
4014 AT_KEYWORDS([mirror mirrors mirroring])
4016 add_of_ports br0 1 2 3
4018 set Bridge br0 mirrors=@m --\
4019 --id=@p1 get Port p1 -- --id=@p3 get Port p3 --\
4020 --id=@m create Mirror name=mymirror select_src_port=@p1 output_port=@p3
4022 AT_DATA([flows.txt], [dnl
4023 in_port=1 actions=output:2
4024 in_port=2 actions=output:1
4026 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
4028 flow="in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)"
4029 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
4030 AT_CHECK_UNQUOTED([tail -1 stdout], [0],
4031 [Datapath actions: 3,2
4034 flow="in_port(2),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)"
4035 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
4036 AT_CHECK_UNQUOTED([tail -1 stdout], [0],
4037 [Datapath actions: 1
4042 AT_SETUP([ofproto-dpif - mirroring, OFPP_NONE ingress port])
4043 AT_KEYWORDS([mirror mirrors mirroring])
4045 add_of_ports br0 1 2
4047 set Bridge br0 mirrors=@m --\
4048 --id=@p2 get Port p2 --\
4049 --id=@m create Mirror name=mymirror select_all=true output_port=@p2
4051 AT_CHECK([ovs-ofctl add-flow br0 action=output:1])
4053 # "in_port" defaults to OFPP_NONE if it's not specified.
4054 flow="icmp,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_ttl=128,icmp_type=8,icmp_code=0"
4055 AT_CHECK([ovs-appctl ofproto/trace br0 "$flow"], [0], [stdout])
4056 AT_CHECK_UNQUOTED([tail -1 stdout], [0],
4057 [Datapath actions: 1,2
4064 AT_SETUP([ofproto-dpif - mirroring, select_dst])
4065 AT_KEYWORDS([mirror mirrors mirroring])
4067 add_of_ports br0 1 2 3
4069 set Bridge br0 mirrors=@m --\
4070 --id=@p2 get Port p2 -- --id=@p3 get Port p3 --\
4071 --id=@m create Mirror name=mymirror select_dst_port=@p2 output_port=@p3
4073 AT_DATA([flows.txt], [dnl
4074 in_port=1 actions=output:2
4075 in_port=2 actions=output:1
4077 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
4079 flow="in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)"
4080 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
4081 AT_CHECK_UNQUOTED([tail -1 stdout], [0],
4082 [Datapath actions: 2,3
4085 flow="in_port(2),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)"
4086 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
4087 AT_CHECK_UNQUOTED([tail -1 stdout], [0],
4088 [Datapath actions: 1
4095 AT_SETUP([ofproto-dpif - mirroring, select_vlan])
4096 AT_KEYWORDS([mirror mirrors mirroring])
4098 add_of_ports br0 1 2 3
4100 set Bridge br0 mirrors=@m --\
4101 --id=@p2 get Port p2 -- --id=@p3 get Port p3 --\
4102 --id=@m create Mirror name=mymirror select_all=true select_vlan=11 output_port=@p3
4104 AT_DATA([flows.txt], [dnl
4105 in_port=1, actions=output:2
4107 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
4109 flow="in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)"
4110 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
4111 AT_CHECK_UNQUOTED([tail -1 stdout], [0],
4112 [Datapath actions: 2
4115 flow="in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x8100),vlan(vid=10,pcp=0),encap(eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0))"
4116 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
4117 AT_CHECK_UNQUOTED([tail -1 stdout], [0],
4118 [Datapath actions: 2
4121 flow="in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x8100),vlan(vid=11,pcp=0),encap(eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0))"
4122 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
4123 AT_CHECK_UNQUOTED([tail -1 stdout], [0],
4124 [Datapath actions: 3,2
4131 AT_SETUP([ofproto-dpif - mirroring, output_port])
4132 AT_KEYWORDS([mirror mirrors mirroring])
4134 add_of_ports br0 1 2 3
4136 set Bridge br0 mirrors=@m --\
4137 --id=@p3 get Port p3 --\
4138 --id=@m create Mirror name=mymirror select_all=true output_port=@p3
4140 AT_DATA([flows.txt], [dnl
4141 in_port=1 actions=mod_vlan_vid:17,output:2
4142 in_port=2 actions=output:1
4144 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
4146 flow="in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)"
4147 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
4148 AT_CHECK_UNQUOTED([tail -1 stdout], [0],
4149 [Datapath actions: 3,push_vlan(vid=17,pcp=0),2
4152 flow="in_port(2),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)"
4153 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
4154 AT_CHECK_UNQUOTED([tail -1 stdout], [0],
4155 [Datapath actions: 3,1
4161 AT_SETUP([ofproto-dpif - mirroring, output_vlan])
4162 AT_KEYWORDS([mirror mirrors mirroring])
4164 add_of_ports br0 1 2
4166 set Bridge br0 mirrors=@m --\
4167 --id=@m create Mirror name=mymirror select_all=true output_vlan=12
4169 AT_DATA([flows.txt], [dnl
4170 in_port=1 actions=output:2
4171 in_port=2 actions=mod_vlan_vid:17,output:1
4173 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
4175 flow="in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)"
4176 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
4177 actual=`tail -1 stdout | sed 's/Datapath actions: //'`
4179 expected="2,push_vlan(vid=12,pcp=0),1,2,100"
4180 AT_CHECK([ovs-dpctl normalize-actions "$flow" "$expected"], [0], [stdout])
4182 AT_CHECK([ovs-dpctl normalize-actions "$flow" "$actual"], [0], [expout])
4184 flow="in_port(2),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)"
4185 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
4186 actual=`tail -1 stdout | sed 's/Datapath actions: //'`
4188 expected="push_vlan(vid=17,pcp=0),1,pop_vlan,push_vlan(vid=12,pcp=0),1,2,100"
4189 AT_CHECK([ovs-dpctl normalize-actions "$flow" "$expected"], [0], [stdout])
4191 AT_CHECK([ovs-dpctl normalize-actions "$flow" "$actual"], [0], [expout])
4196 # This verifies that we don't get duplicate mirroring when mirror_packet()
4197 # might be invoked recursively, as a check against regression.
4198 AT_SETUP([ofproto-dpif - multiple VLAN output mirrors])
4199 AT_KEYWORDS([mirror mirrors mirroring])
4201 add_of_ports br0 1 2 3
4203 -- set Bridge br0 fail-mode=standalone mirrors=@m1,@m2 \
4204 -- --id=@m1 create Mirror name=m1 select_all=true output_vlan=500 \
4205 -- --id=@m2 create Mirror name=m2 select_all=true output_vlan=501 \
4206 -- set Port br0 tag=0 \
4207 -- set Port p1 tag=0 \
4208 -- set Port p2 tag=500 \
4209 -- set Port p3 tag=501
4212 AT_CHECK([ovs-appctl ofproto/trace br0 "$flow"], [0], [stdout])
4213 AT_CHECK([tail -1 stdout | sed 's/Datapath actions: //
4215 /g' | sort], [0], [100
4223 # This test verifies that mirror state is preserved across recirculation.
4225 # Otherwise, post-recirculation the ingress and the output to port 4
4226 # would cause the packet to be mirrored to port 3 a second time.
4227 AT_SETUP([ofproto-dpif - mirroring with recirculation])
4228 AT_KEYWORDS([mirror mirrors mirroring])
4230 add_of_ports br0 1 2 3 4
4232 set Bridge br0 mirrors=@m --\
4233 --id=@p3 get Port p3 --\
4234 --id=@m create Mirror name=mymirror select_all=true output_port=@p3
4236 AT_DATA([flows.txt], [dnl
4237 in_port=1 actions=2,debug_recirc,4
4239 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
4241 flow="in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)"
4242 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow" -generate], [0], [stdout])
4243 AT_CHECK_UNQUOTED([tail -1 stdout], [0], [Datapath actions: 3,2,recirc(0x1)
4245 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow,recirc_id(1)" -generate], [0], [stdout])
4246 AT_CHECK_UNQUOTED([tail -1 stdout], [0], [Datapath actions: 4
4252 # Tests below verify the snaplen support for mirroring
4253 AT_SETUP([ofproto-dpif - mirroring, select_all with snaplen])
4254 AT_KEYWORDS([mirror mirrors mirroring])
4256 add_of_ports br0 1 2 3
4258 set Bridge br0 mirrors=@m --\
4259 --id=@p3 get Port p3 --\
4260 --id=@m create Mirror name=mymirror select_all=true output_port=@p3 snaplen=100
4262 AT_DATA([flows.txt], [dnl
4263 in_port=1 actions=output:2
4264 in_port=2 actions=output:1
4266 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
4268 flow="in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)"
4269 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
4270 AT_CHECK_UNQUOTED([tail -1 stdout], [0],
4271 [Datapath actions: trunc(100),3,2
4274 flow="in_port(2),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)"
4275 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
4276 AT_CHECK_UNQUOTED([tail -1 stdout], [0],
4277 [Datapath actions: trunc(100),3,1
4283 AT_SETUP([ofproto-dpif - mirroring, select_src with snaplen])
4284 AT_KEYWORDS([mirror mirrors mirroring])
4286 add_of_ports br0 1 2 3
4288 set Bridge br0 mirrors=@m --\
4289 --id=@p1 get Port p1 -- --id=@p3 get Port p3 --\
4290 --id=@m create Mirror name=mymirror select_src_port=@p1 output_port=@p3 snaplen=100
4292 AT_DATA([flows.txt], [dnl
4293 in_port=1 actions=output:2
4294 in_port=2 actions=output:1
4296 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
4298 flow="in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)"
4299 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
4300 AT_CHECK_UNQUOTED([tail -1 stdout], [0],
4301 [Datapath actions: trunc(100),3,2
4304 flow="in_port(2),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)"
4305 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
4306 AT_CHECK_UNQUOTED([tail -1 stdout], [0],
4307 [Datapath actions: 1
4312 AT_SETUP([ofproto-dpif - mirroring, OFPP_NONE ingress port with snaplen])
4313 AT_KEYWORDS([mirror mirrors mirroring])
4315 add_of_ports br0 1 2
4317 set Bridge br0 mirrors=@m --\
4318 --id=@p2 get Port p2 --\
4319 --id=@m create Mirror name=mymirror select_all=true output_port=@p2 snaplen=100
4321 AT_CHECK([ovs-ofctl add-flow br0 action=output:1])
4323 # "in_port" defaults to OFPP_NONE if it's not specified.
4324 flow="icmp,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_ttl=128,icmp_type=8,icmp_code=0"
4325 AT_CHECK([ovs-appctl ofproto/trace br0 "$flow"], [0], [stdout])
4326 AT_CHECK_UNQUOTED([tail -1 stdout], [0],
4327 [Datapath actions: 1,trunc(100),2
4333 AT_SETUP([ofproto-dpif - mirroring, select_dst with snaplen])
4334 AT_KEYWORDS([mirror mirrors mirroring])
4336 add_of_ports br0 1 2 3
4338 set Bridge br0 mirrors=@m --\
4339 --id=@p2 get Port p2 -- --id=@p3 get Port p3 --\
4340 --id=@m create Mirror name=mymirror select_dst_port=@p2 output_port=@p3 snaplen=100
4342 AT_DATA([flows.txt], [dnl
4343 in_port=1 actions=output:2
4344 in_port=2 actions=output:1
4346 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
4348 flow="in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)"
4349 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
4350 AT_CHECK_UNQUOTED([tail -1 stdout], [0],
4351 [Datapath actions: 2,trunc(100),3
4354 flow="in_port(2),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)"
4355 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
4356 AT_CHECK_UNQUOTED([tail -1 stdout], [0],
4357 [Datapath actions: 1
4363 AT_SETUP([ofproto-dpif - mirroring, select_vlan with snaplen])
4364 AT_KEYWORDS([mirror mirrors mirroring])
4366 add_of_ports br0 1 2 3
4368 set Bridge br0 mirrors=@m --\
4369 --id=@p2 get Port p2 -- --id=@p3 get Port p3 --\
4370 --id=@m create Mirror name=mymirror select_all=true select_vlan=11 output_port=@p3 snaplen=100
4372 AT_DATA([flows.txt], [dnl
4373 in_port=1, actions=output:2
4375 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
4377 flow="in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)"
4378 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
4379 AT_CHECK_UNQUOTED([tail -1 stdout], [0],
4380 [Datapath actions: 2
4383 flow="in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x8100),vlan(vid=10,pcp=0),encap(eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0))"
4384 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
4385 AT_CHECK_UNQUOTED([tail -1 stdout], [0],
4386 [Datapath actions: 2
4389 flow="in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x8100),vlan(vid=11,pcp=0),encap(eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0))"
4390 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
4391 AT_CHECK_UNQUOTED([tail -1 stdout], [0],
4392 [Datapath actions: trunc(100),3,2
4398 AT_SETUP([ofproto-dpif - mirroring, output_port with snaplen])
4399 AT_KEYWORDS([mirror mirrors mirroring])
4401 add_of_ports br0 1 2 3
4403 set Bridge br0 mirrors=@m --\
4404 --id=@p3 get Port p3 --\
4405 --id=@m create Mirror name=mymirror select_all=true output_port=@p3 snaplen=100
4407 AT_DATA([flows.txt], [dnl
4408 in_port=1 actions=mod_vlan_vid:17,output:2
4409 in_port=2 actions=output:1
4411 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
4413 flow="in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)"
4414 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
4415 AT_CHECK_UNQUOTED([tail -1 stdout], [0],
4416 [Datapath actions: trunc(100),3,push_vlan(vid=17,pcp=0),2
4419 flow="in_port(2),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)"
4420 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
4421 AT_CHECK_UNQUOTED([tail -1 stdout], [0],
4422 [Datapath actions: trunc(100),3,1
4428 AT_SETUP([ofproto-dpif - mirroring, output_vlan with snaplen])
4429 AT_KEYWORDS([mirror mirrors mirroring])
4431 add_of_ports br0 1 2
4433 set Bridge br0 mirrors=@m --\
4434 --id=@m create Mirror name=mymirror select_all=true output_vlan=12 snaplen=100
4436 AT_DATA([flows.txt], [dnl
4437 in_port=1 actions=output:2
4438 in_port=2 actions=mod_vlan_vid:17,output:1
4440 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
4442 flow="in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)"
4443 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
4444 actual=`tail -1 stdout | sed 's/Datapath actions: //'`
4445 dnl Expect: "trunc(100),100,trunc(100),2,trunc(100),1", with different order
4446 AT_CHECK([echo "$actual" | sed -n 's/.*\(trunc([0-9]*),[0-9]*,trunc([0-9]*),[0-9]*,trunc([0-9]*),[0-9]*\)/\1/p'], [0])
4448 flow="in_port(2),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)"
4449 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
4450 actual=`tail -1 stdout | sed 's/Datapath actions: //'`
4451 AT_CHECK([echo "$actual" | sed -n 's/.*\(trunc([0-9]*),[0-9]*,trunc([0-9]*),[0-9]*,trunc([0-9]*),[0-9]*\)/\1/p'], [0])
4456 AT_SETUP([ofproto-dpif - multiple VLAN output mirrors with snaplen])
4457 AT_KEYWORDS([mirror mirrors mirroring])
4459 add_of_ports br0 1 2 3
4461 -- set Bridge br0 fail-mode=standalone mirrors=@m1,@m2 \
4462 -- --id=@m1 create Mirror name=m1 select_all=true output_vlan=500 snaplen=200 \
4463 -- --id=@m2 create Mirror name=m2 select_all=true output_vlan=501 snaplen=300 \
4464 -- set Port br0 tag=0 \
4465 -- set Port p1 tag=0 \
4466 -- set Port p2 tag=500 \
4467 -- set Port p3 tag=501
4470 AT_CHECK([ovs-appctl ofproto/trace br0 "$flow"], [0], [stdout])
4471 AT_CHECK([tail -1 stdout | egrep "trunc\(200\),2,trunc\(300\),3,100|trunc\(300\),3,trunc\(200\),2,100"], [0], [stdout])
4476 # This test verifies that the table ID is preserved across recirculation
4477 # when a resubmit action requires it (because the action is relative to
4478 # the current table rather than specifying a table).
4479 AT_SETUP([ofproto-dpif - resubmit with recirculation])
4481 add_of_ports br0 1 2 3
4483 AT_DATA([flows.txt], [dnl
4484 table=0 in_port=1 actions=2,resubmit(,1)
4485 table=1 in_port=1 actions=debug_recirc,resubmit:55
4486 table=1 in_port=55 actions=3
4488 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
4490 flow="in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)"
4491 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow" -generate], [0], [stdout])
4492 AT_CHECK_UNQUOTED([tail -1 stdout], [0], [Datapath actions: 2,recirc(0x1)
4494 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow,recirc_id(1)" -generate], [0], [stdout])
4495 AT_CHECK_UNQUOTED([tail -1 stdout], [0], [Datapath actions: 3
4501 # This test verifies that "resubmit", when it triggers recirculation
4502 # indirectly through the flow that it recursively invokes, is not
4503 # re-executed when execution continues later post-recirculation.
4504 AT_SETUP([ofproto-dpif - recirculation after resubmit])
4506 add_of_ports br0 1 2
4508 AT_DATA([flows.txt], [dnl
4509 table=0 in_port=1 actions=resubmit(,1),2
4510 table=1 in_port=1 actions=debug_recirc
4512 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
4514 flow="in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)"
4515 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow" -generate], [0], [stdout])
4516 AT_CHECK_UNQUOTED([tail -1 stdout], [0], [Datapath actions: recirc(0x1)
4518 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow,recirc_id(1)" -generate], [0], [stdout])
4519 AT_CHECK_UNQUOTED([tail -1 stdout], [0], [Datapath actions: 2
4525 dnl CHECK_CONTINUATION(TITLE, N_PORTS0, N_PORTS1, ACTIONS0, ACTIONS1, [EXTRA_SETUP])
4527 dnl Checks the implementation of the continuation mechanism that allows the
4528 dnl packet processing pipeline to be paused and resumed. Starts by creating
4529 dnl bridge br0 with N_PORTS0 ports numbered 1 through N_PORTS0, and adds the
4530 dnl flows listed in ACTIONS0 to that bridge. Then, injects a packet at port 1
4531 dnl in the bridge, resuming each time the pipeline pauses, and expects a single
4532 dnl packet to be output at each port 2 through N_PORTS0. Then, as long as
4533 dnl ACTIONS0 still contains at least one "pause" action, removes one of them
4534 dnl and repeats the process.
4536 dnl If N_PORTS1 is nonzero, also creates a bridge br1 and adds ports numbered
4537 dnl N_PORTS0 + 1 to N_PORTS0 + N_PORTS1 to it, as well as flows ACTIONS1.
4538 dnl ACTIONS1 may also contain "pause" actions. Packets are only ever injected
4539 dnl into port 1 on br0, so br1 only comes into action if a patch port (added
4540 dnl by EXTRA_SETUP) jumps from one bridge to another.
4542 dnl EXTRA_SETUP is an optional list of extra commands to run after setting up
4543 dnl both bridges, e.g. to configure mirrors or patch ports.
4544 m4_define([CHECK_CONTINUATION], [dnl
4545 AT_SETUP([ofproto-dpif - continuation - $1])
4546 AT_KEYWORDS([continuations pause resume])
4549 # count_matches STRING
4551 # Prints on stdout the number of occurrences of STRING in stdin.
4558 add_of_ports --pcap br0 `seq 1 $2`
4559 m4_if([$3], [0], [],
4561 add_of_ports --pcap br1 `seq m4_eval([$2 + 1]) m4_eval([$2 + $3])`])
4563 AT_CAPTURE_FILE([ofctl_monitor0.log])
4564 AT_CHECK([ovs-ofctl monitor br0 resume --detach --no-chdir --pidfile=ovs-ofctl0.pid 2> ofctl_monitor0.log])
4565 m4_if([$3], [0], [],
4566 [AT_CAPTURE_FILE([ofctl_monitor1.log])
4567 AT_CHECK([ovs-ofctl monitor br1 resume --detach --no-chdir --pidfile=ovs-ofctl1.pid 2> ofctl_monitor1.log])])
4572 flow="in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)"
4576 printf "\n\nactions for br0:\n%s\n" "$actions0"
4577 m4_if([$3], [0], [], [printf "actions for br1:\n%s\n" "$actions1"])
4580 AT_CHECK([echo "$actions0" | sed 's/pause/controller(pause)/g' | ovs-ofctl -O OpenFlow13 add-flows br0 -])
4581 m4_if([$3], [0], [],
4582 [AT_CHECK([echo "$actions1" | sed 's/pause/controller(pause)/g' | ovs-ofctl -O OpenFlow13 add-flows br1 -])])
4584 # Run a packet through the switch.
4585 AT_CHECK([ovs-appctl netdev-dummy/receive p1 "$flow"], [0], [stdout])
4587 # Wait for the expected number of packets to show up.
4588 n_packets=`expr $n_packets + $2 - 1 + $3`
4589 echo "waiting for $n_packets packets..."
4590 OVS_WAIT_UNTIL([test $n_packets = `ovs-ofctl parse-pcap p*-tx.pcap | wc -l`])
4592 # Wait for the expected number of NXT_RESUMEs to be logged.
4593 n_resumes=$(expr $n_resumes + $(echo "$actions0 $actions1" | count_matches pause) )
4594 echo "waiting for $n_resumes NXT_RESUMEs..."
4595 OVS_WAIT_UNTIL([test $n_resumes = `cat ofctl_monitor*.log | grep -c NXT_RESUME`])
4597 # Eliminate one "pause" from the actions.
4599 # If there were none left, then we're done.
4600 next_actions0=`echo "$actions0" | sed '1,/pause/s/pause//'`
4601 if test X"$actions0" = X"$next_actions0"; then
4602 next_actions1=`echo "$actions1" | sed '1,/pause/s/pause//'`
4603 if test X"$actions1" = X"$next_actions1"; then
4606 actions1=$next_actions1
4609 actions0=$next_actions0
4612 # Delete all the flows and verify that there are none, so that we
4613 # can be sure that our updated flow tables is actually in use
4615 AT_CHECK([ovs-ofctl del-flows br0 && ovs-ofctl dump-flows br0 | strip_xids], [0],
4618 m4_if([$3], [0], [],
4619 [AT_CHECK([ovs-ofctl del-flows br1 && ovs-ofctl dump-flows br1 | strip_xids], [0],
4627 # Check that pause at the end of the pipeline works OK.
4629 # (xlate_continuation() has a special case for no-op actions; this
4630 # fails without that special case.)
4631 CHECK_CONTINUATION([pause at end of pipeline], [2], [0], [actions=2 pause])
4633 # Check that remaining actions are preserved following resume.
4634 CHECK_CONTINUATION([actions], [7], [0],
4635 [in_port=1 actions=pause 2 pause 3 pause 4 pause 5 pause 6 pause 7])
4637 # Check that multiple levels of resubmit continue following resume.
4639 # The "resubmit:55", which is relative to the current table, is
4640 # particularly interesting because it checks that the notion of the
4641 # current table is correctly preserved.
4642 CHECK_CONTINUATION([resubmit], [10], [0],
4643 [table=0 in_port=1 actions=pause 2 pause resubmit(,1) pause 10 pause
4644 table=1 in_port=1 actions=pause 3 pause resubmit(,2) pause 9 pause
4645 table=2 in_port=1 actions=pause 4 pause resubmit(,3) pause 8 pause
4646 table=3 in_port=1 actions=pause 5 pause resubmit:55 pause 7 pause
4647 table=3 in_port=55 actions=pause 6 pause])
4649 # Check that the action set is preserved across pause/resume.
4650 CHECK_CONTINUATION([action set], [3], [0],
4651 [in_port=1 actions=1 pause resubmit(,1) pause 2
4652 table=1 actions=write_actions(3)])
4654 # Check that metadata and the stack used by push and pop is preserved
4655 # across pause/resume.
4656 CHECK_CONTINUATION([data stack], [3], [0],
4657 [in_port=1 actions=pause dnl
4658 set_field:1->reg0 dnl
4660 set_field:2->reg1 dnl
4662 output:NXM_NX_REG0[[]] dnl
4664 push:NXM_NX_REG1[[]] dnl
4666 pop:NXM_NX_REG2[[]] dnl
4668 output:NXM_NX_REG2[[]] dnl
4672 # Check that mirror output occurs once and once only, even if
4673 # separated by pause/resume.
4674 CHECK_CONTINUATION([mirroring], [5], [0],
4675 [in_port=1 actions=pause 2 pause 3 pause 4 pause], [],
4677 set Bridge br0 mirrors=@m --\
4678 --id=@p2 get Port p2 --\
4679 --id=@p3 get Port p3 --\
4680 --id=@p4 get Port p4 --\
4681 --id=@p5 get Port p5 --\
4682 --id=@m create Mirror name=mymirror select_dst_port=@p2,@p3,@p4 output_port=@p5])
4684 # Check that pause works in the presence of patch ports.
4685 CHECK_CONTINUATION([patch ports], [4], [1],
4686 [table=0 in_port=1 actions=pause 2 resubmit(,1) pause 4
4687 table=1 in_port=1 actions=pause 3 pause 10 pause],
4688 [table=0 in_port=11 actions=pause 5 pause],
4690 -- add-port br0 patch10 \
4691 -- set interface patch10 type=patch options:peer=patch11 \
4693 -- add-port br1 patch11 \
4694 -- set interface patch11 type=patch options:peer=patch10 \
4697 # Two testcases below are for the ofproto/trace command
4698 # The first one tests all correct syntax:
4699 # ofproto/trace [dp_name] odp_flow [-generate|packet]
4700 # ofproto/trace br_name br_flow [-generate|packet]
4701 AT_SETUP([ofproto-dpif - ofproto/trace command 1])
4702 OVS_VSWITCHD_START([set bridge br0 fail-mode=standalone])
4703 add_of_ports br0 1 2 3
4705 AT_DATA([flows.txt], [dnl
4706 in_port=1 actions=output:2
4707 in_port=2 actions=output:1
4709 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
4711 odp_flow="in_port(p1)"
4713 # Test command: ofproto/trace odp_flow with in_port as a name.
4714 AT_CHECK([ovs-appctl ofproto/trace "$odp_flow"], [0], [stdout])
4715 AT_CHECK([tail -1 stdout], [0], [dnl
4719 odp_flow="in_port(1)"
4720 # Test command: ofproto/trace odp_flow
4721 AT_CHECK([ovs-appctl ofproto/trace "$odp_flow"], [0], [stdout])
4722 AT_CHECK([tail -1 stdout], [0], [dnl
4726 # Test command: ofproto/trace dp_name odp_flow
4727 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$odp_flow"], [0], [stdout])
4728 AT_CHECK([tail -1 stdout], [0], [dnl
4731 # Test commmand: ofproto/trace br_name br_flow
4732 AT_CHECK([ovs-appctl ofproto/trace br0 "$br_flow"], [0], [stdout])
4733 AT_CHECK([tail -1 stdout], [0], [dnl
4737 # Delete the inserted flows
4738 AT_CHECK([ovs-ofctl del-flows br0 "in_port=1"], [0], [stdout])
4739 AT_CHECK([ovs-ofctl del-flows br0 "in_port=2"], [0], [stdout])
4741 # This section below tests the [-generate] option
4742 odp_flow="in_port(3),eth(src=50:54:00:00:00:05,dst=ff:ff:ff:ff:ff:ff)"
4743 br_flow="arp,in_port=3,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=ff:ff:ff:ff:ff:ff"
4745 # Test command: ofproto/trace odp_flow
4746 AT_CHECK([ovs-appctl ofproto/trace "$odp_flow"], [0], [stdout])
4747 # Check for no MAC learning entry
4748 AT_CHECK_UNQUOTED([ovs-appctl fdb/show br0 | sed 's/[[0-9]]\{1,\}$/?/'], [0], [dnl
4752 # Test command: ofproto/trace br_name br_flow
4753 AT_CHECK([ovs-appctl ofproto/trace br0 "$br_flow"], [0], [stdout])
4754 # Check for no MAC learning entry
4755 AT_CHECK_UNQUOTED([ovs-appctl fdb/show br0 | sed 's/[[0-9]]\{1,\}$/?/'], [0], [dnl
4759 # Test command: ofproto/trace odp_flow -generate
4760 AT_CHECK([ovs-appctl ofproto/trace "$odp_flow" -generate], [0], [stdout])
4761 # Check for the MAC learning entry
4762 AT_CHECK_UNQUOTED([ovs-appctl fdb/show br0 | sed 's/[[0-9]]\{1,\}$/?/'], [0], [dnl
4764 3 0 50:54:00:00:00:05 ?
4767 # Test command: ofproto/trace dp_name odp_flow -generate
4768 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy \
4769 "in_port(1),eth(src=50:54:00:00:00:06,dst=50:54:00:00:00:05)" \
4770 -generate], [0], [stdout])
4771 # Check for both MAC learning entries
4772 AT_CHECK_UNQUOTED([ovs-appctl fdb/show br0 | sed 's/[[0-9]]\{1,\}$/?/'], [0], [dnl
4774 3 0 50:54:00:00:00:05 ?
4775 1 0 50:54:00:00:00:06 ?
4778 # Test command: ofproto/trace br_name br_flow -generate
4779 AT_CHECK([ovs-appctl ofproto/trace br0 \
4780 "in_port=2,dl_src=50:54:00:00:00:07,dl_dst=50:54:00:00:00:06" \
4781 -generate], [0], [stdout])
4782 # Check for both MAC learning entries.
4783 AT_CHECK_UNQUOTED([ovs-appctl fdb/show br0 | sed 's/[[0-9]]\{1,\}$/?/'], [0], [dnl
4785 3 0 50:54:00:00:00:05 ?
4786 1 0 50:54:00:00:00:06 ?
4787 2 0 50:54:00:00:00:07 ?
4790 # This section beflow tests the [packet] option
4791 # The ovs-tcpundump of packets between port1 and port2
4792 pkt1to2="50540000000250540000000108064500001C000100004001F98CC0A80001C0A800020800F7FF00000000"
4793 pkt2to1="50540000000150540000000208064500001C000100004001F98CC0A80002C0A800010800F7FF00000000"
4795 # Construct the MAC learning table
4796 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy \
4797 "in_port(1),eth(src=50:54:00:00:00:01,dst=ff:ff:ff:ff:ff:ff)" \
4798 -generate], [0], [stdout])
4800 # Construct the MAC learning table
4801 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy \
4802 "in_port(2),eth(src=50:54:00:00:00:02,dst=ff:ff:ff:ff:ff:ff)" \
4803 -generate], [0], [stdout])
4805 # Test command: ofproto/trace odp_flow packet
4806 AT_CHECK([ovs-appctl ofproto/trace \
4807 "in_port(1),skb_priority(1),skb_mark(2)" "$pkt1to2"], [0], [stdout])
4808 AT_CHECK([tail -1 stdout], [0], [dnl
4811 AT_CHECK([head -n 2 stdout], [0], [dnl
4813 Flow: pkt_mark=0x2,skb_priority=0x1,arp,in_port=1,vlan_tci=0x0000,dl_src=50:54:00:00:00:01,dl_dst=50:54:00:00:00:02,arp_spa=0.0.0.0,arp_tpa=0.0.0.0,arp_op=0,arp_sha=00:00:00:00:00:00,arp_tha=00:00:00:00:00:00
4816 # Test command: ofproto/trace dp_name odp_flow packet
4817 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy \
4818 "in_port(1),skb_priority(1),skb_mark(2)" "$pkt1to2"], [0], [stdout])
4819 AT_CHECK([tail -1 stdout], [0], [dnl
4822 AT_CHECK([head -n 2 stdout], [0], [dnl
4824 Flow: pkt_mark=0x2,skb_priority=0x1,arp,in_port=1,vlan_tci=0x0000,dl_src=50:54:00:00:00:01,dl_dst=50:54:00:00:00:02,arp_spa=0.0.0.0,arp_tpa=0.0.0.0,arp_op=0,arp_sha=00:00:00:00:00:00,arp_tha=00:00:00:00:00:00
4827 # Test command: ofproto/trace br_name br_flow packet
4828 AT_CHECK([ovs-appctl ofproto/trace br0 \
4829 "in_port=2,skb_priority=2,pkt_mark=1" "$pkt2to1"], [0], [stdout],[stderr])
4830 AT_CHECK([tail -1 stdout], [0], [dnl
4833 AT_CHECK([head -n 2 stdout], [0], [dnl
4835 Flow: pkt_mark=0x1,skb_priority=0x2,arp,in_port=2,vlan_tci=0x0000,dl_src=50:54:00:00:00:02,dl_dst=50:54:00:00:00:01,arp_spa=0.0.0.0,arp_tpa=0.0.0.0,arp_op=0,arp_sha=00:00:00:00:00:00,arp_tha=00:00:00:00:00:00
4841 # The second test tests the corner cases
4842 AT_SETUP([ofproto-dpif - ofproto/trace command 2])
4844 add_of_ports br0 1 2
4847 odp_flow="in_port(1),eth(src=50:54:00:00:00:01,dst=50:54:00:00:00:02)"
4848 br_flow="in_port=1,dl_src=50:54:00:00:00:01,dl_dst=50:54:00:00:00:02"
4850 generate="-generate"
4851 pkt="50540000000250540000000108064500001C000100004001F98CC0A80001C0A800020800F7FF00000000"
4853 # Test incorrect command: ofproto/trace wrong_name odp_flow [-generate|packet]
4859 [AT_CHECK([ovs-appctl ofproto/trace wrong_name "$odp_flow" option],
4861 AT_CHECK([tail -2 stderr], [0], [dnl
4862 Cannot find the datapath
4863 ovs-appctl: ovs-vswitchd: server returned an error
4866 # Test incorrect command: ofproto/trace empty_string odp_flow [-generate|packet]
4872 [AT_CHECK([ovs-appctl ofproto/trace "" "$odp_flow" option],
4874 AT_CHECK([tail -2 stderr], [0], [dnl
4875 Cannot find the datapath
4876 ovs-appctl: ovs-vswitchd: server returned an error
4879 # Test incorrect command: ofproto/trace nonexist_dp_name odp_flow [-generate|packet]
4885 [AT_CHECK([ovs-appctl ofproto/trace ovs-system "$odp_flow" option],
4887 AT_CHECK([tail -2 stderr], [0], [dnl
4888 Cannot find the datapath
4889 ovs-appctl: ovs-vswitchd: server returned an error
4892 # Test incorrect command: ofproto/trace br_name odp_flow [-generate|packet]
4898 [AT_CHECK([ovs-appctl ofproto/trace br0 "$odp_flow" option],
4900 AT_CHECK([tail -2 stderr], [0], [dnl
4901 Cannot find the datapath
4902 ovs-appctl: ovs-vswitchd: server returned an error
4905 # Test incorrect command: ofproto/trace dp_name br_flow [-generate|packet]
4911 [AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$br_flow" option],
4913 AT_CHECK([tail -2 stderr], [0], [dnl
4915 ovs-appctl: ovs-vswitchd: server returned an error
4918 # Test incorrect command: ofproto/trace br_flow [-generate|packet]
4924 [AT_CHECK([ovs-appctl ofproto/trace "$br_flow" option],
4926 AT_CHECK([tail -2 stderr], [0], [dnl
4927 Must specify bridge name
4928 ovs-appctl: ovs-vswitchd: server returned an error
4931 # Test incorrect command: ofproto/trace dp_name odp_flow garbage_option
4932 AT_CHECK([ovs-appctl ofproto/trace \
4933 ovs-dummy "$odp_flow" garbage_option],
4934 [2], [stdout],[stderr])
4935 AT_CHECK([tail -2 stderr], [0], [dnl
4936 Trailing garbage in packet data
4937 ovs-appctl: ovs-vswitchd: server returned an error
4940 # Test incorrect command: ofproto/trace with 4 arguments
4941 AT_CHECK([ovs-appctl ofproto/trace \
4942 arg1, arg2, arg3, arg4], [2], [stdout],[stderr])
4943 AT_CHECK([tail -2 stderr], [0], [dnl
4944 "ofproto/trace" command takes at most 3 arguments
4945 ovs-appctl: ovs-vswitchd: server returned an error
4948 # Test incorrect command: ofproto/trace with 0 argument
4949 AT_CHECK([ovs-appctl ofproto/trace ], [2], [stdout],[stderr])
4950 AT_CHECK([tail -2 stderr], [0], [dnl
4951 "ofproto/trace" command requires at least 1 arguments
4952 ovs-appctl: ovs-vswitchd: server returned an error
4958 # The third test checks that the output of "ovs-dpctl -m" is valid to trace.
4959 AT_SETUP([ofproto-dpif - ofproto/trace from dpctl output])
4960 OVS_VSWITCHD_START([dnl
4961 set Open_vSwitch . other_config:max-idle=10000 \
4962 -- add-port br0 p1 -- set Interface p1 type=dummy])
4964 AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
4965 ovs-appctl revalidator/wait
4966 AT_CHECK([ovs-appctl dpif/dump-flows -m br0 | sed 's/, packets.*$//' > dp_flows1.txt])
4968 odp_flow=`cat dp_flows1.txt`
4969 AT_CHECK([ovs-appctl ofproto/trace "$odp_flow" | sed 's/\([[Ff]]low:\).*/\1 <cleared>/'], [0], [dnl
4972 No match, packets dropped because OFPPC_NO_PACKET_IN is set on in_port.
4974 Rule: table=254 cookie=0 priority=0,reg0=0x2
4975 OpenFlow actions=drop
4977 Final flow: <cleared>
4979 Datapath actions: drop
4982 dnl Now, try again without megaflows:
4983 ovs-appctl upcall/disable-megaflows
4985 AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
4986 ovs-appctl revalidator/wait
4987 AT_CHECK([ovs-appctl dpif/dump-flows -m br0 | sed 's/, packets.*$//' > dp_flows2.txt])
4989 odp_flow=`cat dp_flows2.txt`
4990 AT_CHECK([ovs-appctl ofproto/trace "$odp_flow" | sed 's/\([[Ff]]low:\).*/\1 <cleared>/'], [0], [dnl
4993 No match, packets dropped because OFPPC_NO_PACKET_IN is set on in_port.
4995 Rule: table=254 cookie=0 priority=0,reg0=0x2
4996 OpenFlow actions=drop
4998 Final flow: <cleared>
5000 Datapath actions: drop
5006 AT_SETUP([ofproto-dpif - ofproto/trace-packet-out])
5008 add_of_ports br0 1 2 3
5010 AT_DATA([flows.txt], [dnl
5011 in_port=1 actions=output:2
5012 in_port=2 actions=output:1
5014 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
5016 AT_CHECK([ovs-appctl ofproto/trace-packet-out br0 in_port=1 'mod_vlan_vid:123,resubmit(,0)'], [0], [stdout])
5017 AT_CHECK([tail -1 stdout], [0], [dnl
5018 Datapath actions: push_vlan(vid=123,pcp=0),2
5025 m4_define([OFPROTO_TRACE],
5027 AT_CHECK([ovs-appctl ofproto/trace $1 "$flow" $3], [0], [stdout])
5028 actual=`tail -1 stdout | sed 's/Datapath actions: //'`
5030 AT_CHECK([ovs-dpctl normalize-actions "$flow" "$expected" $5],
5033 AT_CHECK([ovs-dpctl normalize-actions "$flow" "$actual" $5],
5036 AT_SETUP([ofproto-dpif - MAC learning])
5037 OVS_VSWITCHD_START([set bridge br0 fail-mode=standalone])
5038 add_of_ports br0 1 2 3
5040 arp='eth_type(0x0806),arp(sip=192.168.0.1,tip=192.168.0.2,op=1,sha=50:54:00:00:00:05,tha=00:00:00:00:00:00)'
5042 # Trace an ARP packet arriving on p3, to create a MAC learning entry.
5045 [in_port(3),eth(src=50:54:00:00:00:05,dst=ff:ff:ff:ff:ff:ff),$arp],
5049 # Check for the MAC learning entry.
5050 AT_CHECK_UNQUOTED([ovs-appctl fdb/show br0 | sed 's/[[0-9]]\{1,\}$/?/'], [0], [dnl
5052 3 0 50:54:00:00:00:05 ?
5055 # Trace a packet arrival destined for the learned MAC.
5056 # (This will also learn a MAC.)
5059 [in_port(1),eth(src=50:54:00:00:00:06,dst=50:54:00:00:00:05),$arp],
5063 # Check for both MAC learning entries.
5064 AT_CHECK_UNQUOTED([ovs-appctl fdb/show br0 | sed 's/[[0-9]]\{1,\}$/?/'], [0], [dnl
5066 3 0 50:54:00:00:00:05 ?
5067 1 0 50:54:00:00:00:06 ?
5070 # Trace a packet arrival that updates the first learned MAC entry.
5073 [in_port(2),eth(src=50:54:00:00:00:05,dst=ff:ff:ff:ff:ff:ff),$arp],
5077 # Check that the MAC learning entry was updated.
5078 AT_CHECK_UNQUOTED([ovs-appctl fdb/show br0 | sed 's/[[0-9]]\{1,\}$/?/'], [0], [dnl
5080 1 0 50:54:00:00:00:06 ?
5081 2 0 50:54:00:00:00:05 ?
5084 # Add another bridge.
5088 -- set bridge br1 datapath-type=dummy])
5089 add_of_ports br1 4 5
5091 # Trace some packet arrivals in br1 to create MAC learning entries there too.
5094 [in_port(4),eth(src=50:54:00:00:00:06,dst=ff:ff:ff:ff:ff:ff),$arp],
5099 [in_port(5),eth(src=50:54:00:00:00:07,dst=ff:ff:ff:ff:ff:ff),$arp],
5103 # Check that the MAC learning entries were added.
5104 AT_CHECK_UNQUOTED([ovs-appctl fdb/show br1 | sed 's/[[0-9]]\{1,\}$/?/'], [0], [dnl
5106 4 0 50:54:00:00:00:06 ?
5107 5 0 50:54:00:00:00:07 ?
5110 # Delete port p1 and see that its MAC learning entry disappeared, and
5111 # that the MAC learning entry for the same MAC was also deleted from br1.
5112 AT_CHECK([ovs-vsctl del-port p1])
5113 AT_CHECK_UNQUOTED([ovs-appctl fdb/show br0 | sed 's/[[0-9]]\{1,\}$/?/'], [0], [dnl
5115 2 0 50:54:00:00:00:05 ?
5117 AT_CHECK_UNQUOTED([ovs-appctl fdb/show br1 | sed 's/[[0-9]]\{1,\}$/?/'], [0], [dnl
5119 5 0 50:54:00:00:00:07 ?
5125 AT_SETUP([ofproto-dpif - MAC table overflow])
5127 [set bridge br0 fail-mode=standalone other-config:mac-table-size=10])
5128 add_of_ports br0 1 2 3
5130 arp='eth_type(0x0806),arp(sip=192.168.0.1,tip=192.168.0.2,op=1,sha=50:54:00:00:00:05,tha=00:00:00:00:00:00)'
5132 AT_CHECK([ovs-appctl time/stop])
5134 # Trace 10 ARP packets arriving on p3, to create MAC learning entries.
5135 for i in 0 1 2 3 4 5 6 7 8 9; do
5138 [in_port(3),eth(src=50:54:00:00:00:0$i,dst=ff:ff:ff:ff:ff:ff),$arp],
5141 ovs-appctl time/warp 1000
5144 # Check for the MAC learning entries.
5145 AT_CHECK_UNQUOTED([ovs-appctl fdb/show br0 | sed 's/ *[[0-9]]\{1,\}$//' | sort],
5147 3 0 50:54:00:00:00:00
5148 3 0 50:54:00:00:00:01
5149 3 0 50:54:00:00:00:02
5150 3 0 50:54:00:00:00:03
5151 3 0 50:54:00:00:00:04
5152 3 0 50:54:00:00:00:05
5153 3 0 50:54:00:00:00:06
5154 3 0 50:54:00:00:00:07
5155 3 0 50:54:00:00:00:08
5156 3 0 50:54:00:00:00:09
5160 # Trace another ARP packet on another MAC.
5163 [in_port(3),eth(src=50:54:00:00:00:10,dst=ff:ff:ff:ff:ff:ff),$arp],
5167 # Check that the new one chased the oldest one out of the table.
5168 AT_CHECK_UNQUOTED([ovs-appctl fdb/show br0 | sed 's/[[0-9]]\{1,\}$/?/' | sort],
5170 3 0 50:54:00:00:00:01 ?
5171 3 0 50:54:00:00:00:02 ?
5172 3 0 50:54:00:00:00:03 ?
5173 3 0 50:54:00:00:00:04 ?
5174 3 0 50:54:00:00:00:05 ?
5175 3 0 50:54:00:00:00:06 ?
5176 3 0 50:54:00:00:00:07 ?
5177 3 0 50:54:00:00:00:08 ?
5178 3 0 50:54:00:00:00:09 ?
5179 3 0 50:54:00:00:00:10 ?
5185 AT_SETUP([ofproto-dpif - MAC table overflow fairness])
5187 [set bridge br0 fail-mode=standalone other-config:mac-table-size=10])
5188 add_of_ports br0 1 2 3 4 5 6
5190 arp='eth_type(0x0806),arp(sip=192.168.0.1,tip=192.168.0.2,op=1,sha=50:54:00:00:00:05,tha=00:00:00:00:00:00)'
5192 AT_CHECK([ovs-appctl time/stop])
5194 # Trace packets with 2 different source MACs arriving on each of the 5
5195 # ports, filling up the 10-entry learning table.
5196 for i in 0 1 2 3 4 5 6 7 8 9; do
5198 ovs-appctl ofproto/trace ovs-dummy "in_port($p),eth(src=50:54:00:00:00:0$i,dst=ff:ff:ff:ff:ff:ff),$arp" -generate
5199 ovs-appctl time/warp 1000
5202 # Check for the MAC learning entries.
5203 AT_CHECK_UNQUOTED([ovs-appctl fdb/show br0 | sed 's/ *[[0-9]]\{1,\}$//' | sort],
5205 1 0 50:54:00:00:00:00
5206 1 0 50:54:00:00:00:01
5207 2 0 50:54:00:00:00:02
5208 2 0 50:54:00:00:00:03
5209 3 0 50:54:00:00:00:04
5210 3 0 50:54:00:00:00:05
5211 4 0 50:54:00:00:00:06
5212 4 0 50:54:00:00:00:07
5213 5 0 50:54:00:00:00:08
5214 5 0 50:54:00:00:00:09
5218 # Now trace 16 new MACs on another port.
5219 for i in 0 1 2 3 4 5 6 7 8 9 a b c d e f; do
5220 ovs-appctl ofproto/trace ovs-dummy "in_port(6),eth(src=50:54:00:00:0$i:ff,dst=ff:ff:ff:ff:ff:ff),$arp" -generate
5221 ovs-appctl time/warp 1000
5224 # Check the results.
5226 # Our eviction algorithm on overflow is that an arbitrary (but deterministic)
5227 # one of the ports with the most learned MACs loses the least recently used
5228 # one. Thus, the new port will end up with 3 MACs, 3 of the old ports with 1
5229 # MAC each, and the other 2 of the old ports with 2 MACs each.
5231 # (If someone changes lib/heap.c to do something different with equal-priority
5232 # nodes, then the output below could change, but it would still follow the
5233 # rules explained above.)
5234 AT_CHECK_UNQUOTED([ovs-appctl fdb/show br0 | sed 's/ *[[0-9]]\{1,\}$//' | sort],
5236 1 0 50:54:00:00:00:01
5237 2 0 50:54:00:00:00:03
5238 3 0 50:54:00:00:00:04
5239 3 0 50:54:00:00:00:05
5240 4 0 50:54:00:00:00:07
5241 5 0 50:54:00:00:00:08
5242 5 0 50:54:00:00:00:09
5243 6 0 50:54:00:00:0d:ff
5244 6 0 50:54:00:00:0e:ff
5245 6 0 50:54:00:00:0f:ff
5251 # CHECK_SFLOW_SAMPLING_PACKET(LOOPBACK_ADDR)
5253 # Test that sFlow samples packets correctly using IPv4/IPv6 sFlow collector
5254 m4_define([CHECK_SFLOW_SAMPLING_PACKET],
5255 [AT_XFAIL_IF([test "$IS_WIN32" = "yes"])
5256 OVS_VSWITCHD_START([set Bridge br0 fail-mode=standalone])
5258 on_exit 'kill `cat test-sflow.pid`'
5259 AT_CHECK([ovstest test-sflow --log-file --detach --no-chdir --pidfile 0:$1 > sflow.log], [0], [], [ignore])
5260 AT_CAPTURE_FILE([sflow.log])
5261 PARSE_LISTENING_PORT([test-sflow.log], [SFLOW_PORT])
5262 ovs-appctl time/stop
5264 add_of_ports br0 1 2
5266 set Interface br0 options:ifindex=1002 -- \
5267 set Interface p1 options:ifindex=1004 -- \
5268 set Interface p2 options:ifindex=1003 -- \
5269 set Bridge br0 sflow=@sf -- \
5270 --id=@sf create sflow targets=\"$1:$SFLOW_PORT\" \
5271 header=128 sampling=1 polling=1 agent=$LOOPBACK_INTERFACE
5273 dnl open with ARP packets to seed the bridge-learning. The output
5274 dnl ifIndex numbers should be reported predictably after that.
5275 dnl Since we set sampling=1 we should see all of these packets
5276 dnl reported. Sorting the output by data-source and seqNo makes
5277 dnl it deterministic. Ensuring that we send at least two packets
5278 dnl into each port means we get to check the seq nos are
5279 dnl incrementing correctly.
5280 dnl because packets from different ports can be handled by separate
5281 dnl threads, put some sleeps
5283 ovs-appctl netdev-dummy/receive p1 'in_port(2),eth(src=50:54:00:00:00:05,dst=FF:FF:FF:FF:FF:FF),eth_type(0x0806),arp(sip=192.168.0.2,tip=192.168.0.1,op=1,sha=50:54:00:00:00:05,tha=00:00:00:00:00:00)'
5285 ovs-appctl netdev-dummy/receive p2 'in_port(1),eth(src=50:54:00:00:00:07,dst=FF:FF:FF:FF:FF:FF),eth_type(0x0806),arp(sip=192.168.0.1,tip=192.168.0.2,op=1,sha=50:54:00:00:00:07,tha=00:00:00:00:00:00)'
5287 ovs-appctl netdev-dummy/receive p1 'in_port(2),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'
5289 ovs-appctl netdev-dummy/receive p2 'in_port(1),eth(src=50:54:00:00:00:07,dst=50:54:00:00:00:05),eth_type(0x0800),ipv4(src=192.168.0.2,dst=192.168.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=0,code=0)'
5290 ovs-appctl netdev-dummy/receive p2 'in_port(1),eth(src=50:54:00:00:00:07,dst=50:54:00:00:00:05),eth_type(0x86dd),ipv6(src=fe80::1,dst=fe80::2,label=0,proto=10,tclass=0x70,hlimit=128,frag=no)'
5292 dnl sleep long enough to get more than one counter sample
5293 dnl from each datasource so we can check sequence numbers
5294 ovs-appctl time/warp 3000 100
5296 OVS_APP_EXIT_AND_WAIT([test-sflow])
5298 AT_CHECK_UNQUOTED([[sort sflow.log | $EGREP 'HEADER|ERROR' | sed 's/ /\
5319 hdr=FF-FF-FF-FF-FF-FF-50-54-00-00-00-05-08-06-00-01-08-00-06-04-00-01-50-54-00-00-00-05-C0-A8-00-02-00-00-00-00-00-00-C0-A8-00-01-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
5339 hdr=FF-FF-FF-FF-FF-FF-50-54-00-00-00-07-08-06-00-01-08-00-06-04-00-01-50-54-00-00-00-07-C0-A8-00-01-00-00-00-00-00-00-C0-A8-00-02-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
5359 hdr=50-54-00-00-00-07-50-54-00-00-00-05-08-00-45-00-00-1C-00-00-00-00-40-01-F9-8D-C0-A8-00-01-C0-A8-00-02-08-00-F7-FF-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
5379 hdr=50-54-00-00-00-05-50-54-00-00-00-07-08-00-45-00-00-1C-00-00-00-00-40-01-F9-8D-C0-A8-00-02-C0-A8-00-01-00-00-FF-FF-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
5399 hdr=50-54-00-00-00-05-50-54-00-00-00-07-86-DD-67-00-00-00-00-00-0A-80-FE-80-00-00-00-00-00-00-00-00-00-00-00-00-00-01-FE-80-00-00-00-00-00-00-00-00-00-00-00-00-00-02-00-00-00-00-00-00
5402 AT_CHECK_UNQUOTED([[sort sflow.log | $EGREP 'IFCOUNTERS|ERROR|PORTNAME|OPENFLOWPORT' | head -18 | sed 's/ /\
5415 in_multicasts=4294967295
5416 in_broadcasts=4294967295
5417 in_discards=4294967295
5418 in_errors=4294967295
5419 in_unknownprotos=4294967295
5422 out_multicasts=4294967295
5423 out_broadcasts=4294967295
5424 out_discards=4294967295
5425 out_errors=4294967295
5438 in_multicasts=4294967295
5439 in_broadcasts=4294967295
5440 in_discards=4294967295
5441 in_errors=4294967295
5442 in_unknownprotos=4294967295
5445 out_multicasts=4294967295
5446 out_broadcasts=4294967295
5447 out_discards=4294967295
5448 out_errors=4294967295
5461 in_multicasts=4294967295
5462 in_broadcasts=4294967295
5463 in_discards=4294967295
5464 in_errors=4294967295
5465 in_unknownprotos=4294967295
5468 out_multicasts=4294967295
5469 out_broadcasts=4294967295
5470 out_discards=4294967295
5471 out_errors=4294967295
5484 in_multicasts=4294967295
5485 in_broadcasts=4294967295
5486 in_discards=4294967295
5487 in_errors=4294967295
5488 in_unknownprotos=4294967295
5491 out_multicasts=4294967295
5492 out_broadcasts=4294967295
5493 out_discards=4294967295
5494 out_errors=4294967295
5507 in_multicasts=4294967295
5508 in_broadcasts=4294967295
5509 in_discards=4294967295
5510 in_errors=4294967295
5511 in_unknownprotos=4294967295
5514 out_multicasts=4294967295
5515 out_broadcasts=4294967295
5516 out_discards=4294967295
5517 out_errors=4294967295
5530 in_multicasts=4294967295
5531 in_broadcasts=4294967295
5532 in_discards=4294967295
5533 in_errors=4294967295
5534 in_unknownprotos=4294967295
5537 out_multicasts=4294967295
5538 out_broadcasts=4294967295
5539 out_discards=4294967295
5540 out_errors=4294967295
5543 datapath_id=18364758544493064720
5546 datapath_id=18364758544493064720
5549 datapath_id=18364758544493064720
5552 datapath_id=18364758544493064720
5555 datapath_id=18364758544493064720
5558 datapath_id=18364758544493064720
5574 AT_SETUP([ofproto-dpif - basic truncate action])
5576 add_of_ports br0 1 2 3 4 5
5578 AT_CHECK([ovs-vsctl -- set Interface p1 type=dummy options:pcap=p1.pcap])
5579 AT_CHECK([ovs-vsctl -- set Interface p2 type=dummy options:pstream=punix:p2.sock])
5580 AT_CHECK([ovs-vsctl -- set Interface p3 type=dummy options:stream=unix:p2.sock])
5581 AT_CHECK([ovs-vsctl -- set Interface p4 type=dummy options:pstream=punix:p4.sock])
5582 AT_CHECK([ovs-vsctl -- set Interface p5 type=dummy options:stream=unix:p4.sock])
5584 AT_DATA([flows.txt], [dnl
5585 in_port=3,actions=drop
5586 in_port=5,actions=drop
5587 in_port=1,actions=output(port=2,max_len=64),output:4
5589 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
5591 dnl Datapath actions
5592 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=4,ttl=128,frag=no),tcp(src=8,dst=9)'], [0], [stdout])
5593 AT_CHECK([tail -1 stdout], [0],
5594 [Datapath actions: trunc(64),2,4
5597 dnl An 170 byte packet
5598 AT_CHECK([ovs-appctl netdev-dummy/receive p1 '000c29c8a0a4005056c0000808004500009cb4a6000040019003c0a8da01c0a8da640800cb5fa762000556f431ad0009388e08090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f'])
5600 AT_CHECK([ovs-ofctl parse-pcap p1.pcap], [0], [dnl
5601 icmp,in_port=ANY,vlan_tci=0x0000,dl_src=00:50:56:c0:00:08,dl_dst=00:0c:29:c8:a0:a4,nw_src=192.168.218.1,nw_dst=192.168.218.100,nw_tos=0,nw_ecn=0,nw_ttl=64,icmp_type=8,icmp_code=0
5604 AT_CHECK([ovs-appctl revalidator/purge], [0])
5605 dnl packet with truncated size
5606 AT_CHECK([ovs-ofctl dump-flows br0 | grep "in_port=3" | sed -n 's/.*\(n\_bytes=[[0-9]]*\).*/\1/p'], [0], [dnl
5609 dnl packet with original size
5610 AT_CHECK([ovs-ofctl dump-flows br0 | grep "in_port=5" | sed -n 's/.*\(n\_bytes=[[0-9]]*\).*/\1/p'], [0], [dnl
5614 dnl More complicated case
5615 AT_CHECK([ovs-ofctl del-flows br0])
5616 AT_DATA([flows.txt], [dnl
5617 in_port=3,actions=drop
5618 in_port=5,actions=drop
5619 in_port=1,actions=output(port=2,max_len=64),output(port=2,max_len=128),output(port=4,max_len=60),output:2,output:4
5621 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
5623 dnl Datapath actions
5624 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=4,ttl=128,frag=no),tcp(src=8,dst=9)'], [0], [stdout])
5625 AT_CHECK([tail -1 stdout], [0],
5626 [Datapath actions: trunc(64),2,trunc(128),2,trunc(60),4,2,4
5629 dnl An 170 byte packet
5630 AT_CHECK([ovs-appctl netdev-dummy/receive p1 '000c29c8a0a4005056c0000808004500009cb4a6000040019003c0a8da01c0a8da640800cb5fa762000556f431ad0009388e08090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f'])
5632 AT_CHECK([ovs-appctl revalidator/purge], [0])
5633 dnl packet size: 64 + 128 + 170 = 362
5634 AT_CHECK([ovs-ofctl dump-flows br0 | grep "in_port=3" | sed -n 's/.*\(n\_bytes=[[0-9]]*\).*/\1/p'], [0], [dnl
5637 dnl packet size: 60 + 170 = 230
5638 AT_CHECK([ovs-ofctl dump-flows br0 | grep "in_port=5" | sed -n 's/.*\(n\_bytes=[[0-9]]*\).*/\1/p'], [0], [dnl
5643 AT_CHECK([ovs-ofctl add-flow br0 'actions=output(port=ALL,max_len=100)'], [1], [], [dnl
5644 ovs-ofctl: output to unsupported truncate port: ALL
5650 AT_SETUP([ofproto-dpif - truncate and output to patch port])
5651 OVS_VSWITCHD_START([add-br br1 \
5652 -- set bridge br1 datapath-type=dummy fail-mode=secure \
5653 -- add-port br1 pbr1 -- set int pbr1 type=patch options:peer=pbr0 ofport_request=1 \
5654 -- add-port br0 pbr0 -- set int pbr0 type=patch options:peer=pbr1])
5658 AT_CHECK([ovs-ofctl add-flow br0 actions='output(port=1,max_len=100),output:2'])
5659 AT_CHECK([ovs-ofctl add-flow br1 actions=NORMAL])
5661 AT_CHECK([ovs-appctl ofproto/trace br0 in_port=LOCAL,dl_src=10:20:30:40:50:60],
5663 AT_CHECK([tail -1 stdout], [0], [Datapath actions: 2
5665 dnl the output(port=1,max_len=100) fails the translation, only output:2 in datapath
5666 AT_CHECK([grep "output_trunc does not support port: [[0-9]]*" stdout], [0], [stdout])
5671 AT_SETUP([ofproto-dpif - truncate and output to gre tunnel])
5672 OVS_VSWITCHD_START([add-port br0 p1 -- set Interface p1 type=gre \
5673 options:remote_ip=1.1.1.1 options:local_ip=2.2.2.2 \
5674 options:key=5 ofport_request=1\
5675 -- add-port br0 p2 -- set Interface p2 type=dummy \
5677 AT_DATA([flows.txt], [dnl
5678 actions=output(max_len=100, port=1)
5680 OVS_VSWITCHD_DISABLE_TUNNEL_PUSH_POP
5681 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
5683 AT_CHECK([ovs-appctl dpif/show | tail -n +3], [0], [dnl
5684 br0 65534/100: (dummy)
5685 p1 1/1: (gre: key=5, local_ip=2.2.2.2, remote_ip=1.1.1.1)
5690 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(2),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=4,ttl=128,frag=no),tcp(src=8,dst=9)'], [0], [stdout])
5691 AT_CHECK([tail -1 stdout], [0],
5692 [Datapath actions: trunc(100),set(tunnel(tun_id=0x5,src=2.2.2.2,dst=1.1.1.1,ttl=64,flags(df|key))),1
5698 AT_SETUP([ofproto-dpif - sFlow packet sampling - IPv4 collector])
5699 CHECK_SFLOW_SAMPLING_PACKET([127.0.0.1])
5702 AT_SETUP([ofproto-dpif - sFlow packet sampling - IPv6 collector])
5703 AT_SKIP_IF([test $HAVE_IPV6 = no])
5704 CHECK_SFLOW_SAMPLING_PACKET([[[::1]]])
5707 dnl Test sFlow LAG structures
5708 AT_SETUP([ofproto-dpif - sFlow packet sampling - LACP structures])
5709 AT_SKIP_IF([test "$IS_WIN32" = "yes"])
5710 OVS_VSWITCHD_START([dnl
5711 add-bond br0 bond p1 p2 -- \
5712 set Port bond lacp=active bond-mode=active-backup \
5713 other_config:lacp-time="fast" \
5714 other_config:lacp-system-id=11:22:33:44:55:66 \
5715 other_config:lacp-system-priority=54321 -- \
5716 set Interface p1 type=dummy \
5717 other_config:lacp-port-id=11 \
5718 other_config:lacp-port-priority=111 \
5719 other_config:lacp-aggregation-key=3333 -- \
5720 set Interface p2 type=dummy \
5721 other_config:lacp-port-id=22 \
5722 other_config:lacp-port-priority=222 \
5723 other_config:lacp-aggregation-key=3333 ])
5725 on_exit 'kill `cat test-sflow.pid`'
5726 AT_CHECK([ovstest test-sflow --log-file --detach --no-chdir --pidfile 0:127.0.0.1 > sflow.log], [0], [], [ignore])
5727 AT_CAPTURE_FILE([sflow.log])
5728 PARSE_LISTENING_PORT([test-sflow.log], [SFLOW_PORT])
5730 ovs-appctl time/stop
5733 set Interface p1 options:ifindex=1003 -- \
5734 set Bridge br0 sflow=@sf -- \
5735 --id=@sf create sflow targets=\"127.0.0.1:$SFLOW_PORT\" \
5736 header=128 sampling=1 polling=1
5738 dnl sleep long enough to get the sFlow datagram flushed out (may be delayed for up to 1 second)
5739 AT_CHECK([ovs-appctl time/warp 2000 100], [0], [ignore])
5740 AT_CHECK([ovs-appctl revalidator/purge], [0])
5742 OVS_APP_EXIT_AND_WAIT([test-sflow])
5743 AT_CHECK([[sort sflow.log | $EGREP 'LACPCOUNTERS|ERROR' | head -n 1 | sed 's/ /\
5746 sysID=11:22:33:44:55:66
5747 partnerID=00:00:00:00:00:00
5754 markerPDUsRx=4294967295
5755 markerRespPDUsRx=4294967295
5756 unknownRx=4294967295
5759 markerPDUsTx=4294967295
5760 markerRespPDUsTx=4294967295
5765 AT_SETUP([ofproto-dpif - sFlow packet sampling - tunnel set])
5766 AT_XFAIL_IF([test "$IS_WIN32" = "yes"])
5767 OVS_VSWITCHD_START([set Bridge br0 fail-mode=standalone])
5769 dnl set up sFlow logging
5770 AT_CHECK([ovstest test-sflow --log-file --detach --no-chdir --pidfile 0:127.0.0.1 > sflow.log], [0], [], [ignore])
5771 AT_CAPTURE_FILE([sflow.log])
5772 PARSE_LISTENING_PORT([test-sflow.log], [SFLOW_PORT])
5773 ovs-appctl time/stop
5775 OVS_VSWITCHD_DISABLE_TUNNEL_PUSH_POP
5776 AT_CHECK([ovs-vsctl add-port br0 gre0 -- set Interface gre0 type=gre \
5777 options:remote_ip=1.1.1.1 options:key=456 ofport_request=3])
5778 AT_CHECK([ovs-vsctl add-port br0 p1 -- set Interface p1 type=dummy ofport_request=4])
5780 AT_CHECK([ovs-ofctl add-flow br0 action=3])
5784 set Bridge br0 sflow=@sf -- \
5785 --id=@sf create sflow targets=\"127.0.0.1:$SFLOW_PORT\" \
5786 header=128 sampling=1 polling=0
5788 dnl introduce a packet that will be flooded to the tunnel
5789 AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(4),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.10.10.2,dst=10.10.10.1,proto=1,tos=1,ttl=128,frag=no),icmp(type=8,code=0)'])
5791 dnl sleep long enough to get the sFlow datagram flushed out (may be delayed for up to 1 second)
5792 for i in `seq 1 30`; do
5793 ovs-appctl time/warp 100
5796 OVS_APP_EXIT_AND_WAIT([test-sflow])
5798 AT_CHECK_UNQUOTED([[sort sflow.log | $EGREP 'HEADER|ERROR' | sed 's/ /\
5804 tunnel4_out_length=0
5805 tunnel4_out_protocol=47
5806 tunnel4_out_src=0.0.0.0
5807 tunnel4_out_dst=1.1.1.1
5808 tunnel4_out_src_port=0
5809 tunnel4_out_dst_port=0
5810 tunnel4_out_tcp_flags=0
5828 hdr=50-54-00-00-00-0A-50-54-00-00-00-09-08-00-45-01-00-1C-00-00-00-00-80-01-12-CA-0A-0A-0A-02-0A-0A-0A-01-08-00-F7-FF-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
5834 AT_SETUP([ofproto-dpif - sFlow packet sampling - tunnel push])
5835 AT_XFAIL_IF([test "$IS_WIN32" = "yes"])
5837 OVS_VSWITCHD_START([add-port br0 p0 -- set Interface p0 type=dummy ofport_request=1 options:ifindex=1010])
5839 dnl set up sFlow logging
5840 AT_CHECK([ovstest test-sflow --log-file --detach --no-chdir --pidfile 0:127.0.0.1 > sflow.log], [0], [], [ignore])
5841 AT_CAPTURE_FILE([sflow.log])
5842 PARSE_LISTENING_PORT([test-sflow.log], [SFLOW_PORT])
5843 ovs-appctl time/stop
5845 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
5846 AT_CHECK([ovs-vsctl add-br int-br -- set bridge int-br datapath_type=dummy], [0])
5847 AT_CHECK([ovs-vsctl -- add-port int-br t1 -- set Interface t1 type=gre \
5848 options:remote_ip=1.1.2.92 options:key=456 ofport_request=4\
5849 -- add-port int-br vm1 -- set Interface vm1 type=dummy \
5850 options:ifindex=2011 ofport_request=5
5853 AT_CHECK([ovs-appctl dpif/show], [0], [dnl
5854 dummy@ovs-dummy: hit:0 missed:0
5856 br0 65534/100: (dummy)
5857 p0 1/1: (dummy: ifindex=1010)
5859 int-br 65534/2: (dummy)
5860 t1 4/4: (gre: key=456, remote_ip=1.1.2.92)
5861 vm1 5/3: (dummy: ifindex=2011)
5864 dnl set up route to 1.1.2.92 via br0 and action=normal
5865 AT_CHECK([ovs-appctl netdev-dummy/ip4addr br0 1.1.2.88/24], [0], [OK
5867 AT_CHECK([ovs-appctl ovs/route/add 1.1.2.92/24 br0], [0], [OK
5869 AT_CHECK([ovs-ofctl add-flow br0 action=normal])
5871 dnl Prime ARP Cache for 1.1.2.92
5872 AT_CHECK([ovs-appctl netdev-dummy/receive br0 'recirc_id(0),in_port(100),eth(src=f8:bc:12:44:34:b6,dst=ff:ff:ff:ff:ff:ff),eth_type(0x0806),arp(sip=1.1.2.92,tip=1.1.2.88,op=2,sha=f8:bc:12:44:34:b6,tha=00:00:00:00:00:00)'])
5874 dnl configure sflow on int-br only
5876 set Bridge int-br sflow=@sf -- \
5877 --id=@sf create sflow targets=\"127.0.0.1:$SFLOW_PORT\" \
5878 header=128 sampling=1 polling=0
5880 dnl set up route to 192.168.1.2 via br0
5881 AT_CHECK([ovs-appctl netdev-dummy/ip4addr br0 192.168.1.1/16], [0], [OK
5883 AT_CHECK([ovs-appctl ovs/route/add 192.168.0.0/16 br0], [0], [OK
5886 dnl add rule for int-br to force packet onto tunnel. There is no ifindex
5887 dnl for this port so the sFlow output will just report that it went to
5888 dnl 1 output (out_format=2, out_ifindex=1)
5889 AT_CHECK([ovs-ofctl add-flow int-br "actions=4"])
5891 AT_CHECK([ovs-appctl netdev-dummy/receive vm1 'in_port(3),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=192.168.1.1,dst=192.168.2.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)'])
5893 dnl sleep long enough to get the sFlow datagram flushed out (may be delayed for up to 1 second)
5894 for i in `seq 1 30`; do
5895 ovs-appctl time/warp 100
5898 OVS_APP_EXIT_AND_WAIT([test-sflow])
5900 AT_CHECK_UNQUOTED([[sort sflow.log | $EGREP 'HEADER|ERROR' | sed 's/ /\
5906 tunnel4_out_length=0
5907 tunnel4_out_protocol=47
5908 tunnel4_out_src=1.1.2.88
5909 tunnel4_out_dst=1.1.2.92
5910 tunnel4_out_src_port=0
5911 tunnel4_out_dst_port=0
5912 tunnel4_out_tcp_flags=0
5930 hdr=50-54-00-00-00-0A-50-54-00-00-00-05-08-00-45-00-00-1C-00-00-00-00-80-01-B6-8D-C0-A8-01-01-C0-A8-02-02-08-00-F7-FF-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
5936 AT_SETUP([ofproto-dpif - sFlow packet sampling - MPLS])
5937 AT_XFAIL_IF([test "$IS_WIN32" = "yes"])
5939 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
5940 add_of_ports br0 1 2
5941 AT_DATA([flows.txt], [dnl
5942 table=0 dl_src=50:54:00:00:00:09 actions=push_mpls:0x8847,set_mpls_label:789,set_mpls_tc:4,set_mpls_ttl:32,2
5943 table=0 dl_src=50:54:00:00:00:0b actions=pop_mpls:0x0800,2
5945 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
5947 dnl set up sFlow logging
5948 AT_CHECK([ovstest test-sflow --log-file --detach --no-chdir --pidfile 0:127.0.0.1 > sflow.log], [0], [], [ignore])
5949 AT_CAPTURE_FILE([sflow.log])
5950 PARSE_LISTENING_PORT([test-sflow.log], [SFLOW_PORT])
5951 ovs-appctl time/stop
5955 set Bridge br0 sflow=@sf -- \
5956 --id=@sf create sflow targets=\"127.0.0.1:$SFLOW_PORT\" \
5957 header=128 sampling=1 polling=0
5959 AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x8847),mpls(label=11,tc=3,ttl=64,bos=1)'])
5960 AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800)'])
5962 dnl sleep long enough to get the sFlow datagram flushed out (may be delayed for up to 1 second)
5963 for i in `seq 1 30`; do
5964 ovs-appctl time/warp 100
5967 OVS_APP_EXIT_AND_WAIT([test-sflow])
5969 AT_CHECK_UNQUOTED([[sort sflow.log | $EGREP 'HEADER|ERROR' | sed 's/ /\
5998 hdr=50-54-00-00-00-0A-50-54-00-00-00-09-88-47-00-00-B7-40-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
6022 hdr=50-54-00-00-00-0A-50-54-00-00-00-09-08-00-45-00-00-14-00-00-00-00-00-00-BA-EB-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
6029 # CHECK_NETFLOW_EXPIRATION(LOOPBACK_ADDR)
6031 # Test that basic NetFlow reports flow statistics correctly:
6032 # The initial packet of a flow are correctly accounted.
6033 # Later packets within a flow are correctly accounted.
6034 # Flow actions changing (in this case, due to MAC learning)
6035 # cause a record to be sent.
6036 m4_define([CHECK_NETFLOW_EXPIRATION],
6037 [OVS_VSWITCHD_START([set Bridge br0 fail-mode=standalone])
6038 add_of_ports br0 1 2
6040 ovs-appctl time/stop
6041 on_exit 'kill `cat test-netflow.pid`'
6042 AT_CHECK([ovstest test-netflow --log-file --detach --no-chdir --pidfile 0:$1 > netflow.log], [0], [], [ignore])
6043 AT_CAPTURE_FILE([netflow.log])
6044 PARSE_LISTENING_PORT([test-netflow.log], [NETFLOW_PORT])
6047 set Bridge br0 netflow=@nf -- \
6048 --id=@nf create NetFlow targets=\"$1:$NETFLOW_PORT\" \
6049 engine_id=1 engine_type=2 active_timeout=30 add-id-to-interface=false
6051 for delay in 1000 30000; do
6052 ovs-appctl netdev-dummy/receive p1 'in_port(2),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'
6053 sleep 1 # ensure the order in which these two packets are processed
6054 ovs-appctl netdev-dummy/receive p2 'in_port(1),eth(src=50:54:00:00:00:07,dst=50:54:00:00:00:05),eth_type(0x0800),ipv4(src=192.168.0.2,dst=192.168.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=0,code=0)'
6056 ovs-appctl time/warp $delay
6059 ovs-appctl time/warp 6000
6060 ovs-appctl revalidator/wait
6062 OVS_APP_EXIT_AND_WAIT([test-netflow])
6064 AT_CHECK([test `grep "192.168.0.1 > 192.168.0.2, if 1 > 65535, 1 pkts, 60 bytes, ICMP 8:0" netflow.log | wc -l` -eq 1])
6066 AT_CHECK([test `grep "192.168.0.1 > 192.168.0.2, if 1 > 2, 1 pkts, 60 bytes, ICMP 8:0" netflow.log | wc -l` -eq 1])
6068 combined=`grep "192.168.0.2 > 192.168.0.1, if 2 > 1, 2 pkts, 120 bytes, ICMP 0:0" netflow.log | wc -l`
6069 separate=`grep "192.168.0.2 > 192.168.0.1, if 2 > 1, 1 pkts, 60 bytes, ICMP 0:0" netflow.log | wc -l`
6070 AT_CHECK([test $separate = 2 || test $combined = 1], [0])])
6072 AT_SETUP([ofproto-dpif - NetFlow flow expiration - IPv4 collector])
6073 CHECK_NETFLOW_EXPIRATION([127.0.0.1])
6076 AT_SETUP([ofproto-dpif - NetFlow flow expiration - IPv6 collector])
6077 AT_SKIP_IF([test $HAVE_IPV6 = no])
6078 CHECK_NETFLOW_EXPIRATION([[[::1]]])
6081 # CHECK_NETFLOW_ACTIVE_EXPIRATION(LOOPBACK_ADDR)
6083 # Test that basic NetFlow reports active expirations correctly.
6084 m4_define([CHECK_NETFLOW_ACTIVE_EXPIRATION],
6085 [OVS_VSWITCHD_START([set Bridge br0 fail-mode=standalone])
6086 add_of_ports br0 1 2
6088 on_exit 'kill `cat test-netflow.pid`'
6089 AT_CHECK([ovstest test-netflow --log-file --detach --no-chdir --pidfile 0:$1 > netflow.log], [0], [], [ignore])
6090 AT_CAPTURE_FILE([netflow.log])
6091 PARSE_LISTENING_PORT([test-netflow.log], [NETFLOW_PORT])
6094 set Bridge br0 netflow=@nf -- \
6095 --id=@nf create NetFlow targets=\"$1:$NETFLOW_PORT\" \
6096 engine_id=1 engine_type=2 active_timeout=10 add-id-to-interface=false
6098 AT_CHECK([ovs-appctl time/stop])
6100 while test $n -le 60; do
6103 ovs-appctl netdev-dummy/receive p1 'in_port(2),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=64,frag=no),tcp(src=1234,dst=80)'
6104 ovs-appctl netdev-dummy/receive p2 'in_port(1),eth(src=50:54:00:00:00:07,dst=50:54:00:00:00:05),eth_type(0x0800),ipv4(src=192.168.0.2,dst=192.168.0.1,proto=6,tos=0,ttl=64,frag=no),tcp(src=80,dst=1234)'
6106 ovs-appctl time/warp 1000
6109 ovs-appctl time/warp 10000
6111 ovs-appctl revalidator/wait
6113 OVS_APP_EXIT_AND_WAIT([test-netflow])
6115 # Count the number of reported packets:
6116 # - From source to destination before MAC learning kicks in (just one).
6117 # - From source to destination after that.
6118 # - From destination to source.
6126 pkts=`echo "$line" | sed 's/.*, \([[0-9]]*\) pkts,.*/\1/'`
6133 "seq "*": 192.168.0.1 > 192.168.0.2, if 1 > 65535, "*" pkts, "*" bytes, TCP 1234 > 80, time "*)
6136 "seq "*": 192.168.0.1 > 192.168.0.2, if 1 > 2, "*" pkts, "*" bytes, TCP 1234 > 80, time "*)
6139 "seq "*": 192.168.0.2 > 192.168.0.1, if 2 > 1, "*" pkts, "*" bytes, TCP 80 > 1234, time "*)
6146 eval $counter=\`expr \$$counter + \$pkts\`
6147 n_recs=`expr $n_recs + 1`
6150 # There should be exactly 1 MAC learning packet,
6151 # exactly 59 other packets in that direction,
6152 # and exactly 60 packets in the other direction.
6153 AT_CHECK([echo $n_learn $n_in $n_out $n_other], [0], [1 59 60 0
6156 AT_SETUP([ofproto-dpif - NetFlow active expiration - IPv4 collector])
6157 CHECK_NETFLOW_ACTIVE_EXPIRATION([127.0.0.1])
6160 AT_SETUP([ofproto-dpif - NetFlow active expiration - IPv6 collector])
6161 AT_SKIP_IF([test $HAVE_IPV6 = no])
6162 CHECK_NETFLOW_ACTIVE_EXPIRATION([[[::1]]])
6165 dnl In the absence of an IPFIX collector to verify protocol correctness, simply
6166 dnl configure bridge IPFIX and ensure that sample action generation works at the
6168 AT_SETUP([ofproto-dpif - Bridge IPFIX sanity check])
6170 add_of_ports br0 1 2
6172 dnl Sample every packet using bridge-based sampling.
6173 AT_CHECK([ovs-vsctl -- set bridge br0 ipfix=@fix -- \
6174 --id=@fix create ipfix targets=\"127.0.0.1:4739\" \
6175 sampling=1], [0], [ignore])
6177 dnl Send some packets that should be sampled.
6178 for i in `seq 1 3`; do
6179 AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800)'])
6181 AT_CHECK([ovs-appctl dpctl/dump-flows | sed 's/.*\(packets:\)/\1/' | sed 's/used:[[0-9]].[[0-9]]*s/used:0.001s/'], [0], [dnl
6182 flow-dump from non-dpdk interfaces:
6183 packets:2, bytes:120, used:0.001s, actions:sample(sample=100.0%,actions(userspace(pid=0,ipfix(output_port=4294967295))))
6186 dnl Remove the IPFIX configuration.
6187 AT_CHECK([ovs-vsctl clear bridge br0 ipfix])
6188 AT_CHECK([ovs-appctl revalidator/purge])
6190 dnl Send some more packets, to ensure that these are not sampled.
6191 for i in `seq 1 3`; do
6192 AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800)'])
6194 AT_CHECK([ovs-appctl dpctl/dump-flows | sed 's/.*\(packets:\)/\1/' | sed 's/used:[[0-9]].[[0-9]]*s/used:0.001s/'], [0], [dnl
6195 flow-dump from non-dpdk interfaces:
6196 packets:2, bytes:120, used:0.001s, actions:drop
6199 OVS_VSWITCHD_STOP(["/sending to collector failed/d"])
6202 dnl Bridge IPFIX statistics check
6203 AT_SETUP([ofproto-dpif - Bridge IPFIX statistics check])
6205 add_of_ports br0 1 2
6207 dnl Negative test check.
6208 AT_CHECK([ovs-ofctl dump-ipfix-bridge br0], [0], [dnl
6209 OFPT_ERROR (xid=0x2): NXST_NOT_CONFIGURED
6210 NXST_IPFIX_BRIDGE request (xid=0x2):
6213 dnl Sample every packet using bridge-based sampling.
6214 AT_CHECK([ovs-vsctl -- set bridge br0 ipfix=@fix -- \
6215 --id=@fix create ipfix targets=\"127.0.0.1:4739\" \
6216 sampling=1], [0], [ignore])
6218 dnl Send some packets that should be sampled.
6219 for i in `seq 1 20`; do
6220 AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800)'])
6223 dnl There are 4 extra IPFIX template packets.
6224 AT_CHECK([ovs-ofctl dump-ipfix-bridge br0], [0], [dnl
6225 NXST_IPFIX_BRIDGE reply (xid=0x2):
6226 bridge ipfix: flows=20, current flows=0, sampled pkts=20, ipv4 ok=0, ipv6 ok=0, tx pkts=12
6227 pkts errs=20, ipv4 errs=20, ipv6 errs=0, tx errs=12
6230 dnl Remove the IPFIX configuration.
6231 AT_CHECK([ovs-vsctl clear bridge br0 ipfix])
6232 AT_CHECK([ovs-appctl revalidator/purge])
6234 dnl Send some more packets, to ensure that these are not sampled.
6235 for i in `seq 1 2`; do
6236 AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800)'])
6238 AT_CHECK([ovs-ofctl dump-ipfix-bridge br0], [0], [dnl
6239 OFPT_ERROR (xid=0x2): NXST_NOT_CONFIGURED
6240 NXST_IPFIX_BRIDGE request (xid=0x2):
6243 OVS_VSWITCHD_STOP(["/sending to collector failed/d"])
6246 dnl Flow IPFIX sanity check
6247 AT_SETUP([ofproto-dpif - Flow IPFIX sanity check])
6249 add_of_ports br0 1 2
6251 AT_CHECK([ovs-vsctl -- --id=@br0 get Bridge br0 \
6252 -- --id=@ipfix create IPFIX targets=\"127.0.0.1:4739\" \
6253 -- --id=@cs create Flow_Sample_Collector_Set id=1 bridge=@br0 ipfix=@ipfix],
6256 AT_DATA([flows.txt], [dnl
6257 in_port=1, actions=sample(probability=65535,collector_set_id=1),output:2
6260 AT_CHECK([ovs-ofctl add-flows br0 flows.txt], [0], [ignore])
6262 dnl Send some packets that should be sampled.
6263 for i in `seq 1 3`; do
6264 AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800)'])
6266 AT_CHECK([ovs-appctl dpctl/dump-flows | sed 's/.*\(packets:\)/\1/' | sed 's/used:[[0-9]].[[0-9]]*s/used:0.001s/'], [0], [dnl
6267 flow-dump from non-dpdk interfaces:
6268 packets:2, bytes:120, used:0.001s, actions:sample(sample=100.0%,actions(userspace(pid=0,flow_sample(probability=65535,collector_set_id=1,obs_domain_id=0,obs_point_id=0,output_port=4294967295)))),2
6271 dnl Remove the flow which contains sample action.
6272 AT_CHECK([ovs-ofctl del-flows br0 in_port=1], [0], [ignore])
6273 AT_CHECK([ovs-appctl revalidator/purge])
6275 dnl Send some more packets, to ensure that these are not sampled.
6276 for i in `seq 1 3`; do
6277 AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800)'])
6279 AT_CHECK([ovs-appctl dpctl/dump-flows | sed 's/.*\(packets:\)/\1/' | sed 's/used:[[0-9]].[[0-9]]*s/used:0.001s/'], [0], [dnl
6280 flow-dump from non-dpdk interfaces:
6281 packets:2, bytes:120, used:0.001s, actions:drop
6284 OVS_VSWITCHD_STOP(["/sending to collector failed/d"])
6287 dnl Flow IPFIX sanity check for tunnel set
6288 AT_SETUP([ofproto-dpif - Flow IPFIX sanity check - tunnel set])
6289 AT_XFAIL_IF([test "$IS_WIN32" = "yes"])
6290 OVS_VSWITCHD_START([add-port br0 p1 -- set Interface p1 type=gre \
6291 options:remote_ip=1.1.1.1 options:local_ip=2.2.2.2 \
6292 options:key=5 ofport_request=1\
6293 -- add-port br0 p2 -- set Interface p2 type=stt \
6294 options:remote_ip=1.1.1.2 options:local_ip=2.2.2.3 \
6295 options:key=6 ofport_request=2\
6296 -- add-port br0 p3 -- set Interface p3 type=dummy \
6298 -- --id=@br0 get Bridge br0 \
6299 -- --id=@ipfix create IPFIX targets=\"127.0.0.1:4739\" \
6300 -- --id=@cs create Flow_Sample_Collector_Set id=1 bridge=@br0 ipfix=@ipfix],
6305 OVS_VSWITCHD_DISABLE_TUNNEL_PUSH_POP
6307 dnl Add openflow sample action without sampling_port.
6308 AT_DATA([flows.txt], [dnl
6309 in_port=3, actions=sample(probability=65535,collector_set_id=1),output:1
6311 AT_CHECK([ovs-ofctl add-flows br0 flows.txt], [0], [ignore])
6313 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(3),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.10.10.2,dst=10.10.10.1,proto=1,tos=1,ttl=128,frag=no),icmp(type=8,code=0)'], [0], [stdout])
6314 AT_CHECK([tail -1 stdout], [0], [dnl
6315 Datapath actions: sample(sample=100.0%,actions(userspace(pid=0,flow_sample(probability=65535,collector_set_id=1,obs_domain_id=0,obs_point_id=0,output_port=4294967295)))),set(tunnel(tun_id=0x5,src=2.2.2.2,dst=1.1.1.1,tos=0x1,ttl=64,flags(df|key))),1
6318 dnl Remove the flow which contains sample action.
6319 AT_CHECK([ovs-ofctl del-flows br0 in_port=3], [0], [ignore])
6320 AT_CHECK([ovs-appctl revalidator/purge])
6322 dnl Add openflow sample action with sampling_port which is
6323 dnl equal to output port.
6324 AT_DATA([flows2.txt], [dnl
6325 in_port=3, actions=sample(probability=65535,collector_set_id=1,sampling_port=1),output:1
6327 AT_CHECK([ovs-ofctl add-flows br0 flows2.txt], [0], [ignore])
6329 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(3),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.10.10.2,dst=10.10.10.1,proto=1,tos=1,ttl=128,frag=no),icmp(type=8,code=0)'], [0], [stdout])
6330 dnl Make sure flow sample action in datapath is behind set tunnel
6331 dnl action at egress point of tunnel port.
6332 AT_CHECK([tail -1 stdout], [0], [dnl
6333 Datapath actions: set(tunnel(tun_id=0x5,src=2.2.2.2,dst=1.1.1.1,tos=0x1,ttl=64,flags(df|key))),sample(sample=100.0%,actions(userspace(pid=0,flow_sample(probability=65535,collector_set_id=1,obs_domain_id=0,obs_point_id=0,output_port=1),tunnel_out_port=1))),1
6336 dnl Remove the flow which contains sample action.
6337 AT_CHECK([ovs-ofctl del-flows br0 in_port=3], [0], [ignore])
6338 AT_CHECK([ovs-appctl revalidator/purge])
6340 dnl Add a rule with two sample actions and each sample action
6341 dnl has a sampling_port
6342 AT_DATA([flows3.txt], [dnl
6343 in_port=3, actions=sample(probability=65535,collector_set_id=1,sampling_port=1),output:1,sample(probability=65535,collector_set_id=1,sampling_port=2),output:2
6345 AT_CHECK([ovs-ofctl add-flows br0 flows3.txt], [0], [ignore])
6347 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(3),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.10.10.2,dst=10.10.10.1,proto=1,tos=1,ttl=128,frag=no),icmp(type=8,code=0)'], [0], [stdout])
6348 dnl Make sure flow sample action in datapath is behind set tunnel
6349 dnl action at egress point of tunnel port.
6350 AT_CHECK([tail -1 stdout], [0], [dnl
6351 Datapath actions: set(tunnel(tun_id=0x5,src=2.2.2.2,dst=1.1.1.1,tos=0x1,ttl=64,flags(df|key))),sample(sample=100.0%,actions(userspace(pid=0,flow_sample(probability=65535,collector_set_id=1,obs_domain_id=0,obs_point_id=0,output_port=1),tunnel_out_port=1))),1,set(tunnel(tun_id=0x6,src=2.2.2.3,dst=1.1.1.2,tos=0x1,ttl=64,flags(df|key))),sample(sample=100.0%,actions(userspace(pid=0,flow_sample(probability=65535,collector_set_id=1,obs_domain_id=0,obs_point_id=0,output_port=7471),tunnel_out_port=7471))),7471
6354 dnl Remove the flow which contains sample action.
6355 AT_CHECK([ovs-ofctl del-flows br0 in_port=3], [0], [ignore])
6356 AT_CHECK([ovs-vsctl destroy Flow_Sample_Collector_Set 1], [0], [ignore])
6361 dnl Flow based IPFIX statistics check
6362 AT_SETUP([ofproto-dpif - Flow IPFIX statistics check])
6364 add_of_ports br0 1 2
6366 dnl Negative test check.
6367 AT_CHECK([ovs-ofctl dump-ipfix-flow br0], [0], [dnl
6368 OFPT_ERROR (xid=0x2): NXST_NOT_CONFIGURED
6369 NXST_IPFIX_FLOW request (xid=0x2):
6372 AT_CHECK([ovs-vsctl -- --id=@br0 get Bridge br0 \
6373 -- --id=@ipfix create IPFIX targets=\"127.0.0.1:4739\" \
6374 -- --id=@cs create Flow_Sample_Collector_Set id=1 bridge=@br0 ipfix=@ipfix],
6377 AT_DATA([flows.txt], [dnl
6378 in_port=1, actions=sample(probability=65535,collector_set_id=1),output:2
6381 AT_CHECK([ovs-ofctl add-flows br0 flows.txt], [0], [ignore])
6383 dnl Send some packets that should be sampled.
6384 for i in `seq 1 20`; do
6385 AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800)'])
6388 dnl There are 4 extra IPFIX template packets.
6389 AT_CHECK([ovs-ofctl dump-ipfix-flow br0], [0], [dnl
6390 NXST_IPFIX_FLOW reply (xid=0x2): 1 ids
6391 id 1: flows=20, current flows=0, sampled pkts=20, ipv4 ok=0, ipv6 ok=0, tx pkts=12
6392 pkts errs=20, ipv4 errs=20, ipv6 errs=0, tx errs=12
6395 dnl Remove the flow which contains sample action.
6396 AT_CHECK([ovs-ofctl del-flows br0 in_port=1], [0], [ignore])
6397 AT_CHECK([ovs-vsctl destroy Flow_Sample_Collector_Set 1], [0], [ignore])
6398 AT_CHECK([ovs-appctl revalidator/purge])
6400 dnl Send some more packets, to ensure that these are not sampled.
6401 for i in `seq 1 3`; do
6402 AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800)'])
6404 AT_CHECK([ovs-ofctl dump-ipfix-flow br0], [0], [dnl
6405 OFPT_ERROR (xid=0x2): NXST_NOT_CONFIGURED
6406 NXST_IPFIX_FLOW request (xid=0x2):
6409 OVS_VSWITCHD_STOP(["/sending to collector failed/d"])
6412 AT_SETUP([ofproto-dpif - flow stats])
6414 AT_CHECK([ovs-ofctl add-flow br0 "ip,actions=NORMAL"])
6415 AT_CHECK([ovs-ofctl add-flow br0 "icmp,actions=NORMAL"])
6417 ovs-appctl time/stop
6419 for i in `seq 1 10`; do
6420 ovs-appctl netdev-dummy/receive br0 'in_port(0),eth(src=50:54:00:00:00:07,dst=50:54:00:00:00:05),eth_type(0x0800),ipv4(src=192.168.0.2,dst=192.168.0.1,proto=6,tos=0,ttl=64,frag=no)'
6423 AT_CHECK([ovs-appctl time/warp 1000], [0], [ignore])
6424 AT_CHECK([ovs-appctl revalidator/purge], [0])
6425 AT_CHECK([ovs-ofctl dump-flows br0], [0], [stdout])
6426 AT_CHECK([strip_xids < stdout | sed -n 's/duration=[[0-9]]*\.[[0-9]]*s/duration=0.0s/p' | sort], [0], [dnl
6427 cookie=0x0, duration=0.0s, table=0, n_packets=0, n_bytes=0, idle_age=1, icmp actions=NORMAL
6428 cookie=0x0, duration=0.0s, table=0, n_packets=10, n_bytes=600, idle_age=1, ip actions=NORMAL
6433 AT_SETUP([ofproto-dpif - flow stats, set-n-threads])
6435 AT_CHECK([ovs-ofctl add-flow br0 "ip,actions=NORMAL"])
6436 AT_CHECK([ovs-ofctl add-flow br0 "icmp,actions=NORMAL"])
6438 ovs-appctl time/stop
6440 for i in `seq 1 10`; do
6441 ovs-appctl netdev-dummy/receive br0 'in_port(0),eth(src=50:54:00:00:00:07,dst=50:54:00:00:00:05),eth_type(0x0800),ipv4(src=192.168.0.2,dst=192.168.0.1,proto=6,tos=0,ttl=64,frag=no)'
6444 ovs-appctl time/warp 100
6445 AT_CHECK([ovs-vsctl set Open_vSwitch . other-config:n-revalidator-threads=2])
6446 ovs-appctl time/warp 1000
6448 AT_CHECK([ovs-ofctl dump-flows br0], [0], [stdout])
6449 AT_CHECK([strip_xids < stdout | sed -n 's/duration=[[0-9]]*\.[[0-9]]*s/duration=0.0s/p' | sort], [0], [dnl
6450 cookie=0x0, duration=0.0s, table=0, n_packets=0, n_bytes=0, idle_age=1, icmp actions=NORMAL
6451 cookie=0x0, duration=0.0s, table=0, n_packets=10, n_bytes=600, idle_age=1, ip actions=NORMAL
6456 AT_SETUP([ofproto-dpif - idle_age and hard_age increase over time])
6459 # get_ages DURATION HARD IDLE
6461 # Fetch the flow duration, hard age, and idle age into the variables
6462 # whose names are given as arguments. Rounds DURATION down to the
6463 # nearest integer. If hard_age doesn't appear in the output, sets
6464 # HARD to "none". If idle_age doesn't appear in the output, sets IDLE
6467 AT_CHECK([ovs-ofctl dump-flows br0], [0], [stdout])
6469 duration=`sed -n 's/.*duration=\([[0-9]]*\)\(\.[[0-9]]*\)\{0,1\}s.*/\1/p' stdout`
6470 AT_CHECK([[expr X"$duration" : 'X[0-9][0-9]*$']], [0], [ignore])
6471 AS_VAR_COPY([$1], [duration])
6473 hard=`sed -n 's/.*hard_age=\([[0-9]]*\),.*/\1/p' stdout`
6474 if test X"$hard" = X; then
6477 AT_CHECK([[expr X"$hard" : 'X[0-9][0-9]*$']], [0], [ignore])
6479 AS_VAR_COPY([$2], [hard])
6481 idle=`sed -n 's/.*idle_age=\([[0-9]]*\),.*/\1/p' stdout`
6482 if test X"$idle" = X; then
6485 AT_CHECK([[expr X"$idle" : 'X[0-9][0-9]*$']], [0], [ignore])
6487 AS_VAR_COPY([$3], [idle])
6490 # Add a flow and get its initial hard and idle age.
6491 AT_CHECK([ovs-ofctl add-flow br0 hard_timeout=199,idle_timeout=188,actions=drop])
6492 get_ages duration1 hard1 idle1
6494 ovs-appctl time/stop
6495 # Warp time forward by 10 seconds, then modify the flow's actions.
6496 ovs-appctl time/warp 10000
6497 get_ages duration2 hard2 idle2
6498 AT_CHECK([ovs-ofctl mod-flows br0 actions=flood])
6500 # Warp time forward by 10 seconds.
6501 ovs-appctl time/warp 10000
6502 get_ages duration3 hard3 idle3
6504 # Warp time forward 10 more seconds, then pass some packets through the flow,
6505 # then warp forward a few more times because idle times are only updated
6507 ovs-appctl time/warp 10000
6508 ovs-appctl netdev-dummy/receive br0 'in_port(0),eth(src=50:54:00:00:00:07,dst=50:54:00:00:00:05),eth_type(0x0800),ipv4(src=192.168.0.2,dst=192.168.0.1,proto=6,tos=0,ttl=64,frag=no),tcp(src=80,dst=1234)'
6509 ovs-appctl time/warp 3000 1000
6511 get_ages duration4 hard4 idle4
6513 printf "duration: %4s => %4s => %4s => %4s\n" $duration1 $duration2 $duration3 $duration4
6514 printf "hard_age: %4s => %4s => %4s => %4s\n" $hard1 $hard2 $hard3 $hard4
6515 printf "idle_age: %4s => %4s => %4s => %4s\n" $idle1 $idle2 $idle3 $idle4
6517 # Duration should increase steadily over time.
6518 AT_CHECK([test $duration1 -lt $duration2])
6519 AT_CHECK([test $duration2 -lt $duration3])
6520 AT_CHECK([test $duration3 -lt $duration4])
6522 # Hard age should be "none" initially because it's the same as flow_duration,
6523 # then it should increase.
6524 AT_CHECK([test $hard1 = none])
6525 AT_CHECK([test $hard2 = none])
6526 AT_CHECK([test $hard3 != none])
6527 AT_CHECK([test $hard4 != none])
6528 AT_CHECK([test $hard3 -lt $hard4])
6530 # Idle age should increase from 1 to 2 to 3, then decrease.
6531 AT_CHECK([test $idle1 -lt $idle2])
6532 AT_CHECK([test $idle2 -lt $idle3])
6533 AT_CHECK([test $idle3 -gt $idle4])
6535 # Check some invariant relationships.
6536 AT_CHECK([test $duration1 = $idle1])
6537 AT_CHECK([test $duration2 = $idle2])
6538 AT_CHECK([test $duration3 = $idle3])
6539 AT_CHECK([test $idle3 -gt $hard3])
6540 AT_CHECK([test $idle4 -lt $hard4])
6541 AT_CHECK([test $hard4 -lt $duration4])
6546 AT_SETUP([ofproto-dpif - fin_timeout])
6548 ovs-appctl time/stop
6549 AT_CHECK([ovs-ofctl add-flow br0 'idle_timeout=60,actions=fin_timeout(idle_timeout=5)'])
6550 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip], [0],
6552 idle_timeout=60, actions=fin_timeout(idle_timeout=5)
6555 # Check that a TCP SYN packet does not change the timeout. (Because
6556 # flow stats updates are mainly what implements the fin_timeout
6557 # feature, we warp forward a couple of times to ensure that flow stats
6558 # run before re-checking the flow table.)
6559 AT_CHECK([ovs-appctl netdev-dummy/receive br0 0021853763af0026b98cb0f908004500003c2e2440004006465dac11370dac11370b828b0016751e267b00000000a00216d017360000020405b40402080a2d25085f0000000001030307])
6560 AT_CHECK([ovs-appctl time/warp 1000 && ovs-appctl time/warp 1000], [0], [warped
6563 AT_CHECK([ovs-appctl revalidator/purge], [0])
6564 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip], [0],
6566 n_packets=1, n_bytes=74, idle_timeout=60, actions=fin_timeout(idle_timeout=5)
6568 # Check that a TCP FIN packet does change the timeout.
6569 AT_CHECK([ovs-appctl netdev-dummy/receive br0 0021853763af0026b98cb0f90800451000342e3e40004006463bac11370dac11370b828b0016751e319dfc96399b801100717ae800000101080a2d250a9408579588])
6570 AT_CHECK([ovs-appctl time/warp 1000 && ovs-appctl time/warp 1000], [0], [warped
6573 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip], [0],
6575 n_packets=2, n_bytes=140, idle_timeout=5, actions=fin_timeout(idle_timeout=5)
6580 AT_SETUP([ofproto-dpif - ovs-appctl dpif/dump-dps])
6581 OVS_VSWITCHD_START([add-br br1 -- set bridge br1 datapath-type=dummy])
6582 add_of_ports br0 1 2
6585 AT_CHECK([ovs-appctl dpif/dump-dps], [0], [dnl
6592 AT_SETUP([ofproto-dpif - ovs-appctl dpif/show])
6593 OVS_VSWITCHD_START([add-br br1 -- set bridge br1 datapath-type=dummy], [], [],
6594 [--dummy-numa="0,0,0,0,1,1,1,1"])
6595 add_pmd_of_ports br0 1 2
6598 AT_CHECK([ovs-appctl dpif/show | sed 's/\(dummy-pmd: \).*)/\1<cleared>)/'], [0], [dnl
6599 dummy@ovs-dummy: hit:0 missed:0
6601 br0 65534/100: (dummy)
6602 p1 1/1: (dummy-pmd: <cleared>)
6603 p2 2/2: (dummy-pmd: <cleared>)
6605 br1 65534/101: (dummy)
6611 AT_SETUP([ofproto-dpif - ovs-appctl dpif/dump-flows])
6612 # bump max-idle to avoid the flows being reclaimed behind us
6613 OVS_VSWITCHD_START([add-br br1 -- \
6614 set bridge br1 datapath-type=dummy fail-mode=secure -- \
6615 set Open_vSwitch . other_config:max-idle=10000], [], [],
6616 [--dummy-numa="0,0,0,0,1,1,1,1"])
6618 add_pmd_of_ports br0 2
6621 AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
6622 AT_CHECK([ovs-appctl netdev-dummy/receive p2 'in_port(2),eth(src=50:54:00:00:00:07,dst=50:54:00:00:00:05),eth_type(0x0800),ipv4(src=192.168.0.2,dst=192.168.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=0,code=0)'])
6623 AT_CHECK([ovs-appctl netdev-dummy/receive p3 'in_port(3),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
6624 ovs-appctl revalidator/wait
6625 AT_CHECK([ovs-appctl dpif/dump-flows br0 | strip_ufid | strip_used | sort], [0], [dnl
6626 recirc_id(0),in_port(1),eth_type(0x0800),ipv4(frag=no), packets:0, bytes:0, used:never, actions:drop
6627 recirc_id(0),in_port(2),eth_type(0x0800),ipv4(frag=no), packets:0, bytes:0, used:never, actions:drop
6630 AT_CHECK([ovs-appctl dpif/dump-flows br1 | strip_ufid | strip_used | sort], [0], [dnl
6631 recirc_id(0),in_port(3),eth_type(0x0800),ipv4(frag=no), packets:0, bytes:0, used:never, actions:drop
6634 AT_CHECK([ovs-appctl dpif/dump-flows -m br0 | strip_ufid | strip_used | sort], [0], [dnl
6635 skb_priority(0/0),skb_mark(0/0),recirc_id(0),dp_hash(0/0),in_port(p1),eth(src=50:54:00:00:00:05/00:00:00:00:00:00,dst=50:54:00:00:00:07/00:00:00:00:00:00),eth_type(0x0800),ipv4(src=192.168.0.1/0.0.0.0,dst=192.168.0.2/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no),icmp(type=8/0,code=0/0), packets:0, bytes:0, used:never, actions:drop
6636 skb_priority(0/0),skb_mark(0/0),recirc_id(0),dp_hash(0/0),in_port(p2),eth(src=50:54:00:00:00:07/00:00:00:00:00:00,dst=50:54:00:00:00:05/00:00:00:00:00:00),eth_type(0x0800),ipv4(src=192.168.0.2/0.0.0.0,dst=192.168.0.1/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no),icmp(type=0/0,code=0/0), packets:0, bytes:0, used:never, actions:drop
6639 AT_CHECK([ovs-appctl dpif/dump-flows -m br1 | strip_ufid | strip_used | sort], [0], [dnl
6640 skb_priority(0/0),skb_mark(0/0),recirc_id(0),dp_hash(0/0),in_port(p3),eth(src=50:54:00:00:00:09/00:00:00:00:00:00,dst=50:54:00:00:00:0a/00:00:00:00:00:00),eth_type(0x0800),ipv4(src=10.0.0.2/0.0.0.0,dst=10.0.0.1/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no),icmp(type=8/0,code=0/0), packets:0, bytes:0, used:never, actions:drop
6646 m4_define([OFPROTO_DPIF_GET_FLOW],
6647 [AT_SETUP([ofproto-dpif - ovs-appctl dpif/get-flow$1])
6649 OVS_VSWITCHD_START([add-br br1 -- \
6650 set bridge br1 datapath-type=dummy fail-mode=secure -- \
6651 set Open_vSwitch . other_config:max-idle=10000], [], [],
6652 [m4_if([$1], [], [], [--dummy-numa="0,0,0,0,1,1,1,1"])])
6654 func=`echo -n "$1_" | cut -c 4-`
6655 add_${func}of_ports br0 1 2
6657 AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
6658 ovs-appctl revalidator/wait
6659 AT_CHECK([ovs-appctl dpif/dump-flows -m br0], [0], [stdout])
6661 UFID=`sed -n 's/\(ufid:[[-0-9a-fA-F]]*\).*/\1/p' stdout`
6662 AT_CHECK([ovs-appctl dpctl/get-flow $UFID], [0], [dnl
6663 recirc_id(0),in_port(1),eth_type(0x0800),ipv4(frag=no), packets:0, bytes:0, used:never, actions:drop
6669 OFPROTO_DPIF_GET_FLOW([])
6670 OFPROTO_DPIF_GET_FLOW([ - pmd])
6672 AT_SETUP([ofproto-dpif - MPLS actions that result in a userspace action])
6673 OVS_VSWITCHD_START([dnl
6674 add-port br0 p1 -- set Interface p1 type=dummy
6676 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
6677 on_exit 'kill `cat ovs-ofctl.pid`'
6679 AT_CAPTURE_FILE([ofctl_monitor.log])
6680 AT_DATA([flows.txt], [dnl
6681 dl_src=60:66:66:66:66:00 actions=push_mpls:0x8847,controller
6682 dl_src=60:66:66:66:66:01 actions=pop_mpls:0x8847,controller
6684 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
6686 dnl Packet is sent to userspace because a MPLS push or pop action is applied to
6687 dnl a packet with 2 MPLS LSEs but dpif-netdev can't handle any labels.
6689 dnl The input is a frame with two MPLS labels which tcpdump -vve shows as:
6690 dnl 60:66:66:66:66:00 > 50:54:00:00:00:07, ethertype MPLS unicast (0x8847), length 74: MPLS (label 20, exp 0, ttl 32)
6691 dnl (label 20, exp 0, [S], ttl 32)
6692 dnl (tos 0x0, ttl 64, id 0, offset 0, flags [none], proto TCP (6), length 44, bad cksum 3b78 (->f978)!)
6693 dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x7744 (correct), seq 42:46, win 10000, length 4
6695 for dl_src in 00 01; do
6696 AT_CHECK([ovs-appctl netdev-dummy/receive p1 "505400000007 6066666666$dl_src 8847 00014020 00014120 45 00 00 2c 00 00 00 00 40 06 3b 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45"])
6698 sleep 1 # wait for the datapath flow installed
6699 AT_CHECK_UNQUOTED([strip_ufid < ovs-vswitchd.log | filter_flow_install | strip_used], [0], [dnl
6700 recirc_id(0),in_port(1),eth(src=60:66:66:66:66:00),eth_type(0x8847),mpls(label=20,tc=0,ttl=32,bos=0,label=20,tc=0,ttl=32,bos=1), actions:userspace(pid=0,slow_path(controller))
6701 recirc_id(0),in_port(1),eth(src=60:66:66:66:66:01),eth_type(0x8847),mpls(label=20/0x0,tc=0/0,ttl=32/0x0,bos=0/1,label=20/0xfffff,tc=0/7,ttl=32/0xff,bos=1/1), actions:userspace(pid=0,slow_path(controller))
6708 AT_SETUP([ofproto-dpif - MPLS actions that result in a drop])
6709 OVS_VSWITCHD_START([dnl
6710 add-port br0 p1 -- set Interface p1 type=dummy
6712 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
6713 on_exit 'kill `cat ovs-ofctl.pid`'
6715 AT_CAPTURE_FILE([ofctl_monitor.log])
6716 AT_DATA([flows.txt], [dnl
6717 dl_src=60:66:66:66:66:00 actions=push_mpls:0x8847,controller
6718 dl_src=60:66:66:66:66:01 actions=pop_mpls:0x8847,controller
6720 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
6722 dnl Packet is dropped because an MPLS PUSH action is applied to a packet with
6723 dnl 4 MPLS LSEs but ovs-vswtichd can only handle up to 3 MPLS LSEs and thus
6724 dnl can't determine the resulting MPLS label after MPLS push/pop actions.
6726 dnl The input is a frame with two MPLS headers which tcpdump -vve shows as:
6727 dnl 60:66:66:66:66:01 > 50:54:00:00:00:07, ethertype MPLS unicast (0x8847), length 74: MPLS (label 20, exp 0, ttl 32)
6728 dnl (label 20, exp 0, ttl 32)
6729 dnl (label 20, exp 0, ttl 32)
6730 dnl (label 20, exp 0, [S], ttl 32)
6731 dnl (tos 0x0, ttl 64, id 0, offset 0, flags [none], proto TCP (6), length 44, bad cksum 3b78 (->f978)!)
6732 dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x7744 (correct), seq 42:46, win 10000, length 4
6734 for dl_src in 00 01; do
6735 AT_CHECK([ovs-appctl netdev-dummy/receive p1 "505400000007 6066666666$dl_src 8847 00014020 00014120 45 00 00 2c 00 00 00 00 40 06 3b 78 c0 a8 00 01 c0 a8 00 02 00 50 00 00 00 00 00 2a 00 00 00 2a 50 00 27 10 77 44 00 00 48 4f 47 45"])
6737 sleep 1 # wait for the datapath flow installed
6738 AT_CHECK_UNQUOTED([strip_ufid < ovs-vswitchd.log | filter_flow_install | strip_used], [0], [dnl
6739 recirc_id(0),in_port(1),eth(src=60:66:66:66:66:00),eth_type(0x8847),mpls(label=20,tc=0,ttl=32,bos=0,label=20,tc=0,ttl=32,bos=1), actions:userspace(pid=0,slow_path(controller))
6740 recirc_id(0),in_port(1),eth(src=60:66:66:66:66:01),eth_type(0x8847),mpls(label=20/0x0,tc=0/0,ttl=32/0x0,bos=0/1,label=20/0xfffff,tc=0/7,ttl=32/0xff,bos=1/1), actions:userspace(pid=0,slow_path(controller))
6746 AT_SETUP([ofproto-dpif - patch ports])
6747 OVS_VSWITCHD_START([add-br br1 \
6748 -- set bridge br1 datapath-type=dummy fail-mode=secure \
6749 -- add-port br1 pbr1 -- set int pbr1 type=patch options:peer=pbr0 \
6750 -- add-port br0 pbr0 -- set int pbr0 type=patch options:peer=pbr1])
6755 AT_CHECK([ovs-appctl upcall/disable-ufid], [0], [Datapath dumping tersely using UFID disabled
6757 AT_CHECK([ovs-appctl time/stop])
6758 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
6760 AT_CHECK([ovs-ofctl add-flow br0 actions=LOCAL,output:1,output:2])
6761 AT_CHECK([ovs-ofctl add-flow br1 actions=LOCAL,output:1,output:3])
6763 for i in $(seq 1 10); do
6764 ovs-appctl netdev-dummy/receive br0 'in_port(100),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'
6765 if [[ $i -eq 1 ]]; then
6770 for i in $(seq 1 5); do
6771 ovs-appctl netdev-dummy/receive br1 'in_port(101),eth(src=50:54:00:00:00:07,dst=50:54:00:00:00:05),eth_type(0x0800),ipv4(src=192.168.0.2,dst=192.168.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'
6772 if [[ $i -eq 1 ]]; then
6777 AT_CHECK([ovs-appctl time/warp 500], [0],
6780 sleep 1 # wait for log writer
6782 AT_CHECK([ovs-appctl dpif/show], [0], [dnl
6783 dummy@ovs-dummy: hit:13 missed:2
6785 br0 65534/100: (dummy)
6787 pbr0 1/none: (patch: peer=pbr1)
6789 br1 65534/101: (dummy)
6791 pbr1 1/none: (patch: peer=pbr0)
6794 AT_CHECK([strip_ufid < ovs-vswitchd.log | filter_flow_install | strip_used], [0], [dnl
6795 recirc_id(0),in_port(100),eth_type(0x0800),ipv4(frag=no), actions:101,3,2
6796 recirc_id(0),in_port(101),eth_type(0x0800),ipv4(frag=no), actions:100,2,3
6799 AT_CHECK([grep -e 'in_port(100).*packets:9' ovs-vswitchd.log | strip_ufid | filter_flow_dump], [0], [dnl
6800 skb_priority(0/0),skb_mark(0/0),recirc_id(0),dp_hash(0/0),in_port(100),eth(src=50:54:00:00:00:05/00:00:00:00:00:00,dst=50:54:00:00:00:07/00:00:00:00:00:00),eth_type(0x0800),ipv4(src=192.168.0.1/0.0.0.0,dst=192.168.0.2/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no),icmp(type=8/0,code=0/0), packets:9, bytes:540, used:0.0s, actions:101,3,2
6802 AT_CHECK([grep -e 'in_port(101).*packets:4' ovs-vswitchd.log | strip_ufid | filter_flow_dump], [0], [dnl
6803 skb_priority(0/0),skb_mark(0/0),recirc_id(0),dp_hash(0/0),in_port(101),eth(src=50:54:00:00:00:07/00:00:00:00:00:00,dst=50:54:00:00:00:05/00:00:00:00:00:00),eth_type(0x0800),ipv4(src=192.168.0.2/0.0.0.0,dst=192.168.0.1/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no),icmp(type=8/0,code=0/0), packets:4, bytes:240, used:0.0s, actions:100,2,3
6806 AT_CHECK([ovs-ofctl dump-ports br0 pbr0], [0], [dnl
6807 OFPST_PORT reply (xid=0x4): 1 ports
6808 port 1: rx pkts=5, bytes=300, drop=?, errs=?, frame=?, over=?, crc=?
6809 tx pkts=10, bytes=600, drop=?, errs=?, coll=?
6812 AT_CHECK([ovs-ofctl dump-ports br1 pbr1], [0], [dnl
6813 OFPST_PORT reply (xid=0x4): 1 ports
6814 port 1: rx pkts=10, bytes=600, drop=?, errs=?, frame=?, over=?, crc=?
6815 tx pkts=5, bytes=300, drop=?, errs=?, coll=?
6821 AT_SETUP([ofproto-dpif - patch ports - stack])
6822 OVS_VSWITCHD_START([add-br br1 \
6823 -- set bridge br1 datapath-type=dummy fail-mode=secure \
6824 -- add-port br1 pbr1 -- set int pbr1 type=patch options:peer=pbr0 \
6825 -- add-port br0 pbr0 -- set int pbr0 type=patch options:peer=pbr1])
6830 AT_CHECK([ovs-appctl upcall/disable-ufid], [0], [Datapath dumping tersely using UFID disabled
6832 AT_CHECK([ovs-appctl time/stop])
6833 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
6835 AT_CHECK([ovs-ofctl add-flow br0 "ip actions=push:OXM_OF_IN_PORT[[0..31]],output:1,pop:OXM_OF_IPV4_SRC[[0..31]],output:2"])
6836 # Try to pop from empty stack, and push and leave data to stack.
6837 AT_CHECK([ovs-ofctl add-flow br1 "ip actions=pop:OXM_OF_IPV4_DST[[0..31]],push:NXM_NX_REG1[[0..31]],LOCAL"])
6839 ovs-appctl netdev-dummy/receive br0 'in_port(100),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'
6841 AT_CHECK([ovs-appctl time/warp 500], [0],
6845 OVS_WAIT_UNTIL([test `grep flow_add ovs-vswitchd.log | wc -l` -ge 1])
6847 AT_CHECK([ovs-appctl dpif/show], [0], [dnl
6848 dummy@ovs-dummy: hit:0 missed:1
6850 br0 65534/100: (dummy)
6852 pbr0 1/none: (patch: peer=pbr1)
6854 br1 65534/101: (dummy)
6856 pbr1 1/none: (patch: peer=pbr0)
6859 AT_CHECK([strip_ufid < ovs-vswitchd.log | filter_flow_install | strip_used], [0], [dnl
6860 recirc_id(0),in_port(100),eth_type(0x0800),ipv4(src=192.168.0.1,frag=no), actions:101,set(ipv4(src=255.255.255.254)),2
6863 AT_CHECK([grep -e '|nx_match|WARN|' ovs-vswitchd.log | sed "s/^.*|WARN|//"], [0], [dnl
6864 Failed to pop from an empty stack. On flow
6867 OVS_VSWITCHD_STOP(["/Failed to pop from an empty stack/d"])
6870 AT_SETUP([ofproto-dpif - port duration])
6871 OVS_VSWITCHD_START([set Bridge br0 protocols=OpenFlow13])
6872 add_of_ports br0 1 2
6874 ovs-appctl time/stop
6875 ovs-appctl time/warp 10000
6877 AT_CHECK([ovs-ofctl -O openflow13 dump-ports br0], [0], [stdout])
6878 AT_CHECK([sed -n 's/=[[0-9]][[0-9]]\(\.[[0-9]][[0-9]]*\)\{0,1\}s/=?s/p' stdout], [0],
6887 dnl ----------------------------------------------------------------------
6888 AT_BANNER([ofproto-dpif -- megaflows])
6890 AT_SETUP([ofproto-dpif megaflow - port classification])
6892 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
6893 add_of_ports br0 1 2
6894 AT_DATA([flows.txt], [dnl
6895 table=0 in_port=1 actions=output(2)
6897 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
6898 AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
6900 AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.4,dst=10.0.0.3,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
6902 AT_CHECK([filter_flow_install < ovs-vswitchd.log | strip_xout], [0], [dnl
6903 recirc_id(0),in_port(1),eth_type(0x0800),ipv4(frag=no), actions: <del>
6908 AT_SETUP([ofproto-dpif megaflow - L2 classification])
6910 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
6911 add_of_ports br0 1 2
6912 AT_DATA([flows.txt], [dnl
6913 table=0 in_port=1,dl_src=50:54:00:00:00:09 actions=output(2)
6915 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
6916 AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
6917 AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.4,dst=10.0.0.3,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
6919 AT_CHECK([filter_flow_install < ovs-vswitchd.log | strip_xout], [0], [dnl
6920 recirc_id(0),in_port(1),eth(src=50:54:00:00:00:09),eth_type(0x0800),ipv4(frag=no), actions: <del>
6921 recirc_id(0),in_port(1),eth(src=50:54:00:00:00:0b),eth_type(0x0800),ipv4(frag=no), actions: <del>
6926 AT_SETUP([ofproto-dpif megaflow - L3 classification])
6928 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
6929 add_of_ports br0 1 2
6930 AT_CHECK([ovs-vsctl set Bridge br0 flow_tables:0=@N1 -- --id=@N1 create Flow_Table name=t0 prefixes=nw_dst,nw_src], [0], [ignore], [])
6931 AT_DATA([flows.txt], [dnl
6932 table=0 in_port=1,icmp,nw_src=10.0.0.4 actions=output(2)
6934 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
6935 AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
6936 AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.4,dst=10.0.0.3,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
6938 AT_CHECK([filter_flow_install < ovs-vswitchd.log | strip_xout], [0], [dnl
6939 recirc_id(0),in_port(1),eth_type(0x0800),ipv4(src=10.0.0.2/255.255.255.252,frag=no), actions: <del>
6940 recirc_id(0),in_port(1),eth_type(0x0800),ipv4(src=10.0.0.4,proto=1,frag=no), actions: <del>
6945 AT_SETUP([ofproto-dpif megaflow - IPv6 classification])
6947 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
6948 add_of_ports br0 1 2
6949 AT_CHECK([ovs-vsctl set Bridge br0 flow_tables:0=@N1 -- --id=@N1 create Flow_Table name=t0 prefixes=ipv6_dst,ipv6_src], [0], [ignore], [])
6950 AT_DATA([flows.txt], [dnl
6951 table=0 in_port=1,ipv6,ipv6_src=2001:db8:3c4d:1:2:3:4:5 actions=output(2)
6953 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
6954 AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:07,dst=50:54:00:00:00:05),eth_type(0x86dd),ipv6(src=2001:db8:3c4d:1:2:3:4:5,dst=fe80::2,label=0,proto=10,tclass=0x70,hlimit=128,frag=no)'])
6955 AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x86dd),ipv6(src=2001:db8:3c4d:5:4:3:2:1,dst=2001:db8:3c4d:1:2:3:4:1,label=0,proto=99,tclass=0x70,hlimit=64,frag=no)'])
6957 AT_CHECK([filter_flow_install < ovs-vswitchd.log | strip_xout], [0], [dnl
6958 recirc_id(0),in_port(1),eth_type(0x86dd),ipv6(src=2001:db8:3c4d:1:2:3:4:5,frag=no), actions: <del>
6959 recirc_id(0),in_port(1),eth_type(0x86dd),ipv6(src=2001:db8:3c4d:5:4:3:2:1/ffff:ffff:ffff:fffc::,frag=no), actions: <del>
6964 AT_SETUP([ofproto-dpif megaflow - L4 classification])
6966 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
6967 add_of_ports br0 1 2
6968 AT_DATA([flows.txt], [dnl
6969 table=0 in_port=1,icmp,icmp_type=8 actions=output(2)
6971 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
6972 AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
6974 AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.4,dst=10.0.0.3,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
6976 AT_CHECK([filter_flow_install < ovs-vswitchd.log | strip_xout], [0], [dnl
6977 recirc_id(0),in_port(1),eth_type(0x0800),ipv4(proto=1,frag=no),icmp(type=8), actions: <del>
6982 m4_define([OFPROTO_DPIF_MEGAFLOW_NORMAL],
6983 [AT_SETUP([ofproto-dpif megaflow - normal$1])
6984 OVS_VSWITCHD_START([], [], [], [m4_if([$1], [], [], [--dummy-numa="0,0,0,0,1,1,1,1"])])
6985 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
6986 func=`echo -n "$1_" | cut -c 4-`
6987 add_${func}of_ports br0 1 2
6988 AT_CHECK([ovs-ofctl add-flow br0 action=normal])
6989 AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
6990 AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.4,dst=10.0.0.3,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
6992 AT_CHECK([filter_flow_install < ovs-vswitchd.log | strip_xout], [0], [dnl
6993 recirc_id(0),in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(frag=no), actions: <del>
6994 recirc_id(0),in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(frag=no), actions: <del>
6999 OFPROTO_DPIF_MEGAFLOW_NORMAL([])
7000 OFPROTO_DPIF_MEGAFLOW_NORMAL([ - pmd])
7002 AT_SETUP([ofproto-dpif megaflow - mpls])
7004 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
7005 add_of_ports br0 1 2
7006 AT_DATA([flows.txt], [dnl
7007 table=0 dl_src=50:54:00:00:00:09 actions=push_mpls:0x8847,2
7008 table=0 dl_src=50:54:00:00:00:0b actions=pop_mpls:0x0800,2
7010 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
7011 AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x8847),mpls(label=11,tc=3,ttl=64,bos=1)'])
7012 AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0a),eth_type(0x8847),mpls(label=11,tc=3,ttl=64,bos=1)'])
7014 AT_CHECK([filter_flow_install < ovs-vswitchd.log | strip_xout_keep_actions], [0], [dnl
7015 recirc_id(0),in_port(1),eth(src=50:54:00:00:00:09),eth_type(0x8847),mpls(label=11,tc=3,ttl=64,bos=1), actions:push_mpls(label=11,tc=3,ttl=64,bos=0,eth_type=0x8847),2
7016 recirc_id(0),in_port(1),eth(src=50:54:00:00:00:0b),eth_type(0x8847),mpls(label=11/0x0,tc=3/0,ttl=64/0x0,bos=1/1), actions:pop_mpls(eth_type=0x800),2
7021 # CHECK_MEGAFLOW_NETFLOW(LOOPBACK_ADDR)
7022 m4_define([CHECK_MEGAFLOW_NETFLOW],
7024 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
7025 add_of_ports br0 1 2
7027 dnl NetFlow configuration disables wildcarding relevant fields
7028 on_exit 'kill `cat test-netflow.pid`'
7029 AT_CHECK([ovstest test-netflow --log-file --detach --no-chdir --pidfile 0:$1 > netflow.log], [0], [], [ignore])
7030 AT_CAPTURE_FILE([netflow.log])
7031 PARSE_LISTENING_PORT([test-netflow.log], [NETFLOW_PORT])
7033 set Bridge br0 netflow=@nf -- \
7034 --id=@nf create NetFlow targets=\"$1:$NETFLOW_PORT\" \
7035 engine_id=1 engine_type=2 active_timeout=30 add-id-to-interface=false
7037 AT_CHECK([ovs-ofctl add-flow br0 action=normal])
7038 AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
7039 AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.4,dst=10.0.0.3,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
7041 AT_CHECK([filter_flow_install < ovs-vswitchd.log | strip_xout], [0], [dnl
7042 recirc_id(0),in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0/0xfc,frag=no),icmp(type=8,code=0), actions: <del>
7043 recirc_id(0),in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.4,dst=10.0.0.3,proto=1,tos=0/0xfc,frag=no),icmp(type=8,code=0), actions: <del>
7045 OVS_APP_EXIT_AND_WAIT([test-netflow])
7048 AT_SETUP([ofproto-dpif megaflow - netflow - IPv4 collector])
7049 CHECK_MEGAFLOW_NETFLOW([127.0.0.1], [IPv4])
7052 AT_SETUP([ofproto-dpif megaflow - netflow - IPv6 collector])
7053 AT_SKIP_IF([test $HAVE_IPV6 = no])
7054 CHECK_MEGAFLOW_NETFLOW([[[::1]]], [IPv6])
7057 m4_define([OFPROTO_DPIF_MEGAFLOW_NORMAL_ACB_BOND],
7058 [AT_SETUP([ofproto-dpif megaflow - normal, active-backup bonding - $1])
7060 [add-port br0 p1 -- set Interface p1 type=$1 ofport_request=1 -- \
7061 add-bond br0 bond0 p2 p3 bond_mode=active-backup -- \
7062 set interface p2 type=$1 ofport_request=2 -- \
7063 set interface p3 type=$1 ofport_request=3], [], [],
7064 [m4_if([$1], [dummy-pmd], [--dummy-numa="0,0,0,0,1,1,1,1"], [])])
7065 AT_CHECK([ovs-appctl netdev-dummy/set-admin-state up], 0, [OK
7067 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
7069 AT_CHECK([ovs-ofctl add-flow br0 action=normal])
7070 AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
7071 AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.4,dst=10.0.0.3,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
7073 AT_CHECK([filter_flow_install < ovs-vswitchd.log | strip_xout], [0], [dnl
7074 recirc_id(0),in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(frag=no), actions: <del>
7075 recirc_id(0),in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(frag=no), actions: <del>
7080 OFPROTO_DPIF_MEGAFLOW_NORMAL_ACB_BOND([dummy])
7081 OFPROTO_DPIF_MEGAFLOW_NORMAL_ACB_BOND([dummy-pmd])
7083 AT_SETUP([ofproto-dpif megaflow - normal, balance-slb bonding])
7085 [add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1 -- \
7086 add-bond br0 bond0 p2 p3 bond_mode=balance-slb -- \
7087 set interface p2 type=dummy ofport_request=2 -- \
7088 set interface p3 type=dummy ofport_request=3])
7089 AT_CHECK([ovs-appctl netdev-dummy/set-admin-state up], 0, [OK
7091 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
7093 AT_CHECK([ovs-ofctl add-flow br0 action=normal])
7094 AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
7095 AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.4,dst=10.0.0.3,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
7097 AT_CHECK([filter_flow_install < ovs-vswitchd.log | strip_xout], [0], [dnl
7098 recirc_id(0),in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(frag=no), actions: <del>
7099 recirc_id(0),in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(frag=no), actions: <del>
7104 AT_SETUP([ofproto-dpif megaflow - normal, balance-tcp bonding])
7105 # Create bond0 on br0 with interfaces p0 and p1
7106 # and bond1 on br1 with interfaces p2 and p3
7107 # with p0 patched to p2 and p1 patched to p3.
7109 [add-bond br0 bond0 p0 p1 bond_mode=balance-tcp lacp=active \
7110 other-config:lacp-time=fast \
7111 other-config:bond-rebalance-interval=0 -- \
7112 set interface p0 type=patch options:peer=p2 ofport_request=1 -- \
7113 set interface p1 type=patch options:peer=p3 ofport_request=2 -- \
7115 set bridge br1 other-config:hwaddr=aa:66:aa:66:00:00 -- \
7116 set bridge br1 datapath-type=dummy other-config:datapath-id=1234 \
7117 fail-mode=secure -- \
7118 add-bond br1 bond1 p2 p3 bond_mode=balance-tcp lacp=active \
7119 other-config:lacp-time=fast \
7120 other-config:bond-rebalance-interval=0 -- \
7121 set interface p2 type=patch options:peer=p0 ofport_request=3 -- \
7122 set interface p3 type=patch options:peer=p1 ofport_request=4 --])
7124 AT_CHECK([ovs-appctl netdev-dummy/set-admin-state up], 0, [OK
7126 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
7128 AT_CHECK([ovs-ofctl add-flow br0 action=normal])
7129 AT_CHECK([ovs-ofctl add-flow br1 action=normal])
7130 ovs-appctl time/stop
7131 ovs-appctl time/warp 5000
7132 AT_CHECK([ovs-appctl netdev-dummy/receive p7 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
7133 AT_CHECK([ovs-appctl netdev-dummy/receive p7 'in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.4,dst=10.0.0.3,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
7135 AT_CHECK([filter_flow_install < ovs-vswitchd.log | strip_xout], [0], [dnl
7136 recirc_id(0),in_port(7),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(frag=no), actions: <del>
7137 recirc_id(0),in_port(7),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(frag=no), actions: <del>
7142 AT_SETUP([ofproto-dpif megaflow - resubmit port action])
7144 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
7145 add_of_ports br0 1 2
7146 AT_DATA([flows.txt], [dnl
7147 table=0 in_port=1,ip actions=resubmit(90)
7148 table=0 in_port=90,dl_src=50:54:00:00:00:09 actions=output(2)
7150 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
7151 AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
7152 AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.4,dst=10.0.0.3,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
7154 AT_CHECK([filter_flow_install < ovs-vswitchd.log | strip_xout], [0], [dnl
7155 recirc_id(0),in_port(1),eth(src=50:54:00:00:00:09),eth_type(0x0800),ipv4(frag=no), actions: <del>
7156 recirc_id(0),in_port(1),eth(src=50:54:00:00:00:0b),eth_type(0x0800),ipv4(frag=no), actions: <del>
7161 AT_SETUP([ofproto-dpif megaflow - resubmit table action])
7163 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
7164 add_of_ports br0 1 2
7165 AT_DATA([flows.txt], [dnl
7166 table=0 in_port=1,ip actions=resubmit(,1)
7167 table=1 dl_src=50:54:00:00:00:09 actions=output(2)
7169 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
7170 AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
7171 AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.4,dst=10.0.0.3,proto=
7172 1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
7174 AT_CHECK([filter_flow_install < ovs-vswitchd.log | strip_xout], [0], [dnl
7175 recirc_id(0),in_port(1),eth(src=50:54:00:00:00:09),eth_type(0x0800),ipv4(frag=no), actions: <del>
7176 recirc_id(0),in_port(1),eth(src=50:54:00:00:00:0b),eth_type(0x0800),ipv4(frag=no), actions: <del>
7181 AT_SETUP([ofproto-dpif megaflow - goto_table action])
7183 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
7184 add_of_ports br0 1 2
7185 AT_DATA([flows.txt], [dnl
7186 table=0 in_port=1,ip actions=goto_table(1)
7187 table=1 dl_src=50:54:00:00:00:09 actions=output(2)
7189 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flows br0 flows.txt])
7190 AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
7191 AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.4,dst=10.0.0.3,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
7193 AT_CHECK([filter_flow_install < ovs-vswitchd.log | strip_xout], [0], [dnl
7194 recirc_id(0),in_port(1),eth(src=50:54:00:00:00:09),eth_type(0x0800),ipv4(frag=no), actions: <del>
7195 recirc_id(0),in_port(1),eth(src=50:54:00:00:00:0b),eth_type(0x0800),ipv4(frag=no), actions: <del>
7200 AT_SETUP([ofproto-dpif megaflow - mirroring, select_all])
7201 AT_KEYWORDS([mirror mirrors mirroring])
7203 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
7204 add_of_ports br0 1 2 3
7206 set Bridge br0 mirrors=@m --\
7207 --id=@p3 get Port p3 --\
7208 --id=@m create Mirror name=mymirror select_all=true output_port=@p3
7210 AT_DATA([flows.txt], [dnl
7211 in_port=1 actions=output:2
7213 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
7214 AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
7216 AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.4,dst=10.0.0.3,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
7218 AT_CHECK([filter_flow_install < ovs-vswitchd.log | strip_xout], [0], [dnl
7219 recirc_id(0),in_port(1),eth_type(0x0800),ipv4(frag=no), actions: <del>
7224 AT_SETUP([ofproto-dpif megaflow - mirroring, select_vlan])
7226 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
7227 add_of_ports br0 1 2 3
7229 set Bridge br0 mirrors=@m --\
7230 --id=@p2 get Port p2 -- --id=@p3 get Port p3 --\
7231 --id=@m create Mirror name=mymirror select_all=true select_vlan=11 output_port=@p3
7233 AT_DATA([flows.txt], [dnl
7234 in_port=1 actions=output:2
7236 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
7237 AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x8100),vlan(vid=11,pcp=7),encap(eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0))'])
7238 AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.4,dst=10.0.0.3,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
7240 AT_CHECK([filter_flow_install < ovs-vswitchd.log | strip_xout], [0], [dnl
7241 recirc_id(0),in_port(1),eth_type(0x0800),ipv4(frag=no), actions: <del>
7242 recirc_id(0),in_port(1),eth_type(0x8100),vlan(vid=11,pcp=7/0x0),encap(eth_type(0x0800),ipv4(frag=no)), actions: <del>
7247 AT_SETUP([ofproto-dpif megaflow - move action])
7249 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
7250 add_of_ports br0 1 2
7251 AT_DATA([flows.txt], [dnl
7252 table=0 in_port=1 ip,actions=move:NXM_OF_IP_SRC[[]]->NXM_NX_REG0[[]],resubmit(90)
7253 table=0 in_port=90 ip,actions=move:NXM_NX_REG0[[]]->NXM_NX_REG1[[]],resubmit(91)
7254 table=0 in_port=91 reg0=0x0a000002,actions=output(2)
7256 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
7257 AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
7258 AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.4,dst=10.0.0.3,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
7260 AT_CHECK([filter_flow_install < ovs-vswitchd.log | strip_xout], [0], [dnl
7261 recirc_id(0),in_port(1),eth_type(0x0800),ipv4(src=10.0.0.2,frag=no), actions: <del>
7262 recirc_id(0),in_port(1),eth_type(0x0800),ipv4(src=10.0.0.4,frag=no), actions: <del>
7267 AT_SETUP([ofproto-dpif megaflow - push action])
7269 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
7270 add_of_ports br0 1 2
7271 AT_DATA([flows.txt], [dnl
7272 table=0 in_port=1 ip,actions=push:NXM_OF_IP_SRC[[]],output(2)
7274 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
7275 AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
7276 AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.4,dst=10.0.0.3,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
7278 AT_CHECK([filter_flow_install < ovs-vswitchd.log | strip_xout], [0], [dnl
7279 recirc_id(0),in_port(1),eth_type(0x0800),ipv4(src=10.0.0.2,frag=no), actions: <del>
7280 recirc_id(0),in_port(1),eth_type(0x0800),ipv4(src=10.0.0.4,frag=no), actions: <del>
7285 AT_SETUP([ofproto-dpif megaflow - learning])
7287 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
7288 add_of_ports br0 1 2
7289 AT_DATA([flows.txt], [dnl
7290 table=0 in_port=1 actions=load:2->NXM_NX_REG0[[0..15]],learn(table=1,priority=65535,NXM_OF_ETH_SRC[[]],NXM_OF_VLAN_TCI[[0..11]],output:NXM_NX_REG0[[0..15]]),output:2
7292 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
7293 ovs-appctl time/stop
7294 # We send each packet twice because the first packet in each flow causes the
7295 # flow table to change and thus revalidations, which (depending on timing)
7296 # can keep a megaflow from being installed. The revalidations are done by
7297 # the second iteration, allowing the flows to be installed.
7299 AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
7300 AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.4,dst=10.0.0.3,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
7301 ovs-appctl time/warp 100
7304 dnl The original flow is missing due to a revalidation.
7305 AT_CHECK([filter_flow_install < ovs-vswitchd.log | strip_xout], [0], [dnl
7306 recirc_id(0),in_port(1),eth(src=50:54:00:00:00:09),eth_type(0x0800),ipv4(frag=no), actions: <del>
7307 recirc_id(0),in_port(1),eth(src=50:54:00:00:00:0b),eth_type(0x0800),ipv4(frag=no), actions: <del>
7312 AT_SETUP([ofproto-dpif megaflow - tunnels])
7314 [add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1])
7315 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
7316 AT_CHECK([ovs-vsctl add-port br0 p2 -- set Interface p2 type=gre \
7317 options:remote_ip=1.1.1.1 ofport_request=2 options:key=flow])
7318 AT_CHECK([ovs-vsctl add-port br0 p3 -- set Interface p3 type=dummy \
7320 AT_CHECK([ovs-vsctl add-port br0 p4 -- set Interface p4 type=gre \
7321 options:remote_ip=1.1.1.2 options:tos=inherit options:ttl=inherit \
7322 ofport_request=4 options:key=flow])
7323 AT_DATA([flows.txt], [dnl
7324 in_port=1,actions=output(2)
7325 in_port=3,actions=output(4)
7327 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
7328 dnl ECN bits are always copied out, but don't use 0x3 (CE), since that
7329 dnl will cause the packet to be dropped.
7330 AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0xfd,ttl=128,frag=no),icmp(type=8,code=0)'])
7332 AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.4,dst=10.0.0.3,proto=1,tos=0x1,ttl=64,frag=no),icmp(type=8,code=0)'])
7333 AT_CHECK([ovs-appctl netdev-dummy/receive p3 'in_port(3),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0xfd,ttl=128,frag=no),icmp(type=8,code=0)'])
7335 AT_CHECK([ovs-appctl netdev-dummy/receive p3 'in_port(3),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.4,dst=10.0.0.3,proto=1,tos=0x1,ttl=64,frag=no),icmp(type=8,code=0)'])
7337 AT_CHECK([filter_flow_install < ovs-vswitchd.log | strip_xout], [0], [dnl
7338 recirc_id(0),in_port(1),eth_type(0x0800),ipv4(tos=0xfd/0x3,frag=no), actions: <del>
7339 recirc_id(0),in_port(3),eth_type(0x0800),ipv4(tos=0x1,ttl=64,frag=no), actions: <del>
7340 recirc_id(0),in_port(3),eth_type(0x0800),ipv4(tos=0xfd,ttl=128,frag=no), actions: <del>
7345 AT_SETUP([ofproto-dpif megaflow - dec_ttl])
7347 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
7348 add_of_ports br0 1 2
7349 AT_CHECK([ovs-vsctl set Bridge br0 flow_tables:0=@N1 -- --id=@N1 create Flow_Table name=t0 prefixes=nw_dst,nw_src], [0], [ignore], [])
7350 AT_DATA([flows.txt], [dnl
7351 table=0 in_port=1,icmp,nw_src=10.0.0.4 actions=dec_ttl,output(2)
7353 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
7354 AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
7355 AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.4,dst=10.0.0.3,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
7357 AT_CHECK([filter_flow_install < ovs-vswitchd.log | strip_xout], [0], [dnl
7358 recirc_id(0),in_port(1),eth_type(0x0800),ipv4(src=10.0.0.2/255.255.255.252,frag=no), actions: <del>
7359 recirc_id(0),in_port(1),eth_type(0x0800),ipv4(src=10.0.0.4,proto=1,ttl=64,frag=no), actions: <del>
7364 AT_SETUP([ofproto-dpif megaflow - set dl_dst])
7366 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
7367 add_of_ports br0 1 2
7368 AT_DATA([flows.txt], [dnl
7369 table=0 in_port=1 actions=mod_dl_dst(50:54:00:00:00:0a),output(2)
7371 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
7372 AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
7373 AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.4,dst=10.0.0.3,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
7375 dnl The first packet is essentially a no-op, as the new destination MAC is the
7376 dnl same as the original. The second entry actually updates the destination
7378 AT_CHECK([strip_ufid < ovs-vswitchd.log | filter_flow_install | strip_used], [0], [dnl
7379 recirc_id(0),in_port(1),eth(dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(frag=no), actions:2
7380 recirc_id(0),in_port(1),eth(dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(frag=no), actions:set(eth(dst=50:54:00:00:00:0a)),2
7385 m4_define([OFPROTO_DPIF_MEGAFLOW_DISABLED],
7386 [AT_SETUP([ofproto-dpif megaflow - disabled$1])
7387 OVS_VSWITCHD_START([], [], [], [m4_if([$1], [], [], [--dummy-numa="0,0,0,0,1,1,1,1"])])
7388 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
7389 func=`echo -n "$1_" | cut -c 4-`
7390 add_${func}of_ports br0 1 2
7391 AT_DATA([flows.txt], [dnl
7392 table=0 in_port=1,ip,nw_dst=10.0.0.1 actions=output(2)
7393 table=0 in_port=1,ip,nw_dst=10.0.0.3 actions=drop
7395 AT_CHECK([ovs-appctl upcall/disable-megaflows], [0], [megaflows disabled
7397 AT_CHECK([ovs-appctl upcall/disable-ufid], [0], [Datapath dumping tersely using UFID disabled
7399 AT_CHECK([ovs-appctl vlog/set dpif_netdev:dbg], [0], [], [])
7400 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
7401 for i in 1 2 3 4; do
7402 AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
7403 AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.4,dst=10.0.0.3,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
7404 if [[ $i -eq 1 ]]; then
7409 AT_CHECK([strip_ufid < ovs-vswitchd.log | filter_flow_install | strip_used], [0], [dnl
7410 skb_priority(0),skb_mark(0),recirc_id(0),dp_hash(0),in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0), actions:2
7411 skb_priority(0),skb_mark(0),recirc_id(0),dp_hash(0),in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.4,dst=10.0.0.3,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0), actions:drop
7413 AT_CHECK([strip_ufid < ovs-vswitchd.log | filter_flow_dump | grep 'packets:3'], [0], [dnl
7414 skb_priority(0),skb_mark(0),recirc_id(0),dp_hash(0),in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0), packets:3, bytes:180, used:0.0s, actions:2
7415 skb_priority(0),skb_mark(0),recirc_id(0),dp_hash(0),in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.4,dst=10.0.0.3,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0), packets:3, bytes:180, used:0.0s, actions:drop
7420 OFPROTO_DPIF_MEGAFLOW_DISABLED([])
7421 OFPROTO_DPIF_MEGAFLOW_DISABLED([ - pmd])
7423 AT_SETUP([ofproto-dpif - datapath port number change])
7424 OVS_VSWITCHD_START([set Bridge br0 fail-mode=standalone])
7427 # Trace a flow that should output to p1.
7428 AT_CHECK([ovs-appctl ofproto/trace br0 in_port=LOCAL,dl_src=10:20:30:40:50:60],
7430 AT_CHECK([tail -1 stdout], [0], [Datapath actions: 1
7433 # Change p1's port number to 5.
7434 AT_CHECK([ovs-appctl dpif-dummy/change-port-number ovs-dummy p1 5])
7436 # Trace a flow that should output to p1 in its new location.
7437 AT_CHECK([ovs-appctl ofproto/trace br0 in_port=LOCAL,dl_src=10:20:30:40:50:60],
7439 AT_CHECK([tail -1 stdout], [0], [Datapath actions: 5
7444 # Tests the bundling with various bfd and cfm configurations.
7445 AT_SETUP([ofproto - bundle with variable bfd/cfm config])
7446 OVS_VSWITCHD_START([add-br br1 -- set bridge br1 datapath-type=dummy -- \
7447 add-bond br0 br0bond p0 p2 bond-mode=active-backup -- \
7448 add-bond br1 br1bond p1 p3 bond-mode=active-backup -- \
7449 set Interface p1 type=patch options:peer=p0 ofport_request=2 -- \
7450 set Interface p3 type=patch options:peer=p2 ofport_request=4 -- \
7451 set Interface p0 type=patch options:peer=p1 ofport_request=1 -- \
7452 set Interface p2 type=patch options:peer=p3 ofport_request=3 -- \
7453 set Interface p0 bfd:enable=true bfd:min_tx=300 bfd:min_rx=300 -- \
7454 set Interface p0 cfm_mpid=1 -- \
7455 set Interface p1 bfd:enable=true bfd:min_tx=500 bfd:min_rx=500])
7457 ovs-appctl time/stop
7458 # advance the clock to stablize everything.
7459 ovs-appctl time/warp 5000 100
7460 # cfm/show should show 'recv' fault.
7461 AT_CHECK([ovs-appctl cfm/show | sed -n '/^.*fault:.*/p'], [0], [dnl
7464 # bfd/show should show 'up'.
7465 AT_CHECK([ovs-appctl bfd/show | sed -n '/^.*Session State:.*/p'], [0], [dnl
7466 Local Session State: up
7467 Remote Session State: up
7468 Local Session State: up
7469 Remote Session State: up
7471 # bond/show should show 'may-enable: true' for all slaves.
7472 AT_CHECK([ovs-appctl bond/show | sed -n '/^.*may_enable:.*/p'], [0], [dnl
7479 # now disable the bfd on p1.
7480 AT_CHECK([ovs-vsctl set Interface p1 bfd:enable=false])
7481 # advance the clock to stablize everything.
7482 ovs-appctl time/warp 5000 100
7483 # cfm/show should show 'recv' fault.
7484 AT_CHECK([ovs-appctl cfm/show | sed -n '/^.*fault:.*/p'], [0], [dnl
7487 # bfd/show should show 'down'.
7488 AT_CHECK([ovs-appctl bfd/show | sed -n '/^.*Session State:.*/p'], [0], [dnl
7489 Local Session State: down
7490 Remote Session State: down
7492 # bond/show should show 'may-enable: false' for p0.
7493 AT_CHECK([ovs-appctl bond/show br0bond | sed -n '/^.*may_enable:.*/p'], [0], [dnl
7498 # now enable the bfd on p1 and disable bfd on p0.
7499 AT_CHECK([ovs-vsctl set Interface p1 bfd:enable=true])
7500 AT_CHECK([ovs-vsctl set Interface p0 bfd:enable=false])
7501 # advance the clock to stablize everything.
7502 ovs-appctl time/warp 5000 100
7503 # cfm/show should show 'recv' fault.
7504 AT_CHECK([ovs-appctl cfm/show | sed -n '/^.*fault:.*/p'], [0], [dnl
7507 # bfd/show should show 'down'.
7508 AT_CHECK([ovs-appctl bfd/show | sed -n '/^.*Session State:.*/p'], [0], [dnl
7509 Local Session State: down
7510 Remote Session State: down
7512 # bond/show should show 'may-enable: false' for p0 and p1.
7513 AT_CHECK([ovs-appctl bond/show | sed -n '/^.*may_enable:.*/p'], [0], [dnl
7523 AT_SETUP([ofproto-dpif - ofproto-dpif-monitor 1])
7524 OVS_VSWITCHD_START([add-port br0 p0 -- set interface p0 type=gre options:remote_ip=1.2.3.4])
7527 AT_CHECK([ovs-vsctl set interface p0 bfd:enable=true])
7529 OVS_WAIT_UNTIL([grep "monitor thread created" ovs-vswitchd.log])
7530 # disable bfd on p0.
7531 AT_CHECK([ovs-vsctl set interface p0 bfd:enable=false])
7533 OVS_WAIT_UNTIL([grep "monitor thread terminated" ovs-vswitchd.log])
7534 AT_CHECK([sed -e '/^.*ofproto_dpif_monitor.*$/d' < ovs-vswitchd.log > tmp && ovs-appctl vlog/close && mv tmp ovs-vswitchd.log && ovs-appctl vlog/reopen])
7537 AT_CHECK([ovs-vsctl set interface p0 cfm_mpid=10])
7539 OVS_WAIT_UNTIL([grep "monitor thread created" ovs-vswitchd.log])
7540 # disable cfm on p0.
7541 AT_CHECK([ovs-vsctl remove interface p0 cfm_mpid 10])
7543 OVS_WAIT_UNTIL([grep "monitor thread terminated" ovs-vswitchd.log])
7544 AT_CHECK([sed -e '/^.*ofproto_dpif_monitor.*$/d' < ovs-vswitchd.log > tmp && ovs-appctl vlog/close && mv tmp ovs-vswitchd.log && ovs-appctl vlog/reopen])
7546 # enable both bfd and cfm on p0.
7547 AT_CHECK([ovs-vsctl set interface p0 bfd:enable=true cfm_mpid=10])
7549 OVS_WAIT_UNTIL([grep "monitor thread created" ovs-vswitchd.log])
7550 # disable bfd on p0.
7551 AT_CHECK([ovs-vsctl set interface p0 bfd:enable=false])
7552 # check log, there should not be the log of thread terminated.
7553 AT_CHECK([sed -n "s/^.*|ofproto_dpif_monitor(monitor[[0-9]]*)|INFO|\(.* terminated\)$/\1/p" ovs-vswitchd.log], [0], [dnl
7555 # reenable bfd on p0.
7556 AT_CHECK([ovs-vsctl set interface p0 bfd:enable=true])
7557 # check log, should still be on log of thread created.
7558 AT_CHECK([sed -n "s/^.*|ofproto_dpif_monitor(monitor[[0-9]]*)|INFO|\(.* created\)$/\1/p" ovs-vswitchd.log], [0], [dnl
7559 monitor thread created
7561 # disable bfd and cfm together.
7562 AT_CHECK([ovs-vsctl set interface p0 bfd:enable=false -- remove interface p0 cfm_mpid 10])
7564 OVS_WAIT_UNTIL([grep "monitor thread terminated" ovs-vswitchd.log])
7569 # this test helps avoid the deadlock between the main thread and monitor thread.
7570 AT_SETUP([ofproto-dpif - ofproto-dpif-monitor 2])
7573 for i in `seq 1 199`
7575 AT_CHECK([ovs-vsctl add-port br0 p$i -- set interface p$i type=gre options:remote_ip=1.2.3.4 options:key=$i bfd:enable=true])
7581 AT_BANNER([ofproto-dpif - flow translation resource limits])
7583 dnl Resubmits to later tables do not count against the depth limit, so we
7584 dnl can do 99 of them even though the maximum depth is 64.
7585 AT_SETUP([ofproto-dpif - forward resubmit])
7587 (for i in `seq 0 99`; do
7589 echo "table=$i, actions=resubmit(,$j)"
7591 echo "table=100, actions=local") > flows
7592 AT_CHECK([ovs-ofctl add-flows br0 flows])
7593 AT_CHECK([ovs-appctl -vpoll_loop:off ofproto/trace br0 'eth_dst=ff:ff:ff:ff:ff:ff'],
7595 AT_CHECK([tail -1 stdout], [0], [Datapath actions: 100
7600 dnl Resubmits to the same or an earlier table count against the depth limit,
7601 dnl so only 64 of them are allowed.
7602 AT_SETUP([ofproto-dpif - backward resubmit])
7604 (echo "table=0, actions=resubmit(,66)"
7605 for i in `seq 2 66`; do
7607 echo "table=$i, actions=resubmit(,$j)"
7609 echo "table=1, actions=local") > flows
7610 AT_CHECK([ovs-ofctl add-flows br0 flows])
7611 AT_CHECK([ovs-appctl -vpoll_loop:off ofproto/trace br0 'eth_dst=ff:ff:ff:ff:ff:ff'],
7613 AT_CHECK([tail -1 stdout], [0],
7614 [Translation failed (Recursion too deep), packet is dropped.
7616 AT_CHECK([grep -c 'over max translation depth 64' stdout],
7619 OVS_VSWITCHD_STOP(["/resubmit actions recursed/d"])
7622 AT_SETUP([ofproto-dpif - infinite resubmit])
7624 AT_CHECK([ovs-ofctl add-flow br0 actions=resubmit:1,resubmit:2,output:3])
7625 AT_CHECK([ovs-appctl -vpoll_loop:off ofproto/trace br0 'eth_dst=ff:ff:ff:ff:ff:ff'],
7627 AT_CHECK([tail -1 stdout], [0],
7628 [Translation failed (Recursion too deep), packet is dropped.
7630 AT_CHECK([grep -c 'over max translation depth 64' stdout],
7633 OVS_VSWITCHD_STOP(["/resubmit actions recursed/d"])
7636 AT_SETUP([ofproto-dpif - exponential resubmit chain])
7639 (for i in `seq 1 64`; do
7641 echo "in_port=$i, actions=resubmit:$j, resubmit:$j, local"
7643 echo "in_port=65, actions=local") > flows
7644 AT_CHECK([ovs-ofctl add-flows br0 flows])
7645 AT_CHECK([ovs-appctl -vpoll_loop:off ofproto/trace br0 'in_port=1'], [0], [stdout])
7646 AT_CHECK([tail -1 stdout], [0],
7647 [Translation failed (Too many resubmits), packet is dropped.
7649 AT_CHECK([grep -c 'over 4096 resubmit actions' stdout], [0], [1
7651 OVS_VSWITCHD_STOP(["/over.*resubmit actions/d"])
7654 AT_SETUP([ofproto-dpif - too many output actions])
7657 (for i in `seq 1 12`; do
7659 echo "in_port=$i, actions=resubmit:$j, resubmit:$j, local"
7661 echo "in_port=13, actions=local,local,local,local,local,local,local,local") > flows
7662 AT_CHECK([ovs-ofctl add-flows br0 flows])
7663 AT_CHECK([ovs-appctl -vpoll_loop:off ofproto/trace br0 'in_port=1'], [0], [stdout])
7664 AT_CHECK([grep -c -e '- Uses action(s) not supported by datapath' stdout],
7667 AT_CHECK([grep -c 'resubmits yielded over 64 kB of actions' stdout], [0], [1
7669 OVS_VSWITCHD_STOP(["/resubmits yielded over 64 kB of actions/d"])
7672 AT_SETUP([ofproto-dpif - stack too deep])
7675 (for i in `seq 1 12`; do
7677 echo "in_port=$i, actions=resubmit:$j, resubmit:$j, local"
7679 push="push:NXM_NX_REG0[[]]"
7680 echo "in_port=13, actions=$push,$push,$push,$push,$push,$push,$push,$push") > flows
7681 AT_CHECK([ovs-ofctl add-flows br0 flows])
7682 AT_CHECK([ovs-appctl -vpoll_loop:off ofproto/trace br0 'in_port=1'], [0], [stdout])
7683 AT_CHECK([tail -1 stdout], [0],
7684 [Translation failed (Stack too deep), packet is dropped.
7686 AT_CHECK([grep -c 'resubmits yielded over 64 kB of stack' stdout], [0], [1
7688 OVS_VSWITCHD_STOP(["/resubmits yielded over 64 kB of stack/d"])
7692 AT_SETUP([ofproto-dpif packet-out controller])
7694 add_of_ports br0 1 2
7696 AT_CHECK([ovs-ofctl add-flow br0 'dl_dst=50:54:00:00:00:0a actions=controller'])
7698 AT_CAPTURE_FILE([ofctl_monitor.log])
7699 AT_CHECK([ovs-ofctl monitor br0 65534 invalid_ttl -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
7702 AT_CHECK([ovs-ofctl -O OpenFlow13 packet-out br0 CONTROLLER controller '50540000000a5054000000091234'])
7705 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
7706 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
7707 NXT_PACKET_IN (xid=0x0): total_len=14 in_port=CONTROLLER (via action) data_len=14 (unbuffered)
7708 vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,dl_type=0x1234
7710 NXT_PACKET_IN (xid=0x0): total_len=14 in_port=CONTROLLER (via action) data_len=14 (unbuffered)
7711 vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,dl_type=0x1234
7713 NXT_PACKET_IN (xid=0x0): total_len=14 in_port=CONTROLLER (via action) data_len=14 (unbuffered)
7714 vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,dl_type=0x1234
7717 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
7718 dl_dst=50:54:00:00:00:0a actions=CONTROLLER:65535
7722 (echo "OFPST_TABLE reply (OF1.3) (xid=0x2):
7724 active=1, lookup=0, matched=0
7727 active=0, lookup=0, matched=0
7729 for i in `seq 2 253`; do
7730 printf ' table %d: ditto\n' $i
7732 AT_CHECK([ovs-ofctl -O OpenFlow13 dump-tables br0 ], [0], [expout])
7737 AT_SETUP([ofproto-dpif packet-out controller (patch port)])
7740 add-port br0 p1 -- \
7741 set interface p1 type=patch options:peer=p2 -- \
7743 set bridge br1 datapath-type=dummy -- \
7744 set bridge br1 fail-mode=secure -- \
7745 set bridge br1 protocols='[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13]' -- \
7746 add-port br1 p2 -- \
7747 set interface p2 type=patch options:peer=p1 --])
7749 AT_CAPTURE_FILE([ofctl_monitor.log])
7750 AT_CHECK([ovs-ofctl monitor br1 65534 invalid_ttl -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
7753 AT_CHECK([ovs-ofctl -O OpenFlow13 packet-out br0 CONTROLLER output:1 '50540000000a5054000000091234'])
7756 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
7757 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
7758 NXT_PACKET_IN (xid=0x0): cookie=0x0 total_len=14 in_port=1 (via no_match) data_len=14 (unbuffered)
7759 vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,dl_type=0x1234
7761 NXT_PACKET_IN (xid=0x0): cookie=0x0 total_len=14 in_port=1 (via no_match) data_len=14 (unbuffered)
7762 vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,dl_type=0x1234
7764 NXT_PACKET_IN (xid=0x0): cookie=0x0 total_len=14 in_port=1 (via no_match) data_len=14 (unbuffered)
7765 vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,dl_type=0x1234
7768 (echo "OFPST_TABLE reply (OF1.3) (xid=0x2):
7770 active=0, lookup=0, matched=0
7772 for i in `seq 1 253`; do
7773 printf ' table %d: ditto\n' $i
7775 AT_CHECK([ovs-ofctl -O OpenFlow13 dump-tables br0 ], [0], [expout])
7777 (echo "OFPST_TABLE reply (OF1.3) (xid=0x2):
7779 active=0, lookup=3, matched=0
7782 active=0, lookup=0, matched=0
7784 for i in `seq 2 253`; do
7785 printf ' table %d: ditto\n' $i
7787 AT_CHECK([ovs-ofctl -O OpenFlow13 dump-tables br1 ], [0], [expout])
7793 AT_SETUP([ofproto-dpif packet-out goto_table])
7795 add_of_ports br0 1 2
7797 AT_DATA([flows.txt], [dnl
7798 table=0 dl_dst=50:54:00:00:00:0a actions=goto_table(1)
7799 table=1 dl_dst=50:54:00:00:00:0a actions=controller
7801 AT_CHECK([ovs-ofctl -O OpenFlow13 add-flows br0 flows.txt])
7803 AT_CAPTURE_FILE([ofctl_monitor.log])
7804 AT_CHECK([ovs-ofctl monitor br0 65534 invalid_ttl -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
7807 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x1234)'
7810 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
7811 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
7812 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
7813 NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
7814 vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,dl_type=0x1234
7816 NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
7817 vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,dl_type=0x1234
7819 NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
7820 vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,dl_type=0x1234
7823 AT_CHECK([ovs-appctl revalidator/purge], [0])
7824 AT_CHECK([ovs-ofctl -O OpenFlow13 dump-flows br0 | ofctl_strip | sort], [0], [dnl
7825 n_packets=3, n_bytes=180, dl_dst=50:54:00:00:00:0a actions=goto_table:1
7826 table=1, n_packets=3, n_bytes=180, dl_dst=50:54:00:00:00:0a actions=CONTROLLER:65535
7827 OFPST_FLOW reply (OF1.3):
7830 (echo "OFPST_TABLE reply (OF1.3) (xid=0x2):
7832 active=1, lookup=3, matched=3
7836 active=0, lookup=0, matched=0
7838 for i in `seq 3 253`; do
7839 printf ' table %d: ditto\n' $i
7841 AT_CHECK([ovs-ofctl -O OpenFlow13 dump-tables br0 ], [0], [expout])
7847 AT_SETUP([ofproto-dpif packet-out table-miss (continue)])
7849 add_of_ports br0 1 2
7851 AT_CHECK([ovs-ofctl -O OpenFlow11 add-flow br0 'table=1 dl_dst=50:54:00:00:00:0a actions=controller'])
7852 AT_CHECK([ovs-ofctl -O OpenFlow11 mod-table br0 all continue])
7854 AT_CAPTURE_FILE([ofctl_monitor.log])
7855 AT_CHECK([ovs-ofctl monitor br0 65534 invalid_ttl -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
7858 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x1234)'
7861 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
7862 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
7863 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
7864 NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
7865 vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,dl_type=0x1234
7867 NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
7868 vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,dl_type=0x1234
7870 NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
7871 vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,dl_type=0x1234
7874 AT_CHECK([ovs-appctl revalidator/purge], [0])
7875 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort], [0], [dnl
7876 table=1, n_packets=3, n_bytes=180, dl_dst=50:54:00:00:00:0a actions=CONTROLLER:65535
7877 OFPST_FLOW reply (OF1.1):
7880 (echo "OFPST_TABLE reply (OF1.3) (xid=0x2):
7882 active=0, lookup=3, matched=0
7885 active=1, lookup=3, matched=3
7888 active=0, lookup=0, matched=0
7890 for i in `seq 3 253`; do
7891 printf ' table %d: ditto\n' $i
7893 AT_CHECK([ovs-ofctl -O OpenFlow13 dump-tables br0 ], [0], [expout])
7898 AT_SETUP([ofproto-dpif - ICMPv6])
7902 AT_CAPTURE_FILE([ofctl_monitor.log])
7904 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
7906 ovs-appctl netdev-dummy/receive p1 '0060970769ea0000860580da86dd6000000000203afffe80000000000000020086fffe0580dafe80000000000000026097fffe0769ea870068bd00000000fe80000000000000026097fffe0769ea01010000860580da'
7908 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
7910 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
7911 NXT_PACKET_IN (xid=0x0): cookie=0x0 total_len=86 in_port=1 (via no_match) data_len=86 (unbuffered)
7912 icmp6,vlan_tci=0x0000,dl_src=00:00:86:05:80:da,dl_dst=00:60:97:07:69:ea,ipv6_src=fe80::200:86ff:fe05:80da,ipv6_dst=fe80::260:97ff:fe07:69ea,ipv6_label=0x00000,nw_tos=0,nw_ecn=0,nw_ttl=255,icmp_type=135,icmp_code=0,nd_target=fe80::260:97ff:fe07:69ea,nd_sll=00:00:86:05:80:da,nd_tll=00:00:00:00:00:00 icmp6_csum:68bd
7918 AT_SETUP([ofproto-dpif - ICMPv6 type match])
7920 add_of_ports br0 1 2 3
7922 AT_CHECK([ovs-ofctl add-flow br0 'icmp6,icmp_type=128,actions=2'])
7923 AT_CHECK([ovs-ofctl add-flow br0 'icmp6,icmp_type=129,actions=3'])
7925 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
7927 AT_CHECK([ovs-appctl netdev-dummy/receive p1 'recirc_id(0),in_port(1),eth(src=f2:49:6e:52:49:0b,dst=02:b7:d7:17:ff:72),eth_type(0x86dd),ipv6(proto=58,frag=no),icmpv6(type=128)'])
7928 AT_CHECK([ovs-appctl netdev-dummy/receive p1 'recirc_id(0),in_port(1),eth(src=f2:49:6e:52:49:0b,dst=02:b7:d7:17:ff:72),eth_type(0x86dd),ipv6(proto=58,frag=no),icmpv6(type=128)'])
7929 AT_CHECK([ovs-appctl netdev-dummy/receive p1 'recirc_id(0),in_port(1),eth(src=f2:49:6e:52:49:0b,dst=02:b7:d7:17:ff:72),eth_type(0x86dd),ipv6(proto=58,frag=no),icmpv6(type=129)'])
7930 AT_CHECK([ovs-appctl netdev-dummy/receive p1 'recirc_id(0),in_port(1),eth(src=f2:49:6e:52:49:0b,dst=02:b7:d7:17:ff:72),eth_type(0x86dd),ipv6(proto=58,frag=no),icmpv6(type=129)'])
7932 AT_CHECK([ovs-appctl revalidator/purge], [0])
7934 AT_CHECK([strip_ufid < ovs-vswitchd.log | filter_flow_install | strip_used], [0], [dnl
7935 recirc_id(0),in_port(1),eth_type(0x86dd),ipv6(proto=58,frag=no),icmpv6(type=128), actions:2
7936 recirc_id(0),in_port(1),eth_type(0x86dd),ipv6(proto=58,frag=no),icmpv6(type=129), actions:3
7939 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
7940 n_packets=2, n_bytes=124, icmp6,icmp_type=128 actions=output:2
7941 n_packets=2, n_bytes=124, icmp6,icmp_type=129 actions=output:3
7948 AT_SETUP([ofproto-dpif - Neighbor Discovery set-field with checksum update])
7951 AT_CHECK([ovs-ofctl add-flow br0 icmp6,icmpv6_type=135,action=set_field:fe80::1-\>nd_target,set_field:32:21:14:86:11:74-\>nd_sll,output:controller])
7953 AT_CAPTURE_FILE([ofctl_monitor.log])
7955 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
7957 ovs-appctl netdev-dummy/receive p1 '0060970769ea0000860580da86dd6000000000203afffe80000000000000020086fffe0580dafe80000000000000026097fffe0769ea870068bd00000000fe80000000000000026097fffe0769ea01010000860580da'
7959 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
7961 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
7962 NXT_PACKET_IN (xid=0x0): cookie=0x0 total_len=86 in_port=1 (via action) data_len=86 (unbuffered)
7963 icmp6,vlan_tci=0x0000,dl_src=00:00:86:05:80:da,dl_dst=00:60:97:07:69:ea,ipv6_src=fe80::200:86ff:fe05:80da,ipv6_dst=fe80::260:97ff:fe07:69ea,ipv6_label=0x00000,nw_tos=0,nw_ecn=0,nw_ttl=255,icmp_type=135,icmp_code=0,nd_target=fe80::1,nd_sll=32:21:14:86:11:74,nd_tll=00:00:00:00:00:00 icmp6_csum:19d3
7969 # Tests the exact match of CFI bit in installed datapath flows matching VLAN.
7970 AT_SETUP([ofproto-dpif - vlan matching])
7972 [add-port br0 p0 -- set Interface p0 type=dummy ofport_request=1])
7973 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
7975 AT_CHECK([ovs-ofctl del-flows br0])
7976 AT_CHECK([ovs-ofctl add-flow br0 "vlan_tci=0x000a/0x0fff,action=output:local"])
7978 AT_CHECK([ovs-appctl netdev-dummy/receive p0 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x8100),vlan(vid=10,pcp=0),encap(eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0))'])
7980 OVS_WAIT_UNTIL([grep flow_add: ovs-vswitchd.log])
7981 AT_CHECK([grep 'in_port([[1]])' ovs-vswitchd.log | filter_flow_install | strip_xout], [0], [dnl
7982 recirc_id(0),in_port(1),eth_type(0x8100),vlan(vid=10),encap(eth_type(0x0800),ipv4(frag=no)), actions: <del>
7987 # Tests in place modification of installed datapath flows.
7988 AT_SETUP([ofproto-dpif - in place modification])
7990 [add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1])
7991 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
7993 AT_CHECK([ovs-ofctl del-flows br0])
7994 AT_CHECK([ovs-ofctl add-flow br0 in_port=1,actions=mod_vlan_vid:3,output:local])
7996 ovs-appctl vlog/set PATTERN:ANY:'%c|%p|%m'
7998 ovs-appctl time/stop
8000 AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x1234)'])
8002 # Wait for the flow setup to be done.
8003 OVS_WAIT_UNTIL([grep 'flow_add:' ovs-vswitchd.log])
8006 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x1234)'
8009 AT_CHECK([ovs-appctl dpif/dump-flows br0 | strip_ufid | strip_used | sort], [0], [dnl
8010 recirc_id(0),in_port(1),eth_type(0x1234), packets:2, bytes:120, used:0.0s, actions:push_vlan(vid=3,pcp=0),100
8013 AT_CHECK([ovs-ofctl add-flow br0 priority=60000,in_port=1,actions=mod_vlan_vid:4,output:local])
8015 ovs-appctl time/warp 500
8016 ovs-appctl time/warp 500
8019 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x1234)'
8022 AT_CHECK([ovs-appctl dpif/dump-flows br0 | strip_ufid | strip_used | sort], [0], [dnl
8023 recirc_id(0),in_port(1),eth_type(0x1234), packets:5, bytes:300, used:0.0s, actions:push_vlan(vid=4,pcp=0),100
8026 AT_CHECK([grep 'modify' ovs-vswitchd.log | strip_ufid ], [0], [dnl
8027 dpif|DBG|dummy@ovs-dummy: put[[modify]] skb_priority(0/0),skb_mark(0/0),recirc_id(0),dp_hash(0/0),in_port(1),eth(src=50:54:00:00:00:09/00:00:00:00:00:00,dst=50:54:00:00:00:0a/00:00:00:00:00:00),eth_type(0x1234), actions:push_vlan(vid=4,pcp=0),100
8032 # Tests in place modification of installed datapath flows with vlans.
8033 AT_SETUP([ofproto-dpif - in place modification (vlan)])
8035 [add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1])
8036 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
8038 AT_CHECK([ovs-ofctl del-flows br0])
8039 AT_CHECK([ovs-ofctl add-flow br0 in_port=1,actions=output:local])
8041 ovs-appctl vlog/set PATTERN:ANY:'%c|%p|%m'
8043 ovs-appctl time/stop
8045 AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x1234)'])
8047 # Check that a correct datapath flow is created.
8048 OVS_WAIT_UNTIL([grep 'flow_add:' ovs-vswitchd.log])
8051 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x1234)'
8054 AT_CHECK([ovs-appctl dpif/dump-flows br0 | strip_ufid | strip_used | sort], [0], [dnl
8055 recirc_id(0),in_port(1),eth_type(0x1234), packets:2, bytes:120, used:0.0s, actions:100
8058 # Delete the flow. Then check that the datapath flow is modified to
8059 # drop the packets. A modified flow inherits the stats, a new
8060 # datapath flow would start from sero.
8061 AT_CHECK([ovs-ofctl del-flows br0])
8063 ovs-appctl time/warp 500
8064 ovs-appctl time/warp 500
8067 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x1234)'
8070 AT_CHECK([ovs-appctl dpif/dump-flows br0 | strip_ufid | strip_used | sort], [0], [dnl
8071 recirc_id(0),in_port(1),eth_type(0x1234), packets:5, bytes:300, used:0.0s, actions:drop
8074 # Add a flow that matches the non-presence of a vlan tag, and check
8075 # that the datapath flow is modified accordingly.
8076 AT_CHECK([ovs-ofctl add-flow br0 in_port=1,vlan_tci=0x0000/0x1fff,actions=output:local])
8078 ovs-appctl time/warp 500
8079 ovs-appctl time/warp 500
8082 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x1234)'
8085 AT_CHECK([ovs-appctl dpif/dump-flows br0 | strip_ufid | strip_used | sort], [0], [dnl
8086 recirc_id(0),in_port(1),eth_type(0x1234), packets:8, bytes:480, used:0.0s, actions:100
8089 # Check that VLAN packets will not hit the same datapath megaflow.
8091 AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x8100),vlan(vid=99,pcp=7),encap(eth_type(0x1234))'])
8092 OVS_WAIT_UNTIL([grep 'flow_add:.*vlan(vid=99' ovs-vswitchd.log])
8095 ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x8100),vlan(vid=99,pcp=7),encap(eth_type(0x1234))'
8098 AT_CHECK([ovs-appctl dpif/dump-flows br0 | strip_ufid | strip_used | sort], [0], [dnl
8099 recirc_id(0),in_port(1),eth_type(0x1234), packets:8, bytes:480, used:0.0s, actions:100
8100 recirc_id(0),in_port(1),eth_type(0x8100),vlan(vid=99,pcp=7/0x0),encap(eth_type(0x1234)), packets:2, bytes:120, used:0.0s, actions:drop
8103 # Check that the new flow matches the CFI bit, while both vid and pcp
8105 AT_CHECK([grep '\(modify\)\|\(flow_add\)' ovs-vswitchd.log | strip_ufid ], [0], [dnl
8106 dpif_netdev|DBG|flow_add: recirc_id(0),in_port(1),eth_type(0x1234), actions:100
8107 dpif|DBG|dummy@ovs-dummy: put[[modify]] skb_priority(0/0),skb_mark(0/0),recirc_id(0),dp_hash(0/0),in_port(1),eth(src=50:54:00:00:00:09/00:00:00:00:00:00,dst=50:54:00:00:00:0a/00:00:00:00:00:00),eth_type(0x1234)
8108 dpif|DBG|dummy@ovs-dummy: put[[modify]] skb_priority(0/0),skb_mark(0/0),recirc_id(0),dp_hash(0/0),in_port(1),eth(src=50:54:00:00:00:09/00:00:00:00:00:00,dst=50:54:00:00:00:0a/00:00:00:00:00:00),eth_type(0x1234), actions:100
8109 dpif_netdev|DBG|flow_add: recirc_id(0),in_port(1),eth_type(0x8100),vlan(vid=99,pcp=7/0x0),encap(eth_type(0x1234)), actions:drop
8114 AT_SETUP([ofproto-dpif - trace (unchanged)])
8116 AT_CHECK([ovs-appctl ofproto/trace br0 'in_port=1'], [0], [stdout])
8117 AT_CHECK([grep "Final flow:" stdout], [0], [Final flow: unchanged
8119 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(100)'], [0], [stdout])
8120 AT_CHECK([grep "Final flow:" stdout], [0], [Final flow: unchanged