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=38, 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=34, 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 # Check that parse failures after 'fields' parsing work
422 AT_CHECK([ovs-ofctl -O OpenFlow10 add-group br0 'group_id=1,type=select,fields(eth_dst),bukket=output:10'], [1], ,[dnl
423 ovs-ofctl: unknown keyword bukket
425 AT_CHECK([ovs-ofctl -O OpenFlow15 add-group br0 'group_id=1234,type=select,selection_method=hash,fields(eth_dst,ip_dst,tcp_dst),bucket=output:10,bucket=output:11'])
426 AT_CHECK([ovs-ofctl -O OpenFlow15 add-flow br0 'ip actions=write_actions(group:1234)'])
428 # Try a bunch of different flows and make sure that they get distributed
430 for d in 0 1 2 3 4 5 6 7 8 9 a b c d e f; do
431 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])
432 tail -1 stdout >> results
434 sort results | uniq -c
435 AT_CHECK([sort results | uniq], [0],
436 [Datapath actions: 10
441 # Try a bunch of different flows and make sure that they are not distributed
442 # as they only vary a field that is not hashed
443 for d in 0 1 2 3 4 5 6 7 8 9 a b c d e f; do
444 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])
445 tail -1 stdout >> results
447 sort results | uniq -c
448 AT_CHECK([sort results | uniq | sed 's/1[[01]]/1?/'], [0],
449 [Datapath actions: 1?
452 # Check that fields are rejected without "selection_method=hash".
453 AT_CHECK([ovs-ofctl -O OpenFlow15 add-group br0 'group_id=1235,type=select,fields(eth_dst,ip_dst,tcp_dst),bucket=output:10,bucket=output:11'], 1, [], [dnl
454 ovs-ofctl: fields may only be specified with "selection_method=hash"
457 # Check that selection_method_param without selection_method is rejected.
458 AT_CHECK([ovs-ofctl -O OpenFlow15 add-group br0 'group_id=1235,type=select,selection_method_param=1,bucket=output:10,bucket=output:11'], 1, [], [dnl
459 ovs-ofctl: selection_method_param is only allowed with "selection_method"
465 AT_SETUP([ofproto-dpif - select group with dp_hash selection method])
467 add_of_ports br0 1 10 11
468 AT_CHECK([ovs-ofctl -O OpenFlow15 add-group br0 'group_id=1234,type=select,selection_method=dp_hash,bucket=output:10,bucket=output:11'])
469 AT_CHECK([ovs-ofctl -O OpenFlow15 add-flow br0 'ip,nw_src=192.168.0.1 actions=group:1234'])
471 # Try a bunch of different flows and make sure that they get distributed
473 for d in 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15; do
474 pkt="in_port(1),eth(src=50:54:00:00:00:07,dst=50:54:00:00:00:01),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.1.$d,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)"
475 AT_CHECK([ovs-appctl netdev-dummy/receive p1 $pkt])
478 AT_CHECK([ovs-appctl dpctl/dump-flows | sed 's/dp_hash(.*\/0x1)/dp_hash(0xXXXX\/0x1)/' | sed 's/packets.*actions:1/actions:1/' | strip_ufid | strip_used | sort], [0], [dnl
479 flow-dump from non-dpdk interfaces:
480 recirc_id(0),in_port(1),eth_type(0x0800),ipv4(src=192.168.0.1,frag=no), packets:15, bytes:630, used:0.0s, actions:hash(hash_l4(0)),recirc(0x1)
481 recirc_id(0x1),dp_hash(0xXXXX/0x1),in_port(1),eth_type(0x0800),ipv4(frag=no), actions:10
482 recirc_id(0x1),dp_hash(0xXXXX/0x1),in_port(1),eth_type(0x0800),ipv4(frag=no), actions:11
485 AT_CHECK([ovs-appctl revalidator/purge], [0])
487 # Try a bunch of different flows and make sure that they are not distributed
488 # as they only vary a field that is not hashed
489 for d in 0 1 2 3 4 5 6 7 8 9 a b c d e f; do
490 pkt="in_port(1),eth(src=50:54:00:00:00:$d,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)"
491 AT_CHECK([ovs-appctl netdev-dummy/receive p1 $pkt])
494 AT_CHECK([ovs-appctl dpctl/dump-flows | sed 's/dp_hash(.*\/0x1)/dp_hash(0xXXXX\/0x1)/' | strip_ufid | strip_used | sort], [0], [dnl
495 flow-dump from non-dpdk interfaces:
496 recirc_id(0),in_port(1),eth_type(0x0800),ipv4(src=192.168.0.1,frag=no), packets:15, bytes:630, used:0.0s, actions:hash(hash_l4(0)),recirc(0x2)
497 recirc_id(0x2),dp_hash(0xXXXX/0x1),in_port(1),eth_type(0x0800),ipv4(frag=no), packets:15, bytes:630, used:0.0s, actions:11
503 AT_SETUP([ofproto-dpif - fast failover group])
505 add_of_ports br0 1 10 11
506 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'])
507 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 'ip actions=write_actions(group:1234)'])
508 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])
509 AT_CHECK([tail -1 stdout], [0],
510 [Datapath actions: drop
515 AT_SETUP([ofproto-dpif - group stats single bucket])
517 add_of_ports br0 1 10 11
518 AT_CHECK([ovs-ofctl -O OpenFlow12 add-group br0 'group_id=1234,type=select,bucket=output:10,weight=2000,bucket=output:11,weight=0'])
519 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 'ip actions=write_actions(group:1234)'])
523 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)"
524 AT_CHECK([ovs-appctl netdev-dummy/receive p1 $pkt])
527 AT_CHECK([ovs-appctl revalidator/purge], [0])
528 AT_CHECK([ovs-ofctl -O OpenFlow12 -vwarn dump-group-stats br0], [0], [stdout])
529 AT_CHECK([strip_xids < stdout | sort], [0], [dnl
530 group_id=1234,ref_count=1,packet_count=3,byte_count=126,bucket0:packet_count=3,byte_count=126,bucket1:packet_count=0,byte_count=0
531 OFPST_GROUP reply (OF1.2):
536 AT_SETUP([ofproto-dpif - group stats all buckets])
538 add_of_ports br0 1 10 11
539 AT_CHECK([ovs-ofctl -O OpenFlow12 add-group br0 'group_id=1234,type=all,bucket=output:10,bucket=output:11'])
540 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 'ip actions=write_actions(group:1234)'])
544 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)"
545 AT_CHECK([ovs-appctl netdev-dummy/receive p1 $pkt])
548 AT_CHECK([ovs-appctl revalidator/purge], [0])
549 AT_CHECK([ovs-ofctl -O OpenFlow12 -vwarn dump-group-stats br0], [0], [stdout])
550 AT_CHECK([strip_xids < stdout | sort], [0], [dnl
551 group_id=1234,ref_count=1,packet_count=3,byte_count=126,bucket0:packet_count=3,byte_count=126,bucket1:packet_count=3,byte_count=126
552 OFPST_GROUP reply (OF1.2):
557 AT_SETUP([ofproto-dpif - registers])
559 add_of_ports br0 20 21 22 33 90
560 AT_DATA([flows.txt], [dnl
561 in_port=90 actions=resubmit:2,resubmit:3,resubmit:4,resubmit:91
562 in_port=91 actions=resubmit:5,resubmit:6,resubmit:7,resubmit:92
563 in_port=92 actions=resubmit:8,resubmit:9,resubmit:10,resubmit:11,resubmit:93
564 in_port=93 actions=resubmit:12,resubmit:13,resubmit:14,resubmit:15
566 in_port=2 actions=load:0x000db000->NXM_NX_REG0[[]]
567 in_port=3 actions=load:0xdea->NXM_NX_REG0[[20..31]]
568 in_port=4 actions=load:0xeef->NXM_NX_REG0[[0..11]]
569 in_port=5 actions=move:NXM_NX_REG0[[]]->NXM_NX_REG1[[]]
570 in_port=6 actions=load:0x22222222->NXM_NX_REG2[[]]
571 in_port=7 actions=move:NXM_NX_REG1[[20..31]]->NXM_NX_REG2[[0..11]]
572 in_port=8 actions=move:NXM_NX_REG1[[0..11]]->NXM_NX_REG2[[20..31]]
573 in_port=9,reg0=0xdeadbeef actions=output:20
574 in_port=10,reg1=0xdeadbeef actions=output:21
575 in_port=11,reg2=0xeef22dea actions=output:22
577 dnl Sanilty check all registers
578 in_port=12 actions=load:0x10->NXM_NX_REG0[[]],load:0x11->NXM_NX_REG1[[]],load:0x12->NXM_NX_REG2[[]]
579 in_port=13 actions=load:0x13->NXM_NX_REG3[[]],load:0x14->NXM_NX_REG4[[]],load:0x15->NXM_NX_REG5[[]]
580 in_port=14 actions=load:0x16->NXM_NX_REG6[[]],load:0x17->NXM_NX_REG7[[]]
581 in_port=15,reg0=0x10,reg1=0x11,reg2=0x12,reg3=0x13,reg4=0x14,reg5=0x15,reg6=0x16,reg7=0x17 actions=output:33
584 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
585 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])
586 AT_CHECK([tail -1 stdout], [0],
587 [Datapath actions: 20,21,22,33
592 dnl Tests that the standardized xregs are mapped onto the legacy OVS registers
593 dnl in the manner documented in ovs-ofctl(8).
594 AT_SETUP([ofproto-dpif - extended registers])
596 add_of_ports br0 1 2 3
597 AT_DATA([flows.txt], [dnl
598 table=0 actions=load:0xfedcba9876543210->OXM_OF_PKT_REG1[[]],resubmit(,1)
599 table=1,reg2=0xfedcba98,reg3=0x76543210 actions=2
601 # These low-priority rules shouldn't match. They're here only to make really
602 # sure that the test fails if either of the above rules fails to match.
603 table=0,priority=0 actions=3
604 table=1,priority=0 actions=3
606 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
607 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])
608 AT_CHECK([tail -1 stdout], [0], [Datapath actions: 2
613 dnl Tests that the standardized xxregs are mapped onto the legacy OVS
614 dnl registers in the manner documented in ovs-ofctl(8).
615 AT_SETUP([ofproto-dpif - extended-extended registers])
617 add_of_ports br0 1 2 3
618 AT_DATA([flows.txt], [dnl
619 table=0 actions=load:0x0123456789abcdeffedcba9876543210->NXM_NX_XXREG1[[]],resubmit(,1)
620 table=1,reg4=0x01234567,reg5=0x89abcdef,reg6=0xfedcba98,reg7=0x76543210 actions=2
622 # These low-priority rules shouldn't match. They're here only to make really
623 # sure that the test fails if either of the above rules fails to match.
624 table=0,priority=0 actions=3
625 table=1,priority=0 actions=3
627 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
628 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])
629 AT_CHECK([tail -1 stdout], [0], [Datapath actions: 2
634 AT_SETUP([ofproto-dpif - load and move order])
636 add_of_ports br0 1 10 11
637 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'])
638 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)'])
639 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])
640 AT_CHECK([tail -2 stdout], [0],
641 [Megaflow: recirc_id=0,ip,in_port=1,nw_src=192.168.0.1,nw_frag=no
642 Datapath actions: set(ipv4(src=255.255.255.255)),10,set(ipv4(src=192.168.0.1)),11
647 dnl Tests that 1.5 copy-field can copy into the standardized xregs.
648 AT_SETUP([ofproto-dpif - copy-field into extended registers])
650 add_of_ports br0 1 2 3
651 AT_DATA([flows.txt], [dnl
652 table=0 actions=move:OXM_OF_ETH_SRC[[0..47]]->OXM_OF_PKT_REG0[[0..47]],goto_table(1)
653 table=1,xreg0=0x0000505400000005 actions=2
655 # These low-priority rules shouldn't match. They're here only to make really
656 # sure that the test fails if either of the above rules fails to match.
657 table=0,priority=0 actions=3
658 table=1,priority=0 actions=3
660 AT_CHECK([ovs-ofctl -O OpenFlow15 add-flows br0 flows.txt])
661 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])
662 AT_CHECK([tail -1 stdout], [0], [Datapath actions: 2
667 dnl Tests that 1.5 set-field with mask in the metadata register.
668 AT_SETUP([ofproto-dpif - masked set-field into metadata])
670 add_of_ports br0 1 2 3
671 AT_DATA([flows.txt], [dnl
672 table=0 actions=set_field:0xfafafafa5a5a5a5a->metadata,goto_table(1)
673 table=1 actions=set_field:0x6b/0xff->metadata,goto_table(2)
674 table=2,metadata=0xfafafafa5a5a5a6b actions=2
676 # These low-priority rules shouldn't match. They're here only to make really
677 # sure that the test fails if either of the above rules fails to match.
678 table=0,priority=0 actions=3
679 table=1,priority=0 actions=3
680 table=2,priority=0 actions=3
682 AT_CHECK([ovs-ofctl -O OpenFlow15 add-flows br0 flows.txt])
683 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])
684 AT_CHECK([tail -1 stdout], [0], [Datapath actions: 2
690 AT_SETUP([ofproto-dpif - actset_output])
692 add_of_ports br0 1 2 3 4 5 6 7 8 9 10 11 12 13
693 AT_DATA([flows.txt], [dnl
694 table=0,actset_output=unset actions=write_actions(output(2)),goto_table(1)
695 table=1 actions=move:ONFOXM_ET_ACTSET_OUTPUT[[0..31]]->OXM_OF_PKT_REG0[[0..31]],goto_table(2)
697 # Verify that actset_output got set.
698 table=2,priority=20,actset_output=2 actions=4,goto_table(3)
699 table=2,priority=10 actions=5,goto_table(3)
701 # Verify that xreg0 got copied properly from actset_output.
702 table=3,priority=20,xreg0=2 actions=6,goto_table(4)
703 table=3,priority=10 actions=7,goto_table(4)
705 # Verify that xxreg0 got copied properly from actset_output.
706 table=3,priority=20,xxreg0=2 actions=6,goto_table(4)
707 table=3,priority=10 actions=7,goto_table(4)
709 # Verify that adding a group action unsets actset_output,
710 # even if output follows group.
711 table=4 actions=write_actions(group(5),output(10)),goto_table(5)
712 table=5,priority=20,actset_output=unset actions=8,goto_table(6)
713 table=5,priority=10 actions=9,goto_table(6)
715 # Verify that adding another output action doesn't change actset_output
716 # (since there's still a group).
717 table=6 actions=write_actions(output(3)),goto_table(7)
718 table=7,priority=20,actset_output=unset actions=10,goto_table(8)
719 table=7,priority=10 actions=11,goto_table(8)
721 # Verify that clearing the action set, then writing an output action,
722 # causes actset_output to be set again.
723 table=8,actions=clear_actions,write_actions(output(3),output(2)),goto_table(9)
724 table=9,priority=20,actset_output=2 actions=12
725 table=9,priority=10 actions=13
727 AT_CHECK([ovs-ofctl -O OpenFlow13 add-group br0 'group_id=5,type=all,bucket=output:1'])
728 AT_CHECK([ovs-ofctl -O OpenFlow13 add-flows br0 flows.txt])
729 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])
730 AT_CHECK([tail -1 stdout], [0], [Datapath actions: 4,6,8,10,12,2
734 AT_SETUP([ofproto-dpif - push-pop])
736 add_of_ports br0 20 21 22 33 90
737 AT_DATA([flows.txt], [dnl
738 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
739 in_port=2 actions=pop:NXM_NX_REG0[[0..7]],output:NXM_NX_REG0[[]]
740 in_port=3 actions=pop:NXM_NX_REG1[[0..7]],output:NXM_NX_REG1[[]]
741 in_port=4 actions=pop:NXM_NX_REG2[[0..15]],output:NXM_NX_REG2[[]]
742 in_port=5 actions=pop:NXM_NX_REG3[[]],output:NXM_NX_REG3[[]]
745 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
746 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])
747 AT_CHECK([tail -1 stdout], [0],
748 [Datapath actions: 33,22,21,20
753 AT_SETUP([ofproto-dpif - output])
755 add_of_ports br0 1 9 10 11 55 66 77 88
756 AT_DATA([flows.txt], [dnl
757 in_port=1 actions=resubmit:2,resubmit:3,resubmit:4,resubmit:5,resubmit:6,resubmit:7,resubmit:8
758 in_port=2 actions=output:9
759 in_port=3 actions=load:55->NXM_NX_REG0[[]],output:NXM_NX_REG0[[]],load:66->NXM_NX_REG1[[]]
760 in_port=4 actions=output:10,output:NXM_NX_REG0[[]],output:NXM_NX_REG1[[]],output:11
761 in_port=5 actions=load:77->NXM_NX_REG0[[0..15]],load:88->NXM_NX_REG0[[16..31]]
762 in_port=6 actions=output:NXM_NX_REG0[[0..15]],output:NXM_NX_REG0[[16..31]]
763 in_port=7 actions=load:0x110000ff->NXM_NX_REG0[[]],output:NXM_NX_REG0[[]]
764 in_port=8 actions=1,9,load:9->NXM_OF_IN_PORT[[]],1,9
766 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
767 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])
768 AT_CHECK([tail -1 stdout], [0],
769 [Datapath actions: 9,55,10,55,66,11,77,88,9,1
774 AT_SETUP([ofproto-dpif - dec_ttl])
776 add_of_ports br0 1 2 3 4
777 AT_DATA([flows.txt], [dnl
778 table=0 in_port=1 action=dec_ttl,output:2,resubmit(1,1),output:4
779 table=1 in_port=1 action=dec_ttl,output:3
781 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
782 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])
783 AT_CHECK([tail -4 stdout], [0],
784 [Megaflow: recirc_id=0,ip,in_port=1,nw_ttl=2,nw_frag=no
785 Datapath actions: set(ipv4(ttl=1)),2,4
786 This flow is handled by the userspace slow path because it:
787 - Sends "packet-in" messages to the OpenFlow controller.
789 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])
790 AT_CHECK([tail -2 stdout], [0],
791 [Megaflow: recirc_id=0,ip,in_port=1,nw_ttl=3,nw_frag=no
792 Datapath actions: set(ipv4(ttl=2)),2,set(ipv4(ttl=1)),3,4
794 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])
795 AT_CHECK([tail -2 stdout], [0],
796 [Megaflow: recirc_id=0,ipv6,in_port=1,nw_ttl=128,nw_frag=no
797 Datapath actions: set(ipv6(hlimit=127)),2,set(ipv6(hlimit=126)),3,4
800 AT_CAPTURE_FILE([ofctl_monitor.log])
801 AT_CHECK([ovs-ofctl -P nxt_packet_in monitor br0 65534 invalid_ttl --detach --no-chdir --pidfile 2> ofctl_monitor.log])
802 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])
803 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
804 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
805 NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=34 in_port=1 (via invalid_ttl) data_len=34 (unbuffered)
806 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
811 dnl A dec_ttl action at offset 32 in ofpacts will cause the ofpacts
812 dnl buffer to be resized just before pushing the id of the dec_ttl action.
813 dnl Thus the implementation must account for this by using the
814 dnl reallocated buffer rather than the original buffer.
816 dnl A number of similar rules are added to try and exercise
817 dnl xrealloc sufficiently that it returns a different base pointer
818 AT_SETUP([ofproto-dpif - dec_ttl without arguments at offset 32 in ofpacts])
821 (for i in `seq 0 255`; do
822 printf "dl_src=10:11:11:11:11:%02x actions=output:1,output:1,output:1,dec_ttl,controller\n" $i
824 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
828 dnl A dec_ttl action at offset 32 in ofpacts will cause the ofpacts
829 dnl buffer to be resized just before pushing the id of the dec_ttl action.
830 dnl Thus the implementation must account for this by using the
831 dnl reallocated buffer rather than the original buffer.
833 dnl A number of similar rules are added to try and exercise
834 dnl xrealloc sufficiently that it returns a different base pointer
835 AT_SETUP([ofproto-dpif - dec_ttl with arguments at offset 32 in ofpacts])
838 (for i in `seq 0 255`; do
839 printf "dl_src=10:11:11:11:11:%02x actions=output:1,output:1,output:1,dec_ttl(1),controller\n" $i
841 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
845 dnl A note action at offset 24 in ofpacts will cause the ofpacts
846 dnl buffer to be resized just before pushing the id of the dec_ttl action.
847 dnl Thus the implementation must account for this by using the
848 dnl reallocated buffer rather than the original buffer.
850 dnl A number of similar rules are added to try and exercise
851 dnl xrealloc sufficiently that it returns a different base pointer
852 AT_SETUP([ofproto-dpif - note at offset 24 in ofpacts])
855 (for i in `seq 0 255`; do
856 printf "dl_src=10:11:11:11:11:%02x actions=output:1,output:1,note:ff,controller\n" $i
858 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
862 dnl As of OVS-2.5, a note action after 4 set_field actions are likely to
863 dnl trigger ofpbuf reallocation during decode (~1KB into ofpacts buffer).
864 dnl Using `make check-valgrind' here checks for use-after-free in this
866 AT_SETUP([ofproto-dpif - note action deep inside ofpacts])
868 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'])
872 AT_SETUP([ofproto-dpif - output, OFPP_NONE ingress port])
876 AT_CHECK([ovs-ofctl add-flow br0 action=normal])
878 # "in_port" defaults to OFPP_NONE if it's not specified.
879 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"
880 AT_CHECK([ovs-appctl ofproto/trace br0 "$flow"], [0], [stdout])
881 AT_CHECK([tail -1 stdout | sed 's/Datapath actions: //' | tr "," "\n" | sort -n], [0], [dnl
890 AT_SETUP([ofproto-dpif - DSCP])
891 OVS_VSWITCHD_START([add-port br0 p1 -- set Interface p1 type=dummy])
893 AT_DATA([flows.txt], [dnl
894 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
896 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
897 AT_CHECK([ovs-vsctl -- \
898 set Port p1 qos=@newqos --\
899 --id=@newqos create QoS type=linux-htb queues=1=@q1,2=@q2 --\
900 --id=@q1 create Queue dscp=1 --\
901 --id=@q2 create Queue dscp=2], [0], [ignore])
902 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])
903 AT_CHECK([tail -2 stdout], [0],
904 [Megaflow: recirc_id=0,skb_priority=0,ip,in_port=9,nw_tos=252,nw_frag=no
905 Datapath actions: dnl
907 set(ipv4(tos=0x4/0xfc)),set(skb_priority(0x1)),1,dnl
908 set(ipv4(tos=0x8/0xfc)),set(skb_priority(0x2)),1,dnl
910 set(ipv4(tos=0x4/0xfc)),set(skb_priority(0x1)),1,dnl
911 set(ipv4(tos=0xfc/0xfc)),set(skb_priority(0)),1,dnl
912 set(ipv4(tos=0/0xfc)),1,100
917 AT_SETUP([ofproto-dpif - output/flood flags])
919 add_of_ports br0 1 2 3 4 5 6 7
921 AT_DATA([flows.txt], [dnl
922 in_port=local actions=local,flood
923 in_port=1 actions=flood
924 in_port=2 actions=all
925 in_port=3 actions=output:LOCAL,output:1,output:2,output:3,output:4,output:5,output:6,output:7
926 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
928 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
929 AT_CHECK([ovs-ofctl mod-port br0 5 noforward])
930 AT_CHECK([ovs-ofctl mod-port br0 6 noflood])
932 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])
933 AT_CHECK([tail -1 stdout \
934 | sed -e 's/Datapath actions: //' | tr ',' '\n' | sort], [0], [dnl
942 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])
943 AT_CHECK([tail -1 stdout \
944 | sed -e 's/Datapath actions: //' | tr ',' '\n' | sort], [0], [dnl
952 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])
953 AT_CHECK([tail -1 stdout \
954 | sed -e 's/Datapath actions: //' | tr ',' '\n' | sort], [0], [dnl
963 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])
964 AT_CHECK([tail -1 stdout], [0],
965 [Datapath actions: 100,1,2,4,6,7
968 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])
969 AT_CHECK([tail -1 stdout], [0],
970 [Datapath actions: set(skb_priority(0x1)),100,1,2,set(skb_priority(0x2)),3,set(skb_priority(0x1)),6,7
975 AT_SETUP([ofproto-dpif - Default Table Miss - OF1.0 (OFPTC_TABLE_MISS_CONTROLLER)])
976 OVS_VSWITCHD_START([dnl
977 add-port br0 p1 -- set Interface p1 type=dummy
979 on_exit 'kill `cat ovs-ofctl.pid`'
981 AT_CAPTURE_FILE([ofctl_monitor.log])
983 AT_CHECK([ovs-ofctl -P nxt_packet_in monitor br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
986 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)'
988 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
989 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
990 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
991 NXT_PACKET_IN (xid=0x0): cookie=0x0 total_len=54 in_port=1 (via no_match) data_len=54 (unbuffered)
992 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:2e7e
994 NXT_PACKET_IN (xid=0x0): cookie=0x0 total_len=54 in_port=1 (via no_match) data_len=54 (unbuffered)
995 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:2e7e
997 NXT_PACKET_IN (xid=0x0): cookie=0x0 total_len=54 in_port=1 (via no_match) data_len=54 (unbuffered)
998 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:2e7e
1001 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
1002 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1009 AT_SETUP([ofproto-dpif - Default Table Miss - OF1.3 (OFPTC_TABLE_MISS_DROP)])
1010 OVS_VSWITCHD_START([dnl
1011 add-port br0 p1 -- set Interface p1 type=dummy
1013 on_exit 'kill `cat ovs-ofctl.pid`'
1015 AT_CAPTURE_FILE([ofctl_monitor.log])
1016 AT_CHECK([ovs-ofctl del-flows br0])
1018 AT_CHECK([ovs-ofctl monitor -OOpenFlow13 -P standard br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
1020 dnl Test that missed packets are dropped
1022 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)'
1024 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
1026 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1029 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
1030 AT_CHECK([ovs-ofctl -OOpenFlow13 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1031 OFPST_FLOW reply (OF1.3):
1037 AT_SETUP([ofproto-dpif - Table Miss - goto table and OFPTC_TABLE_MISS_CONTROLLER])
1038 OVS_VSWITCHD_START([dnl
1039 add-port br0 p1 -- set Interface p1 type=dummy
1041 on_exit 'kill `cat ovs-ofctl.pid`'
1043 AT_CAPTURE_FILE([ofctl_monitor.log])
1044 AT_CHECK([ovs-ofctl -OOpenFlow12 add-flow br0 'table=0 actions=goto_table(1)'])
1046 AT_CHECK([ovs-ofctl monitor -P standard br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
1049 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)'
1051 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1052 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
1053 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1054 OFPT_PACKET_IN (xid=0x0): total_len=54 in_port=1 (via no_match) data_len=54 (unbuffered)
1055 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:2e5c
1057 OFPT_PACKET_IN (xid=0x0): total_len=54 in_port=1 (via no_match) data_len=54 (unbuffered)
1058 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:2e5c
1060 OFPT_PACKET_IN (xid=0x0): total_len=54 in_port=1 (via no_match) data_len=54 (unbuffered)
1061 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:2e5c
1064 AT_CHECK([ovs-appctl revalidator/purge], [0])
1065 AT_CHECK([ovs-ofctl -OOpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1066 n_packets=3, n_bytes=162, actions=goto_table:1
1067 OFPST_FLOW reply (OF1.2):
1073 AT_SETUP([ofproto-dpif - Table Miss - resubmit and OFPTC_TABLE_MISS_CONTROLLER])
1074 OVS_VSWITCHD_START([dnl
1075 add-port br0 p1 -- set Interface p1 type=dummy
1077 on_exit 'kill `cat ovs-ofctl.pid`'
1079 AT_CAPTURE_FILE([ofctl_monitor.log])
1080 AT_CHECK([ovs-ofctl -OOpenFlow12 add-flow br0 'table=0 actions=resubmit(1,1)'])
1082 AT_CHECK([ovs-ofctl monitor -P standard br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
1085 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)'
1088 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
1089 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1092 AT_CHECK([ovs-appctl revalidator/purge], [0])
1093 AT_CHECK([ovs-ofctl -OOpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1094 n_packets=3, n_bytes=162, actions=resubmit(1,1)
1095 OFPST_FLOW reply (OF1.2):
1101 AT_SETUP([ofproto-dpif - Table Miss - OFPTC_TABLE_MISS_CONTINUE])
1102 OVS_VSWITCHD_START([dnl
1103 add-port br0 p1 -- set Interface p1 type=dummy
1105 on_exit 'kill `cat ovs-ofctl.pid`'
1107 AT_CAPTURE_FILE([ofctl_monitor.log])
1108 AT_CHECK([ovs-ofctl add-flow br0 'table=1 dl_src=10:11:11:11:11:11 actions=controller'])
1109 AT_CHECK([ovs-ofctl -OOpenFlow11 mod-table br0 all continue])
1111 dnl Miss table 0, Hit table 1
1112 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
1115 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)'
1117 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1118 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
1120 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1121 NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=54 in_port=1 (via action) data_len=54 (unbuffered)
1122 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:2e70
1124 NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=54 in_port=1 (via action) data_len=54 (unbuffered)
1125 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:2e70
1127 NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=54 in_port=1 (via action) data_len=54 (unbuffered)
1128 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:2e70
1131 dnl Hit table 0, Miss all other tables, sent to controller
1132 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
1135 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)'
1137 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1138 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
1140 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1141 NXT_PACKET_IN (xid=0x0): table_id=253 cookie=0x0 total_len=54 in_port=1 (via no_match) data_len=54 (unbuffered)
1142 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:2e70
1144 NXT_PACKET_IN (xid=0x0): table_id=253 cookie=0x0 total_len=54 in_port=1 (via no_match) data_len=54 (unbuffered)
1145 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:2e70
1147 NXT_PACKET_IN (xid=0x0): table_id=253 cookie=0x0 total_len=54 in_port=1 (via no_match) data_len=54 (unbuffered)
1148 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:2e70
1151 AT_CHECK([ovs-appctl revalidator/purge], [0])
1152 AT_CHECK([ovs-ofctl -OOpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1153 table=1, n_packets=3, n_bytes=162, dl_src=10:11:11:11:11:11 actions=CONTROLLER:65535
1154 OFPST_FLOW reply (OF1.2):
1160 AT_SETUP([ofproto-dpif - Table Miss - goto table and OFPTC_TABLE_MISS_CONTINUE])
1161 OVS_VSWITCHD_START([dnl
1162 add-port br0 p1 -- set Interface p1 type=dummy
1164 on_exit 'kill `cat ovs-ofctl.pid`'
1166 AT_CAPTURE_FILE([ofctl_monitor.log])
1167 AT_DATA([flows.txt], [dnl
1168 table=0 actions=goto_table(1)
1169 table=2 dl_src=10:11:11:11:11:11 actions=controller
1171 AT_CHECK([ovs-ofctl -OOpenFlow12 add-flows br0 flows.txt])
1172 AT_CHECK([ovs-ofctl -OOpenFlow11 mod-table br0 all continue])
1174 dnl Hit table 0, Miss table 1, Hit table 2
1175 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
1178 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)'
1180 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1181 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1183 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1184 NXT_PACKET_IN (xid=0x0): table_id=2 cookie=0x0 total_len=54 in_port=1 (via action) data_len=54 (unbuffered)
1185 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:2e70
1187 NXT_PACKET_IN (xid=0x0): table_id=2 cookie=0x0 total_len=54 in_port=1 (via action) data_len=54 (unbuffered)
1188 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:2e70
1190 NXT_PACKET_IN (xid=0x0): table_id=2 cookie=0x0 total_len=54 in_port=1 (via action) data_len=54 (unbuffered)
1191 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:2e70
1194 dnl Hit table 1, Miss all other tables, sent to controller
1195 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
1198 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)'
1200 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1201 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
1203 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1204 NXT_PACKET_IN (xid=0x0): table_id=253 cookie=0x0 total_len=54 in_port=1 (via no_match) data_len=54 (unbuffered)
1205 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:2e70
1207 NXT_PACKET_IN (xid=0x0): table_id=253 cookie=0x0 total_len=54 in_port=1 (via no_match) data_len=54 (unbuffered)
1208 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:2e70
1210 NXT_PACKET_IN (xid=0x0): table_id=253 cookie=0x0 total_len=54 in_port=1 (via no_match) data_len=54 (unbuffered)
1211 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:2e70
1214 AT_CHECK([ovs-appctl revalidator/purge], [0])
1215 AT_CHECK([ovs-ofctl -OOpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1216 n_packets=6, n_bytes=324, actions=goto_table:1
1217 table=2, n_packets=3, n_bytes=162, dl_src=10:11:11:11:11:11 actions=CONTROLLER:65535
1218 OFPST_FLOW reply (OF1.2):
1224 AT_SETUP([ofproto-dpif - Table Miss - resubmit and OFPTC_TABLE_MISS_CONTINUE])
1225 OVS_VSWITCHD_START([dnl
1226 add-port br0 p1 -- set Interface p1 type=dummy
1228 on_exit 'kill `cat ovs-ofctl.pid`'
1230 AT_CAPTURE_FILE([ofctl_monitor.log])
1231 AT_DATA([flows.txt], [dnl
1232 table=0 actions=resubmit(1,1)
1233 table=2 dl_src=10:11:11:11:11:11 actions=controller
1235 AT_CHECK([ovs-ofctl -OOpenFlow12 add-flows br0 flows.txt])
1236 AT_CHECK([ovs-ofctl -OOpenFlow11 mod-table br0 all continue])
1238 dnl Hit table 0, Miss table 1, Dropped
1239 AT_CHECK([ovs-ofctl monitor br0 65534 -P standard --detach --no-chdir --pidfile 2> ofctl_monitor.log])
1242 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)'
1244 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1246 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1249 dnl Hit table 1, Dropped
1250 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
1253 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)'
1255 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
1257 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1260 AT_CHECK([ovs-appctl revalidator/purge], [0])
1261 AT_CHECK([ovs-ofctl -OOpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1262 n_packets=6, n_bytes=324, actions=resubmit(1,1)
1263 table=2, dl_src=10:11:11:11:11:11 actions=CONTROLLER:65535
1264 OFPST_FLOW reply (OF1.2):
1270 AT_SETUP([ofproto-dpif - Table Miss - OFPTC_TABLE_MISS_DROP])
1271 OVS_VSWITCHD_START([dnl
1272 add-port br0 p1 -- set Interface p1 type=dummy
1274 on_exit 'kill `cat ovs-ofctl.pid`'
1276 AT_CAPTURE_FILE([ofctl_monitor.log])
1277 AT_CHECK([ovs-ofctl -OOpenFlow11 mod-table br0 all drop])
1279 AT_CHECK([ovs-ofctl monitor -P standard br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
1281 dnl Test that missed packets are dropped
1283 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)'
1285 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
1287 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1290 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
1291 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1298 AT_SETUP([ofproto-dpif - Table Miss - goto table and OFPTC_TABLE_MISS_DROP])
1299 OVS_VSWITCHD_START([dnl
1300 add-port br0 p1 -- set Interface p1 type=dummy
1302 on_exit 'kill `cat ovs-ofctl.pid`'
1304 AT_CAPTURE_FILE([ofctl_monitor.log])
1305 AT_CHECK([ovs-ofctl del-flows br0])
1306 AT_CHECK([ovs-ofctl -OOpenFlow12 add-flow br0 'table=0 actions=goto_table(1)'])
1307 AT_CHECK([ovs-ofctl -OOpenFlow11 mod-table br0 all drop])
1309 AT_CHECK([ovs-ofctl monitor -P standard br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
1311 dnl Test that missed packets are dropped
1313 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)'
1315 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
1317 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1320 AT_CHECK([ovs-appctl revalidator/purge], [0])
1321 AT_CHECK([ovs-ofctl -OOpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1322 n_packets=3, n_bytes=162, actions=goto_table:1
1323 OFPST_FLOW reply (OF1.2):
1329 AT_SETUP([ofproto-dpif - Table Miss - resubmit and OFPTC_TABLE_MISS_DROP])
1330 OVS_VSWITCHD_START([dnl
1331 add-port br0 p1 -- set Interface p1 type=dummy
1333 on_exit 'kill `cat ovs-ofctl.pid`'
1335 AT_CAPTURE_FILE([ofctl_monitor.log])
1336 AT_CHECK([ovs-ofctl del-flows br0])
1337 AT_CHECK([ovs-ofctl -OOpenFlow12 add-flow br0 'table=0 actions=resubmit(1,1)'])
1338 AT_CHECK([ovs-ofctl -OOpenFlow11 mod-table br0 all drop])
1340 AT_CHECK([ovs-ofctl monitor -P standard br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
1342 dnl Test that missed packets are dropped
1344 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)'
1346 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
1348 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1351 AT_CHECK([ovs-appctl revalidator/purge], [0])
1352 AT_CHECK([ovs-ofctl -OOpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1353 n_packets=3, n_bytes=162, actions=resubmit(1,1)
1354 OFPST_FLOW reply (OF1.2):
1360 AT_SETUP([ofproto-dpif - controller])
1361 OVS_VSWITCHD_START([dnl
1362 add-port br0 p1 -- set Interface p1 type=dummy
1364 on_exit 'kill `cat ovs-ofctl.pid`'
1366 AT_CAPTURE_FILE([ofctl_monitor.log])
1367 AT_DATA([flows.txt], [dnl
1368 cookie=0x0 dl_src=10:11:11:11:11:11 actions=controller
1369 cookie=0x1 dl_src=20:22:22:22:22:22 actions=controller,resubmit(80,1)
1370 cookie=0x2 dl_src=30:33:33:33:33:33 actions=mod_vlan_vid:15,controller
1372 cookie=0x3 table=1 in_port=80 actions=load:1->NXM_NX_REG0[[]],mod_vlan_vid:80,controller,resubmit(81,2)
1373 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)
1374 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)
1375 cookie=0x6 table=4 in_port=83 actions=load:4->NXM_NX_REG3[[]],mod_nw_src:83.83.83.83,controller,resubmit(84,5)
1376 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)
1377 cookie=0x8 table=6 in_port=85 actions=mod_tp_src:85,controller,resubmit(86,7)
1378 cookie=0x9 table=7 in_port=86 actions=mod_tp_dst:86,controller,controller
1379 cookie=0xa dl_src=40:44:44:44:44:41 actions=mod_vlan_vid:99,mod_vlan_pcp:1,controller
1380 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
1382 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
1385 AT_CHECK([ovs-ofctl monitor -P standard br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
1388 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)'
1390 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1391 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1393 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1394 OFPT_PACKET_IN (xid=0x0): total_len=54 in_port=1 (via no_match) data_len=54 (unbuffered)
1395 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:2e70
1397 OFPT_PACKET_IN (xid=0x0): total_len=54 in_port=1 (via no_match) data_len=54 (unbuffered)
1398 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:2e70
1400 OFPT_PACKET_IN (xid=0x0): total_len=54 in_port=1 (via no_match) data_len=54 (unbuffered)
1401 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:2e70
1404 dnl Singleton controller action.
1405 AT_CHECK([ovs-ofctl monitor -P standard br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
1408 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)'
1410 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1411 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1413 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1414 OFPT_PACKET_IN (xid=0x0): total_len=54 in_port=1 (via action) data_len=54 (unbuffered)
1415 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:2e7d
1417 OFPT_PACKET_IN (xid=0x0): total_len=54 in_port=1 (via action) data_len=54 (unbuffered)
1418 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:2e7d
1420 OFPT_PACKET_IN (xid=0x0): total_len=54 in_port=1 (via action) data_len=54 (unbuffered)
1421 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:2e7d
1424 dnl Modified controller action.
1425 AT_CHECK([ovs-ofctl monitor -P standard br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
1428 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)'
1430 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1431 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1433 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1434 OFPT_PACKET_IN (xid=0x0): total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
1435 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:2e7e
1437 OFPT_PACKET_IN (xid=0x0): total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
1438 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:2e7e
1440 OFPT_PACKET_IN (xid=0x0): total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
1441 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:2e7e
1444 dnl Modified VLAN controller action.
1445 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --pidfile 2> ofctl_monitor.log])
1448 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)'
1450 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1451 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1453 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1454 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=38 in_port=1 (via action) data_len=38 (unbuffered)
1455 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
1457 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=38 in_port=1 (via action) data_len=38 (unbuffered)
1458 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
1460 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=38 in_port=1 (via action) data_len=38 (unbuffered)
1461 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
1465 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
1468 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)'
1470 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 18])
1471 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
1473 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1474 NXT_PACKET_IN (xid=0x0): cookie=0x1 total_len=54 in_port=1 (via action) data_len=54 (unbuffered)
1475 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:2e7d
1477 NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x3 total_len=58 reg0=0x1,in_port=1 (via action) data_len=58 (unbuffered)
1478 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:2e7d
1480 NXT_PACKET_IN (xid=0x0): table_id=2 cookie=0x4 total_len=58 reg0=0x1,reg1=0x2,in_port=1 (via action) data_len=58 (unbuffered)
1481 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:2e7d
1483 NXT_PACKET_IN (xid=0x0): table_id=3 cookie=0x5 total_len=58 reg0=0x1,reg1=0x2,reg2=0x3,in_port=1 (via action) data_len=58 (unbuffered)
1484 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:2e7d
1486 NXT_PACKET_IN (xid=0x0): table_id=4 cookie=0x6 total_len=58 reg0=0x1,reg1=0x2,reg2=0x3,reg3=0x4,in_port=1 (via action) data_len=58 (unbuffered)
1487 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:4880
1489 NXT_PACKET_IN (xid=0x0): table_id=5 cookie=0x7 total_len=58 reg0=0x1,reg1=0x2,reg2=0x3,reg3=0x4,reg4=0x5,tun_id=0x6,in_port=1 (via action) data_len=58 (unbuffered)
1490 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:6082
1492 NXT_PACKET_IN (xid=0x0): table_id=6 cookie=0x8 total_len=58 reg0=0x1,reg1=0x2,reg2=0x3,reg3=0x4,reg4=0x5,tun_id=0x6,in_port=1 (via action) data_len=58 (unbuffered)
1493 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:6035
1495 NXT_PACKET_IN (xid=0x0): table_id=7 cookie=0x9 total_len=58 reg0=0x1,reg1=0x2,reg2=0x3,reg3=0x4,reg4=0x5,tun_id=0x6,in_port=1 (via action) data_len=58 (unbuffered)
1496 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:5fea
1498 NXT_PACKET_IN (xid=0x0): table_id=7 cookie=0x9 total_len=58 reg0=0x1,reg1=0x2,reg2=0x3,reg3=0x4,reg4=0x5,tun_id=0x6,in_port=1 (via action) data_len=58 (unbuffered)
1499 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:5fea
1503 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
1506 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'
1508 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 18])
1509 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
1511 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1512 NXT_PACKET_IN (xid=0x0): cookie=0x1 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
1513 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
1515 NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x3 total_len=64 reg0=0x1,in_port=1 (via action) data_len=64 (unbuffered)
1516 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
1518 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)
1519 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
1521 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)
1522 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
1524 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)
1525 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
1527 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)
1528 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
1530 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)
1531 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
1533 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)
1534 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
1536 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)
1537 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
1540 dnl Modified ARP controller action.
1541 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --pidfile 2> ofctl_monitor.log])
1544 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)'
1547 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 18])
1548 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
1549 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1550 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=42 in_port=1 (via action) data_len=42 (unbuffered)
1551 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
1552 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=42 in_port=1 (via action) data_len=42 (unbuffered)
1553 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
1554 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=42 in_port=1 (via action) data_len=42 (unbuffered)
1555 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
1556 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=42 in_port=1 (via action) data_len=42 (unbuffered)
1557 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
1558 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=42 in_port=1 (via action) data_len=42 (unbuffered)
1559 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
1560 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=42 in_port=1 (via action) data_len=42 (unbuffered)
1561 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
1562 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=42 in_port=1 (via action) data_len=42 (unbuffered)
1563 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
1564 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=42 in_port=1 (via action) data_len=42 (unbuffered)
1565 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
1566 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=42 in_port=1 (via action) data_len=42 (unbuffered)
1567 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
1570 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
1573 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
1576 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'
1579 AT_CHECK([ovs-appctl time/warp 1000], [0], [ignore])
1580 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 18])
1581 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
1582 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1583 NXT_PACKET_IN (xid=0x0): cookie=0x1 total_len=98 in_port=1 (via action) data_len=98 (unbuffered)
1584 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
1586 NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x3 total_len=102 reg0=0x1,in_port=1 (via action) data_len=102 (unbuffered)
1587 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
1589 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)
1590 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
1592 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)
1593 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
1595 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)
1596 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
1598 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)
1599 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
1601 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)
1602 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
1604 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)
1605 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
1607 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)
1608 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
1611 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1612 cookie=0x1, n_packets=3, n_bytes=212, dl_src=20:22:22:22:22:22 actions=CONTROLLER:65535,resubmit(80,1)
1613 cookie=0x2, n_packets=3, n_bytes=162, dl_src=30:33:33:33:33:33 actions=mod_vlan_vid:15,CONTROLLER:65535
1614 cookie=0x3, table=1, n_packets=3, n_bytes=212, in_port=80 actions=load:0x1->NXM_NX_REG0[[]],mod_vlan_vid:80,CONTROLLER:65535,resubmit(81,2)
1615 cookie=0x4, table=2, n_packets=3, n_bytes=212, in_port=81 actions=load:0x2->NXM_NX_REG1[[]],mod_dl_src:80:81:81:81:81:81,CONTROLLER:65535,resubmit(82,3)
1616 cookie=0x5, table=3, n_packets=3, n_bytes=212, in_port=82 actions=load:0x3->NXM_NX_REG2[[]],mod_dl_dst:82:82:82:82:82:82,CONTROLLER:65535,resubmit(83,4)
1617 cookie=0x6, table=4, n_packets=3, n_bytes=212, in_port=83 actions=load:0x4->NXM_NX_REG3[[]],mod_nw_src:83.83.83.83,CONTROLLER:65535,resubmit(84,5)
1618 cookie=0x7, table=5, n_packets=3, n_bytes=212, 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)
1619 cookie=0x8, table=6, n_packets=3, n_bytes=212, in_port=85 actions=mod_tp_src:85,CONTROLLER:65535,resubmit(86,7)
1620 cookie=0x9, table=7, n_packets=3, n_bytes=212, in_port=86 actions=mod_tp_dst:86,CONTROLLER:65535,CONTROLLER:65535
1621 cookie=0xa, n_packets=3, n_bytes=102, dl_src=40:44:44:44:44:41 actions=mod_vlan_vid:99,mod_vlan_pcp:1,CONTROLLER:65535
1622 cookie=0xd, n_packets=3, n_bytes=126, 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
1623 n_packets=3, n_bytes=162, dl_src=10:11:11:11:11:11 actions=CONTROLLER:65535
1630 AT_SETUP([ofproto-dpif - MPLS handling])
1631 OVS_VSWITCHD_START([dnl
1632 add-port br0 p1 -- set Interface p1 type=dummy
1634 on_exit 'kill `cat ovs-ofctl.pid`'
1636 AT_CAPTURE_FILE([ofctl_monitor.log])
1637 AT_DATA([flows.txt], [dnl
1638 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
1639 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
1640 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
1641 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
1642 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
1643 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
1644 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
1645 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
1646 cookie=0xa mpls,dl_src=40:44:44:44:44:49 actions=push_mpls:0x8848,load:10->OXM_OF_MPLS_LABEL[[]],CONTROLLER:65535
1647 cookie=0xb dl_src=50:55:55:55:55:55 dl_type=0x8847 actions=load:1000->OXM_OF_MPLS_LABEL[[]],controller
1648 cookie=0xd dl_src=60:66:66:66:66:66 actions=pop_mpls:0x0800,controller
1649 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
1651 cookie=0xd dl_src=60:66:66:66:00:01 actions=pop_mpls:0x0800,dec_ttl,controller
1652 cookie=0xd dl_src=60:66:66:66:00:02 actions=pop_mpls:0x0800,load:0xa000001->OXM_OF_IPV4_DST[[]],controller
1653 cookie=0xd dl_src=60:66:66:66:00:03 actions=pop_mpls:0x0800,move:OXM_OF_IPV4_DST[[]]->OXM_OF_IPV4_SRC[[]],controller
1654 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
1655 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
1656 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
1657 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
1659 cookie=0xd dl_src=60:66:66:66:00:08 actions=pop_mpls:0x0806,resubmit(1,1)
1660 cookie=0xd table=1 arp actions=controller
1662 cookie=0xdeadbeef table=2 dl_src=60:66:66:66:00:09 actions=pop_mpls:0x0800,mod_nw_tos:48
1663 cookie=0xd dl_src=60:66:66:66:00:09 actions=resubmit(,2),controller
1664 cookie=0xd dl_src=60:66:66:66:00:0a actions=pop_mpls:0x0800,mod_nw_dst:10.0.0.1,controller
1665 cookie=0xd dl_src=60:66:66:66:00:0b actions=pop_mpls:0x0800,mod_nw_src:10.0.0.1,controller
1667 cookie=0xd dl_src=60:66:66:66:01:00 actions=pop_mpls:0x8848,controller
1668 cookie=0xd dl_src=60:66:66:66:01:01 actions=pop_mpls:0x8847,dec_mpls_ttl,controller
1669 cookie=0xd dl_src=60:66:66:66:01:02 actions=pop_mpls:0x8848,load:3->OXM_OF_MPLS_TC[[]],controller
1671 cookie=0xd dl_src=60:66:66:66:02:00 actions=pop_mpls:0x8847,pop_mpls:0x0800,controller
1672 cookie=0xe dl_src=60:66:66:66:02:01 actions=pop_mpls:0x8848,pop_mpls:0x0800,dec_ttl,controller
1673 cookie=0xe dl_src=60:66:66:66:02:10 actions=pop_mpls:0x8847,dec_mpls_ttl,pop_mpls:0x0800,dec_ttl,controller
1675 cookie=0xe dl_src=60:66:66:66:03:00 actions=pop_mpls:0x8848,pop_mpls:0x8848,controller
1676 cookie=0xe dl_src=60:66:66:66:03:01 actions=pop_mpls:0x8847,pop_mpls:0x8847,dec_mpls_ttl,controller
1677 cookie=0xe dl_src=60:66:66:66:03:10 actions=pop_mpls:0x8848,dec_mpls_ttl,pop_mpls:0x8848,dec_mpls_ttl,controller
1679 cookie=0xf dl_src=60:66:66:66:04:00 actions=pop_mpls:0x0800,push_mpls:0x8847,controller
1680 cookie=0xf dl_src=60:66:66:66:04:01 actions=pop_mpls:0x0800,push_mpls:0x8848,dec_mpls_ttl,controller
1681 cookie=0xf dl_src=60:66:66:66:04:10 actions=pop_mpls:0x0800,dec_ttl,push_mpls:0x8848,dec_mpls_ttl,controller
1683 cookie=0x5 dl_src=60:66:66:66:05:00 actions=push_mpls:0x8848,pop_mpls:0x8847,controller
1684 cookie=0x5 dl_src=60:66:66:66:05:01 actions=push_mpls:0x8847,pop_mpls:0x8848,dec_mpls_ttl,controller
1685 cookie=0x5 dl_src=60:66:66:66:05:10 actions=push_mpls:0x8848,dec_mpls_ttl,pop_mpls:0x8847,dec_mpls_ttl,controller
1687 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
1689 dnl Modified MPLS controller action.
1690 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --pidfile 2> ofctl_monitor.log])
1693 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)'
1695 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1696 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1698 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1699 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=46 in_port=1 (via action) data_len=46 (unbuffered)
1700 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
1702 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=46 in_port=1 (via action) data_len=46 (unbuffered)
1703 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
1705 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=46 in_port=1 (via action) data_len=46 (unbuffered)
1706 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
1709 dnl Modified MPLS controller action.
1710 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --pidfile 2> ofctl_monitor.log])
1713 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)'
1715 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1716 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1718 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1719 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=34 in_port=1 (via action) data_len=34 (unbuffered)
1720 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
1722 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=34 in_port=1 (via action) data_len=34 (unbuffered)
1723 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
1725 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=34 in_port=1 (via action) data_len=34 (unbuffered)
1726 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
1729 dnl Modified MPLS controller action.
1730 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --pidfile 2> ofctl_monitor.log])
1732 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)
1735 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)'
1737 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1738 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1740 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1741 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=22 in_port=1 (via action) data_len=22 (unbuffered)
1742 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
1744 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=22 in_port=1 (via action) data_len=22 (unbuffered)
1745 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
1747 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=22 in_port=1 (via action) data_len=22 (unbuffered)
1748 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
1751 dnl Modified MPLS controller action.
1752 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --pidfile 2> ofctl_monitor.log])
1755 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))'
1757 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1758 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1760 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1761 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=42 in_port=1 (via action) data_len=42 (unbuffered)
1762 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
1764 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=42 in_port=1 (via action) data_len=42 (unbuffered)
1765 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
1767 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=42 in_port=1 (via action) data_len=42 (unbuffered)
1768 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
1771 dnl Modified MPLS controller action.
1772 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --pidfile 2> ofctl_monitor.log])
1775 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)'
1777 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1778 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1780 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1781 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=38 in_port=1 (via action) data_len=38 (unbuffered)
1782 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
1784 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=38 in_port=1 (via action) data_len=38 (unbuffered)
1785 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
1787 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=38 in_port=1 (via action) data_len=38 (unbuffered)
1788 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
1791 dnl Modified MPLS controller action.
1792 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --pidfile 2> ofctl_monitor.log])
1795 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)'
1797 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1798 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1800 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1801 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=38 in_port=1 (via action) data_len=38 (unbuffered)
1802 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
1804 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=38 in_port=1 (via action) data_len=38 (unbuffered)
1805 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
1807 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=38 in_port=1 (via action) data_len=38 (unbuffered)
1808 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
1811 dnl Modified MPLS controller action.
1812 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --pidfile 2> ofctl_monitor.log])
1815 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)'
1817 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1818 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1820 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1821 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=38 in_port=1 (via action) data_len=38 (unbuffered)
1822 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
1824 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=38 in_port=1 (via action) data_len=38 (unbuffered)
1825 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
1827 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=38 in_port=1 (via action) data_len=38 (unbuffered)
1828 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
1831 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
1833 dnl Modified MPLS controller action.
1834 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --pidfile 2> ofctl_monitor.log])
1837 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)'
1839 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1840 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
1842 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1843 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=22 in_port=1 (via action) data_len=22 (unbuffered)
1844 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
1846 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=22 in_port=1 (via action) data_len=22 (unbuffered)
1847 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
1849 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=22 in_port=1 (via action) data_len=22 (unbuffered)
1850 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
1853 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
1855 dnl Modified MPLS controller action.
1856 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --pidfile 2> ofctl_monitor.log])
1859 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)'
1861 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1862 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1864 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1865 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=38 in_port=1 (via action) data_len=38 (unbuffered)
1866 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
1868 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=38 in_port=1 (via action) data_len=38 (unbuffered)
1869 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
1871 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=38 in_port=1 (via action) data_len=38 (unbuffered)
1872 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
1875 dnl Modified MPLS actions.
1876 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --pidfile 2> ofctl_monitor.log])
1879 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)'
1881 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1882 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1884 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1885 NXT_PACKET_IN (xid=0x0): cookie=0xb total_len=18 in_port=1 (via action) data_len=18 (unbuffered)
1886 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
1888 NXT_PACKET_IN (xid=0x0): cookie=0xb total_len=18 in_port=1 (via action) data_len=18 (unbuffered)
1889 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
1891 NXT_PACKET_IN (xid=0x0): cookie=0xb total_len=18 in_port=1 (via action) data_len=18 (unbuffered)
1892 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
1895 dnl Modified MPLS ipv6 controller action.
1896 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --pidfile 2> ofctl_monitor.log])
1899 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)'
1901 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1902 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1904 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1905 NXT_PACKET_IN (xid=0x0): cookie=0xc total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
1906 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
1908 NXT_PACKET_IN (xid=0x0): cookie=0xc total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
1909 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
1911 NXT_PACKET_IN (xid=0x0): cookie=0xc total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
1912 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
1916 dnl Modified MPLS pop action.
1917 dnl The input is a frame with two MPLS headers which tcpdump -vve shows as:
1918 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)
1919 dnl (tos 0x0, ttl 64, id 0, offset 0, flags [none], proto TCP (6), length 44)
1921 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --pidfile 2> ofctl_monitor.log])
1924 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'
1927 # 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)'
1929 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1930 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1932 AT_CHECK([cat 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: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
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: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
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: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
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:01 > 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 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'
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: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
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: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
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: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
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:02 > 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 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'
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: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
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: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
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: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
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:03 > 50:54:00:00:00:07, ethertype MPLS multicast (0x8848), 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 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'
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: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
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: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
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: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
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:04 > 50:54:00:00:00:07, ethertype MPLS unicast (0x8847), 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 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'
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: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
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: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
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: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
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:05 > 50:54:00:00:00:07, ethertype MPLS unicast (0x8847), 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 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'
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: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
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: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
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: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
2073 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2075 dnl Modified MPLS pop action.
2076 dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as:
2077 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)
2078 dnl (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44)
2079 dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4
2080 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --pidfile 2> ofctl_monitor.log])
2083 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'
2085 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2086 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2088 AT_CHECK([strip_metadata < ofctl_monitor.log], [0], [dnl
2089 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2090 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
2092 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2093 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
2095 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2096 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
2099 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2101 dnl Modified MPLS pop action.
2102 dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as:
2103 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)
2104 dnl (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44)
2105 dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4
2106 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --pidfile 2> ofctl_monitor.log])
2109 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'
2111 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2112 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2114 AT_CHECK([strip_metadata < ofctl_monitor.log], [0], [dnl
2115 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2116 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
2118 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2119 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
2121 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2122 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
2125 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2127 dnl Modified MPLS pop action.
2128 dnl The input is an ARP frame with a single MPLS label stack entry which tcpdump -vve shows as:
2129 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)
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 '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'
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): table_id=1 cookie=0xd total_len=42 in_port=1 (via action) data_len=42 (unbuffered)
2140 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
2142 NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0xd total_len=42 in_port=1 (via action) data_len=42 (unbuffered)
2143 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
2145 NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0xd total_len=42 in_port=1 (via action) data_len=42 (unbuffered)
2146 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
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:09 > 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 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'
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: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
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: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
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: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
2175 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2177 dnl Modified MPLS pop action.
2178 dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as:
2179 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)
2180 dnl (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44)
2181 dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4
2182 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --pidfile 2> ofctl_monitor.log])
2185 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'
2187 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2188 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2190 AT_CHECK([strip_metadata < ofctl_monitor.log], [0], [dnl
2191 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2192 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
2194 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2195 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
2197 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2198 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
2201 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2203 dnl Modified MPLS pop action.
2204 dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as:
2205 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)
2206 dnl (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44)
2207 dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4
2208 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --pidfile 2> ofctl_monitor.log])
2211 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'
2213 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2214 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2216 AT_CHECK([strip_metadata < ofctl_monitor.log], [0], [dnl
2217 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2218 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
2220 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2221 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
2223 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2224 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
2227 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2229 dnl Modified MPLS pop action.
2230 dnl The input is a frame with two MPLS label stack entries which tcpdump -vve shows as:
2231 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)
2232 dnl (label 20, exp 0, [S], ttl 31)
2233 dnl (tos 0x0, ttl 254, id 0, offset 0, flags [none], proto TCP (6), length 44)
2234 dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x7744 (correct), seq 42:46, win 10000, length 4
2235 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --pidfile 2> ofctl_monitor.log])
2238 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'
2240 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2241 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2243 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
2244 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2245 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
2247 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2248 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
2250 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2251 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
2254 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2256 dnl Modified MPLS pop action.
2257 dnl The input is a frame with two MPLS label stack entries which tcpdump -vve shows as:
2258 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)
2259 dnl (label 20, exp 0, [S], ttl 31)
2260 dnl (tos 0x0, ttl 254, id 0, offset 0, flags [none], proto TCP (6), length 44)
2261 dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x7744 (correct), seq 42:46, win 10000, length 4
2262 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --pidfile 2> ofctl_monitor.log])
2265 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'
2267 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2268 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2270 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
2271 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2272 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
2274 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2275 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
2277 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2278 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
2281 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2283 dnl Modified MPLS pop action.
2284 dnl The input is a frame with two MPLS label stack entries which tcpdump -vve shows as:
2285 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)
2286 dnl (label 20, exp 0, [S], ttl 31)
2287 dnl (tos 0x0, ttl 254, id 0, offset 0, flags [none], proto TCP (6), length 44)
2288 dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x7744 (correct), seq 42:46, win 10000, length 4
2289 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --pidfile 2> ofctl_monitor.log])
2292 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'
2294 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2295 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2297 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
2298 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2299 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
2301 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2302 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
2304 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2305 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
2308 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2310 dnl Modified MPLS pop action.
2311 dnl The input is a frame with two MPLS label stack entries which tcpdump -vve shows as:
2312 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)
2313 dnl (label 20, exp 0, [S], ttl 31)
2314 dnl (tos 0x0, ttl 254, id 0, offset 0, flags [none], proto TCP (6), length 44)
2315 dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x7744 (correct), seq 42:46, win 10000, length 4
2316 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --pidfile 2> ofctl_monitor.log])
2319 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'
2321 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2322 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2324 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
2325 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2326 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
2328 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2329 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
2331 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2332 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
2335 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2337 dnl Modified MPLS pop action.
2338 dnl The input is a frame with two MPLS label stack entries which tcpdump -vve shows as:
2339 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)
2340 dnl (label 20, exp 0, [S], ttl 31)
2341 dnl (tos 0x0, ttl 254, id 0, offset 0, flags [none], proto TCP (6), length 44)
2342 dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x7744 (correct), seq 42:46, win 10000, length 4
2343 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --pidfile 2> ofctl_monitor.log])
2346 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'
2349 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2350 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2352 AT_CHECK([strip_metadata < ofctl_monitor.log], [0], [dnl
2353 NXT_PACKET_IN (xid=0x0): cookie=0xe total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2354 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
2356 NXT_PACKET_IN (xid=0x0): cookie=0xe total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2357 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
2359 NXT_PACKET_IN (xid=0x0): cookie=0xe total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2360 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
2363 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2365 dnl Modified MPLS pop action.
2366 dnl The input is a frame with two MPLS label stack entries which tcpdump -vve shows as:
2367 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)
2368 dnl (label 20, exp 0, [S], ttl 31)
2369 dnl (tos 0x0, ttl 254, id 0, offset 0, flags [none], proto TCP (6), length 44)
2370 dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x7744 (correct), seq 42:46, win 10000, length 4
2371 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --pidfile 2> ofctl_monitor.log])
2374 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'
2376 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2377 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2379 AT_CHECK([strip_metadata < ofctl_monitor.log], [0], [dnl
2380 NXT_PACKET_IN (xid=0x0): cookie=0xe total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2381 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
2383 NXT_PACKET_IN (xid=0x0): cookie=0xe total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2384 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
2386 NXT_PACKET_IN (xid=0x0): cookie=0xe total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2387 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
2390 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2392 dnl Modified MPLS pop action.
2393 dnl The input is a frame with three MPLS label stack entries which tcpdump -vve shows as:
2394 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)
2395 dnl (label 20, exp 0, ttl 31)
2396 dnl (label 20, exp 0, [S], ttl 30)
2397 dnl (tos 0x0, ttl 254, id 0, offset 0, flags [none], proto TCP (6), length 44)
2398 dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x7744 (correct), seq 42:46, win 10000, length 4
2399 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --pidfile 2> ofctl_monitor.log])
2402 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'
2404 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2405 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2407 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
2408 NXT_PACKET_IN (xid=0x0): cookie=0xe total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2409 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
2411 NXT_PACKET_IN (xid=0x0): cookie=0xe total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2412 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
2414 NXT_PACKET_IN (xid=0x0): cookie=0xe total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2415 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
2418 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2420 dnl Modified MPLS pop action.
2421 dnl The input is a frame with three MPLS label stack entries which tcpdump -vve shows as:
2422 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)
2423 dnl (label 20, exp 0, ttl 31)
2424 dnl (label 20, exp 0, [S], ttl 30)
2425 dnl (tos 0x0, ttl 254, id 0, offset 0, flags [none], proto TCP (6), length 44)
2426 dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x7744 (correct), seq 42:46, win 10000, length 4
2427 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --pidfile 2> ofctl_monitor.log])
2430 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'
2432 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2433 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2435 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
2436 NXT_PACKET_IN (xid=0x0): cookie=0xe total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2437 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
2439 NXT_PACKET_IN (xid=0x0): cookie=0xe total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2440 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
2442 NXT_PACKET_IN (xid=0x0): cookie=0xe total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2443 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
2446 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2448 dnl Modified MPLS pop action.
2449 dnl The input is a frame with three MPLS label stack entries which tcpdump -vve shows as:
2450 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)
2451 dnl (label 20, exp 0, ttl 31)
2452 dnl (label 20, exp 0, [S], ttl 30)
2453 dnl (tos 0x0, ttl 254, 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 0x7744 (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 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'
2460 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2461 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2463 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
2464 NXT_PACKET_IN (xid=0x0): cookie=0xe total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2465 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
2467 NXT_PACKET_IN (xid=0x0): cookie=0xe total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2468 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
2470 NXT_PACKET_IN (xid=0x0): cookie=0xe total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2471 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
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:00 > 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 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'
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 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
2493 NXT_PACKET_IN (xid=0x0): cookie=0xf total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2494 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
2496 NXT_PACKET_IN (xid=0x0): cookie=0xf total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2497 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
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:04:01 > 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 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'
2512 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2513 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2515 AT_CHECK([strip_metadata < ofctl_monitor.log], [0], [dnl
2516 NXT_PACKET_IN (xid=0x0): cookie=0xf total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2517 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
2519 NXT_PACKET_IN (xid=0x0): cookie=0xf total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2520 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
2522 NXT_PACKET_IN (xid=0x0): cookie=0xf total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2523 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
2526 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2528 dnl Modified MPLS pop action.
2529 dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as:
2530 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)
2531 dnl (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44)
2532 dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4
2533 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --pidfile 2> ofctl_monitor.log])
2536 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'
2538 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2539 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2541 AT_CHECK([strip_metadata < ofctl_monitor.log], [0], [dnl
2542 NXT_PACKET_IN (xid=0x0): cookie=0xf total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2543 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
2545 NXT_PACKET_IN (xid=0x0): cookie=0xf total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2546 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
2548 NXT_PACKET_IN (xid=0x0): cookie=0xf total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2549 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
2552 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2554 dnl Modified MPLS pop action.
2555 dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as:
2556 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)
2557 dnl (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44)
2558 dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4
2559 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --pidfile 2> ofctl_monitor.log])
2562 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'
2565 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2566 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2568 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
2569 NXT_PACKET_IN (xid=0x0): cookie=0x5 total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2570 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
2572 NXT_PACKET_IN (xid=0x0): cookie=0x5 total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2573 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
2575 NXT_PACKET_IN (xid=0x0): cookie=0x5 total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2576 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
2579 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2581 dnl Modified MPLS pop action.
2582 dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as:
2583 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)
2584 dnl (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44)
2585 dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4
2586 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --pidfile 2> ofctl_monitor.log])
2589 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'
2591 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2592 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2594 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
2595 NXT_PACKET_IN (xid=0x0): cookie=0x5 total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2596 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
2598 NXT_PACKET_IN (xid=0x0): cookie=0x5 total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2599 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
2601 NXT_PACKET_IN (xid=0x0): cookie=0x5 total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2602 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
2605 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2607 dnl Modified MPLS pop action.
2608 dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as:
2609 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)
2610 dnl (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44)
2611 dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4
2612 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --pidfile 2> ofctl_monitor.log])
2615 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'
2618 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2619 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2621 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
2622 NXT_PACKET_IN (xid=0x0): cookie=0x5 total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2623 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
2625 NXT_PACKET_IN (xid=0x0): cookie=0x5 total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2626 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
2628 NXT_PACKET_IN (xid=0x0): cookie=0x5 total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2629 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
2632 AT_CHECK([ovs-appctl revalidator/purge], [0])
2633 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
2634 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
2635 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
2636 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
2637 cookie=0xa, n_packets=3, n_bytes=102, 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
2638 cookie=0xa, n_packets=3, n_bytes=102, 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
2639 cookie=0xa, n_packets=3, n_bytes=102, 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
2640 cookie=0xa, n_packets=3, n_bytes=102, 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
2641 cookie=0xa, n_packets=3, n_bytes=102, 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
2642 cookie=0xa, n_packets=3, n_bytes=114, 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
2643 cookie=0xa, n_packets=3, n_bytes=126, 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
2644 cookie=0xa, n_packets=3, n_bytes=54, 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
2645 cookie=0xa, n_packets=3, n_bytes=54, mpls,dl_src=40:44:44:44:44:49 actions=push_mpls:0x8848,load:0xa->OXM_OF_MPLS_LABEL[[]],CONTROLLER:65535
2646 cookie=0xb, n_packets=3, n_bytes=54, mpls,dl_src=50:55:55:55:55:55 actions=load:0x3e8->OXM_OF_MPLS_LABEL[[]],CONTROLLER:65535
2647 cookie=0xc, n_packets=3, n_bytes=162, 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
2648 cookie=0xd, n_packets=3, n_bytes=138, dl_src=60:66:66:66:00:08 actions=pop_mpls:0x0806,resubmit(1,1)
2649 cookie=0xd, n_packets=3, n_bytes=186, dl_src=60:66:66:66:00:01 actions=pop_mpls:0x0800,dec_ttl,CONTROLLER:65535
2650 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
2651 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
2652 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
2653 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
2654 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
2655 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
2656 cookie=0xd, n_packets=3, n_bytes=186, dl_src=60:66:66:66:00:09 actions=resubmit(,2),CONTROLLER:65535
2657 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
2658 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
2659 cookie=0xd, n_packets=3, n_bytes=186, dl_src=60:66:66:66:66:66 actions=pop_mpls:0x0800,CONTROLLER:65535
2660 cookie=0xd, n_packets=3, n_bytes=198, dl_src=60:66:66:66:01:00 actions=pop_mpls:0x8848,CONTROLLER:65535
2661 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
2662 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
2663 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
2664 cookie=0xd, table=1, n_packets=3, n_bytes=126, arp actions=CONTROLLER:65535
2665 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
2666 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
2667 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
2668 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
2669 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
2670 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
2671 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
2672 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
2673 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
2680 AT_SETUP([ofproto-dpif - MPLS handling with goto_table])
2681 OVS_VSWITCHD_START([dnl
2682 add-port br0 p1 -- set Interface p1 type=dummy
2684 on_exit 'kill `cat ovs-ofctl.pid`'
2686 AT_CAPTURE_FILE([ofctl_monitor.log])
2687 AT_DATA([flows.txt], [dnl
2688 table=0 mplsm actions=pop_mpls:0x800,goto_table(1)
2689 table=1 ip,ip_dscp=8 actions=controller
2691 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flows br0 flows.txt])
2694 dnl Modified MPLS pop action.
2695 dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as:
2696 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)
2697 dnl (tos 0x20, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44)
2698 dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4
2699 AT_CHECK([ovs-ofctl -O OpenFlow12 monitor br0 65534 -P standard --detach --pidfile 2> ofctl_monitor.log])
2702 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'
2704 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2705 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2707 AT_CHECK([strip_metadata < ofctl_monitor.log], [0], [dnl
2708 OFPT_PACKET_IN (OF1.2) (xid=0x0): table_id=1 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=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744
2711 OFPT_PACKET_IN (OF1.2) (xid=0x0): table_id=1 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=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7744
2714 OFPT_PACKET_IN (OF1.2) (xid=0x0): table_id=1 total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2715 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
2718 AT_CHECK([ovs-appctl revalidator/purge], [0])
2719 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
2720 n_packets=3, n_bytes=186, mplsm actions=pop_mpls:0x0800,goto_table:1
2721 table=1, n_packets=3, n_bytes=174, ip,nw_tos=32 actions=CONTROLLER:65535
2722 OFPST_FLOW reply (OF1.2):
2728 AT_SETUP([ofproto-dpif - MPLS handling with write_actions])
2729 OVS_VSWITCHD_START([dnl
2730 add-port br0 p1 -- set Interface p1 type=dummy
2732 on_exit 'kill `cat ovs-ofctl.pid`'
2734 dnl N.B: The first (and only) action that accesses L3 data after the
2735 dnl pop_mpls action is present in write_actions. This exercises recirculation
2736 dnl triggered in write_actions due to a previous action not in write actions.
2737 AT_CAPTURE_FILE([ofctl_monitor.log])
2738 AT_DATA([flows.txt], [dnl
2739 mplsm actions=pop_mpls:0x800,write_actions(dec_ttl,controller)
2741 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flows br0 flows.txt])
2743 dnl Modified MPLS pop action.
2744 dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as:
2745 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)
2746 dnl (tos 0x20, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44)
2747 dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4
2748 AT_CHECK([ovs-ofctl -O OpenFlow12 monitor br0 65534 -P standard --detach --pidfile 2> ofctl_monitor.log])
2751 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'
2753 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2754 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2756 AT_CHECK([strip_metadata < ofctl_monitor.log], [0], [dnl
2757 OFPT_PACKET_IN (OF1.2) (xid=0x0): total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2758 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
2760 OFPT_PACKET_IN (OF1.2) (xid=0x0): total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2761 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
2763 OFPT_PACKET_IN (OF1.2) (xid=0x0): total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2764 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
2767 AT_CHECK([ovs-appctl revalidator/purge], [0])
2768 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
2769 n_packets=3, n_bytes=186, mplsm actions=pop_mpls:0x0800,write_actions(dec_ttl,CONTROLLER:65535)
2770 OFPST_FLOW reply (OF1.2):
2776 AT_SETUP([ofproto-dpif - table-miss flow (OpenFlow 1.0)])
2777 OVS_VSWITCHD_START([dnl
2778 add-port br0 p1 -- set Interface p1 type=dummy
2780 on_exit 'kill `cat ovs-ofctl.pid`'
2782 AT_CAPTURE_FILE([ofctl_monitor.log])
2783 # A table-miss flow has priority 0 and no match
2784 AT_CHECK([ovs-ofctl --protocols=OpenFlow10 add-flow br0 'priority=0 actions=output:CONTROLLER'])
2786 dnl Singleton controller action.
2787 AT_CHECK([ovs-ofctl monitor -P standard --protocols=OpenFlow10 br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
2790 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)'
2792 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2793 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
2795 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
2796 OFPT_PACKET_IN (xid=0x0): total_len=54 in_port=1 (via action) data_len=54 (unbuffered)
2797 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:2e7d
2799 OFPT_PACKET_IN (xid=0x0): total_len=54 in_port=1 (via action) data_len=54 (unbuffered)
2800 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:2e7d
2802 OFPT_PACKET_IN (xid=0x0): total_len=54 in_port=1 (via action) data_len=54 (unbuffered)
2803 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:2e7d
2806 AT_CHECK([ovs-appctl revalidator/purge], [0])
2807 AT_CHECK([ovs-ofctl --protocols=OpenFlow10 dump-flows br0 | ofctl_strip | sort], [0], [dnl
2808 n_packets=3, n_bytes=162, priority=0 actions=CONTROLLER:65535
2816 AT_SETUP([ofproto-dpif - table-miss flow (OpenFlow 1.3)])
2817 OVS_VSWITCHD_START([dnl
2818 add-port br0 p1 -- set Interface p1 type=dummy
2820 on_exit 'kill `cat ovs-ofctl.pid`'
2822 AT_CAPTURE_FILE([ofctl_monitor.log])
2823 # A table-miss flow has priority 0 and no match
2824 AT_CHECK([ovs-ofctl --protocols=OpenFlow13 add-flow br0 'priority=0 actions=output:CONTROLLER'])
2826 dnl Singleton controller action.
2827 AT_CHECK([ovs-ofctl monitor -P standard --protocols=OpenFlow13 br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
2830 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)'
2832 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2833 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
2835 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2837 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
2838 OFPT_PACKET_IN (OF1.3) (xid=0x0): cookie=0x0 total_len=54 in_port=1 (via no_match) data_len=54 (unbuffered)
2839 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:2e7d
2841 OFPT_PACKET_IN (OF1.3) (xid=0x0): cookie=0x0 total_len=54 in_port=1 (via no_match) data_len=54 (unbuffered)
2842 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:2e7d
2844 OFPT_PACKET_IN (OF1.3) (xid=0x0): cookie=0x0 total_len=54 in_port=1 (via no_match) data_len=54 (unbuffered)
2845 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:2e7d
2848 AT_CHECK([ovs-appctl revalidator/purge], [0])
2849 AT_CHECK([ovs-ofctl --protocols=OpenFlow13 dump-flows br0 | ofctl_strip | sort], [0], [dnl
2850 n_packets=3, n_bytes=162, priority=0 actions=CONTROLLER:65535
2851 OFPST_FLOW reply (OF1.3):
2857 AT_SETUP([ofproto-dpif - table-miss flow with async config (OpenFlow 1.3)])
2858 OVS_VSWITCHD_START([dnl
2859 add-port br0 p1 -- set Interface p1 type=dummy
2861 on_exit 'kill `cat ovs-ofctl.pid`'
2863 ovs-appctl time/stop
2865 AT_CAPTURE_FILE([ofctl_monitor.log])
2866 # A table-miss flow has priority 0 and no match
2867 AT_CHECK([ovs-ofctl --protocols=OpenFlow13 add-flow br0 'priority=0 actions=output:CONTROLLER'])
2869 dnl Singleton controller action.
2870 AT_CHECK([ovs-ofctl monitor -P standard --protocols=OpenFlow13 br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
2872 # Become slave (OF 1.3), which should disable everything except port status.
2873 ovs-appctl -t ovs-ofctl ofctl/send 041800180000000200000003000000000000000000000001
2875 # Ensure that ovs-vswitchd gets a chance to reply before sending another command.
2876 ovs-appctl time/warp 500 100
2878 # Use OF 1.3 OFPT_SET_ASYNC to enable OFPR_NO_MATCH for slave only.
2879 ovs-appctl -t ovs-ofctl ofctl/send 041c002000000002000000000000000100000000000000000000000000000000
2881 ovs-appctl time/warp 500 100
2883 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)'
2885 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2886 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
2888 AT_CHECK([ovs-appctl revalidator/purge], [0])
2889 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
2890 send: OFPT_ROLE_REQUEST (OF1.3) (xid=0x2): role=slave generation_id=1
2891 OFPT_ROLE_REPLY (OF1.3) (xid=0x2): role=slave generation_id=1
2893 send: OFPT_SET_ASYNC (OF1.3) (xid=0x2):
2900 REQUESTFORWARD: (off)
2908 REQUESTFORWARD: (off)
2910 OFPT_PACKET_IN (OF1.3) (xid=0x0): cookie=0x0 total_len=54 in_port=1 (via no_match) data_len=54 (unbuffered)
2911 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:2e7d
2913 OFPT_PACKET_IN (OF1.3) (xid=0x0): cookie=0x0 total_len=54 in_port=1 (via no_match) data_len=54 (unbuffered)
2914 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:2e7d
2916 OFPT_PACKET_IN (OF1.3) (xid=0x0): cookie=0x0 total_len=54 in_port=1 (via no_match) data_len=54 (unbuffered)
2917 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:2e7d
2920 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2922 AT_CHECK([ovs-ofctl --protocols=OpenFlow13 dump-flows br0 | ofctl_strip | sort], [0], [dnl
2923 n_packets=3, n_bytes=162, priority=0 actions=CONTROLLER:65535
2924 OFPST_FLOW reply (OF1.3):
2931 AT_SETUP([ofproto-dpif - table-miss flow (OpenFlow 1.4)])
2932 OVS_VSWITCHD_START([dnl
2933 add-port br0 p1 -- set Interface p1 type=dummy
2935 on_exit 'kill `cat ovs-ofctl.pid`'
2937 AT_CAPTURE_FILE([ofctl_monitor.log])
2938 # A table-miss flow has priority 0 and no match
2939 AT_CHECK([ovs-ofctl --protocols=OpenFlow14 add-flow br0 'priority=0 actions=output:CONTROLLER'])
2941 dnl Singleton controller action.
2942 AT_CHECK([ovs-ofctl monitor -P standard --protocols=OpenFlow14 br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
2945 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)'
2947 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2948 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
2950 AT_CHECK([ovs-appctl revalidator/purge], [0])
2951 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
2952 OFPT_PACKET_IN (OF1.4) (xid=0x0): cookie=0x0 total_len=54 in_port=1 (via no_match) data_len=54 (unbuffered)
2953 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:2e7d
2955 OFPT_PACKET_IN (OF1.4) (xid=0x0): cookie=0x0 total_len=54 in_port=1 (via no_match) data_len=54 (unbuffered)
2956 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:2e7d
2958 OFPT_PACKET_IN (OF1.4) (xid=0x0): cookie=0x0 total_len=54 in_port=1 (via no_match) data_len=54 (unbuffered)
2959 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:2e7d
2962 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2964 AT_CHECK([ovs-ofctl --protocols=OpenFlow14 dump-flows br0 | ofctl_strip | sort], [0], [dnl
2965 n_packets=3, n_bytes=162, priority=0 actions=CONTROLLER:65535
2966 OFPST_FLOW reply (OF1.4):
2973 AT_SETUP([ofproto-dpif - packet-in reasons (Openflow 1.3)])
2974 OVS_VSWITCHD_START([dnl
2975 add-port br0 p1 -- set Interface p1 type=dummy
2977 on_exit 'kill `cat ovs-ofctl.pid`'
2979 AT_CAPTURE_FILE([ofctl_monitor.log])
2980 AT_DATA([flows.txt], [dnl
2981 table=0 in_port=1 actions=write_actions(output(CONTROLLER)),goto_table(1)
2982 table=1 actions=output(CONTROLLER),goto_table(2)
2983 table=2 actions=group:1234
2985 AT_CHECK([ovs-ofctl --protocols=OpenFlow13 add-group br0 'group_id=1234,type=all,bucket=output:10,bucket=output:CONTROLLER'])
2986 AT_CHECK([ovs-ofctl --protocols=OpenFlow13 add-flows br0 flows.txt])
2988 dnl Singleton controller action.
2989 AT_CHECK([ovs-ofctl monitor -P standard --protocols=OpenFlow13 br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
2992 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)'
2994 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2995 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
2997 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2999 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
3000 OFPT_PACKET_IN (OF1.3) (xid=0x0): table_id=1 cookie=0x0 total_len=54 in_port=1 (via action) data_len=54 (unbuffered)
3001 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:2e7d
3003 OFPT_PACKET_IN (OF1.3) (xid=0x0): table_id=2 cookie=0x0 total_len=54 in_port=1 (via action) data_len=54 (unbuffered)
3004 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:2e7d
3006 OFPT_PACKET_IN (OF1.3) (xid=0x0): cookie=0x0 total_len=54 in_port=1 (via action) data_len=54 (unbuffered)
3007 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:2e7d
3009 OFPT_PACKET_IN (OF1.3) (xid=0x0): table_id=1 cookie=0x0 total_len=54 in_port=1 (via action) data_len=54 (unbuffered)
3010 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:2e7d
3012 OFPT_PACKET_IN (OF1.3) (xid=0x0): table_id=2 cookie=0x0 total_len=54 in_port=1 (via action) data_len=54 (unbuffered)
3013 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:2e7d
3015 OFPT_PACKET_IN (OF1.3) (xid=0x0): cookie=0x0 total_len=54 in_port=1 (via action) data_len=54 (unbuffered)
3016 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:2e7d
3018 OFPT_PACKET_IN (OF1.3) (xid=0x0): table_id=1 cookie=0x0 total_len=54 in_port=1 (via action) data_len=54 (unbuffered)
3019 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:2e7d
3021 OFPT_PACKET_IN (OF1.3) (xid=0x0): table_id=2 cookie=0x0 total_len=54 in_port=1 (via action) data_len=54 (unbuffered)
3022 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:2e7d
3024 OFPT_PACKET_IN (OF1.3) (xid=0x0): cookie=0x0 total_len=54 in_port=1 (via action) data_len=54 (unbuffered)
3025 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:2e7d
3028 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
3030 AT_CHECK([ovs-ofctl --protocols=OpenFlow13 dump-flows br0 | ofctl_strip | sort], [0], [dnl
3031 n_packets=3, n_bytes=162, in_port=1 actions=write_actions(CONTROLLER:65535),goto_table:1
3032 table=1, n_packets=3, n_bytes=162, actions=CONTROLLER:65535,goto_table:2
3033 table=2, n_packets=3, n_bytes=162, actions=group:1234
3034 OFPST_FLOW reply (OF1.3):
3041 AT_SETUP([ofproto-dpif - packet-in reasons (Openflow 1.4)])
3042 OVS_VSWITCHD_START([dnl
3043 add-port br0 p1 -- set Interface p1 type=dummy
3045 on_exit 'kill `cat ovs-ofctl.pid`'
3047 AT_CAPTURE_FILE([ofctl_monitor.log])
3048 AT_DATA([flows.txt], [dnl
3049 table=0 in_port=1 actions=write_actions(output(CONTROLLER)),goto_table(1)
3050 table=1 actions=output(CONTROLLER),goto_table(2)
3051 table=2 actions=group:1234
3053 AT_CHECK([ovs-ofctl --protocols=OpenFlow14 add-group br0 'group_id=1234,type=all,bucket=output:10,bucket=output:CONTROLLER'])
3054 AT_CHECK([ovs-ofctl --protocols=OpenFlow14 add-flows br0 flows.txt])
3056 dnl Singleton controller action.
3057 AT_CHECK([ovs-ofctl monitor -P standard --protocols=OpenFlow14 br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
3060 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)'
3062 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
3063 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
3065 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
3067 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
3068 OFPT_PACKET_IN (OF1.4) (xid=0x0): table_id=1 cookie=0x0 total_len=54 in_port=1 (via action) data_len=54 (unbuffered)
3069 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:2e7d
3071 OFPT_PACKET_IN (OF1.4) (xid=0x0): table_id=2 cookie=0x0 total_len=54 in_port=1 (via group) data_len=54 (unbuffered)
3072 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:2e7d
3074 OFPT_PACKET_IN (OF1.4) (xid=0x0): cookie=0x0 total_len=54 in_port=1 (via action_set) data_len=54 (unbuffered)
3075 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:2e7d
3077 OFPT_PACKET_IN (OF1.4) (xid=0x0): table_id=1 cookie=0x0 total_len=54 in_port=1 (via action) data_len=54 (unbuffered)
3078 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:2e7d
3080 OFPT_PACKET_IN (OF1.4) (xid=0x0): table_id=2 cookie=0x0 total_len=54 in_port=1 (via group) data_len=54 (unbuffered)
3081 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:2e7d
3083 OFPT_PACKET_IN (OF1.4) (xid=0x0): cookie=0x0 total_len=54 in_port=1 (via action_set) data_len=54 (unbuffered)
3084 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:2e7d
3086 OFPT_PACKET_IN (OF1.4) (xid=0x0): table_id=1 cookie=0x0 total_len=54 in_port=1 (via action) data_len=54 (unbuffered)
3087 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:2e7d
3089 OFPT_PACKET_IN (OF1.4) (xid=0x0): table_id=2 cookie=0x0 total_len=54 in_port=1 (via group) data_len=54 (unbuffered)
3090 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:2e7d
3092 OFPT_PACKET_IN (OF1.4) (xid=0x0): cookie=0x0 total_len=54 in_port=1 (via action_set) data_len=54 (unbuffered)
3093 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:2e7d
3096 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
3098 AT_CHECK([ovs-ofctl --protocols=OpenFlow14 dump-flows br0 | ofctl_strip | sort], [0], [dnl
3099 n_packets=3, n_bytes=162, in_port=1 actions=write_actions(CONTROLLER:65535),goto_table:1
3100 table=1, n_packets=3, n_bytes=162, actions=CONTROLLER:65535,goto_table:2
3101 table=2, n_packets=3, n_bytes=162, actions=group:1234
3102 OFPST_FLOW reply (OF1.4):
3109 AT_SETUP([ofproto-dpif - ARP modification slow-path])
3111 add_of_ports br0 1 2
3113 ovs-vsctl -- set Interface p2 type=dummy options:pcap=p2.pcap
3114 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'
3116 # Input some packets that should follow the arp modification slow-path.
3118 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)'
3120 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
3122 # Check the packets that were output.
3123 AT_CHECK([ovs-ofctl parse-pcap p2.pcap], [0], [dnl
3124 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
3125 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
3126 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
3127 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
3128 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
3129 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
3130 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
3131 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
3132 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
3138 AT_SETUP([ofproto-dpif - VLAN handling])
3140 [set Bridge br0 fail-mode=standalone -- \
3141 add-port br0 p1 trunks=10,12 -- \
3142 add-port br0 p2 tag=10 -- \
3143 add-port br0 p3 tag=12 \
3144 other-config:priority-tags=true -- \
3145 add-port br0 p4 tag=12 -- \
3146 add-port br0 p5 vlan_mode=native-tagged tag=10 -- \
3147 add-port br0 p6 vlan_mode=native-tagged tag=10 trunks=10,12 -- \
3148 add-port br0 p7 vlan_mode=native-untagged tag=12 -- \
3149 add-port br0 p8 vlan_mode=native-untagged tag=12 trunks=10,12 \
3150 other-config:priority-tags=true -- \
3151 set Interface p1 type=dummy -- \
3152 set Interface p2 type=dummy -- \
3153 set Interface p3 type=dummy -- \
3154 set Interface p4 type=dummy -- \
3155 set Interface p5 type=dummy -- \
3156 set Interface p6 type=dummy -- \
3157 set Interface p7 type=dummy -- \
3158 set Interface p8 type=dummy --])
3160 dnl Each of these specifies an in_port by number, a VLAN VID (or "none"),
3161 dnl a VLAN PCP (used if the VID isn't "none") and the expected set of datapath
3167 "100 10 0 1,5,6,7,8,pop_vlan,2" \
3168 "100 10 1 1,5,6,7,8,pop_vlan,2" \
3171 "100 12 0 1,5,6,pop_vlan,3,4,7,8" \
3172 "100 12 1 1,5,6,pop_vlan,4,7,push_vlan(vid=0,pcp=1),3,8" \
3176 "1 10 0 5,6,7,8,100,pop_vlan,2" \
3177 "1 10 1 5,6,7,8,100,pop_vlan,2" \
3180 "1 12 0 5,6,100,pop_vlan,3,4,7,8" \
3181 "1 12 1 5,6,100,pop_vlan,4,7,push_vlan(vid=0,pcp=1),3,8" \
3182 "2 none 0 push_vlan(vid=10,pcp=0),1,5,6,7,8,100" \
3183 "2 0 0 pop_vlan,push_vlan(vid=10,pcp=0),1,5,6,7,8,100" \
3184 "2 0 1 pop_vlan,push_vlan(vid=10,pcp=1),1,5,6,7,8,100" \
3191 "3 none 0 4,7,8,push_vlan(vid=12,pcp=0),1,5,6,100" \
3192 "3 0 0 pop_vlan,4,7,8,push_vlan(vid=12,pcp=0),1,5,6,100" \
3193 "3 0 1 8,pop_vlan,4,7,push_vlan(vid=12,pcp=1),1,5,6,100" \
3200 "4 none 0 3,7,8,push_vlan(vid=12,pcp=0),1,5,6,100" \
3201 "4 0 0 pop_vlan,3,7,8,push_vlan(vid=12,pcp=0),1,5,6,100" \
3202 "4 0 1 3,8,pop_vlan,7,push_vlan(vid=12,pcp=1),1,5,6,100" \
3209 "5 none 0 2,push_vlan(vid=10,pcp=0),1,6,7,8,100" \
3210 "5 0 0 pop_vlan,2,push_vlan(vid=10,pcp=0),1,6,7,8,100" \
3211 "5 0 1 pop_vlan,2,push_vlan(vid=10,pcp=1),1,6,7,8,100" \
3212 "5 10 0 1,6,7,8,100,pop_vlan,2" \
3213 "5 10 1 1,6,7,8,100,pop_vlan,2" \
3216 "5 12 0 1,6,100,pop_vlan,3,4,7,8" \
3217 "5 12 1 1,6,100,pop_vlan,4,7,push_vlan(vid=0,pcp=1),3,8" \
3218 "6 none 0 2,push_vlan(vid=10,pcp=0),1,5,7,8,100" \
3219 "6 0 0 pop_vlan,2,push_vlan(vid=10,pcp=0),1,5,7,8,100" \
3220 "6 0 1 pop_vlan,2,push_vlan(vid=10,pcp=1),1,5,7,8,100" \
3221 "6 10 0 1,5,7,8,100,pop_vlan,2" \
3222 "6 10 1 1,5,7,8,100,pop_vlan,2" \
3225 "6 12 0 1,5,100,pop_vlan,3,4,7,8" \
3226 "6 12 1 1,5,100,pop_vlan,4,7,push_vlan(vid=0,pcp=1),3,8" \
3227 "7 none 0 3,4,8,push_vlan(vid=12,pcp=0),1,5,6,100" \
3228 "7 0 0 pop_vlan,3,4,8,push_vlan(vid=12,pcp=0),1,5,6,100" \
3229 "7 0 1 3,8,pop_vlan,4,push_vlan(vid=12,pcp=1),1,5,6,100" \
3230 "7 10 0 1,5,6,8,100,pop_vlan,2" \
3231 "7 10 1 1,5,6,8,100,pop_vlan,2" \
3234 "7 12 0 1,5,6,100,pop_vlan,3,4,8" \
3235 "7 12 1 1,5,6,100,pop_vlan,4,push_vlan(vid=0,pcp=1),3,8" \
3236 "8 none 0 3,4,7,push_vlan(vid=12,pcp=0),1,5,6,100" \
3237 "8 0 0 pop_vlan,3,4,7,push_vlan(vid=12,pcp=0),1,5,6,100" \
3238 "8 0 1 3,pop_vlan,4,7,push_vlan(vid=12,pcp=1),1,5,6,100" \
3239 "8 10 0 1,5,6,7,100,pop_vlan,2" \
3240 "8 10 1 1,5,6,7,100,pop_vlan,2" \
3243 "8 12 0 1,5,6,100,pop_vlan,3,4,7" \
3244 "8 12 1 1,5,6,100,pop_vlan,4,7,push_vlan(vid=0,pcp=1),3"
3252 if test $vlan = none; then
3253 flow="in_port($in_port),eth(src=50:54:00:00:00:01,dst=ff:ff:ff:ff:ff:ff),eth_type(0xabcd)"
3255 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))"
3258 echo "----------------------------------------------------------------------"
3259 echo "in_port=$in_port vlan=$vlan pcp=$pcp"
3261 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
3262 actual=`tail -1 stdout | sed 's/Datapath actions: //'`
3264 AT_CHECK([ovs-dpctl normalize-actions "$flow" "$expected"], [0], [stdout])
3266 AT_CHECK([ovs-dpctl normalize-actions "$flow" "$actual"], [0], [expout])
3272 AT_SETUP([ofproto-dpif - MPLS handling])
3273 OVS_VSWITCHD_START([dnl
3274 add-port br0 p1 -- set Interface p1 type=dummy
3276 on_exit 'kill `cat ovs-ofctl.pid`'
3278 AT_CAPTURE_FILE([ofctl_monitor.log])
3279 AT_DATA([flows.txt], [dnl
3280 dl_src=40:44:44:44:00:00 actions=push_mpls:0x8847,controller
3281 dl_src=40:44:44:44:00:01,mpls actions=push_mpls:0x8847,controller
3282 dl_src=40:44:44:44:00:02,mpls actions=push_mpls:0x8848,controller
3284 AT_CHECK([ovs-ofctl --protocols=OpenFlow12 add-flows br0 flows.txt])
3286 dnl In this test, we push an MPLS tag to an ethernet packet.
3287 AT_CHECK([ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P standard --detach --pidfile 2> ofctl_monitor.log])
3290 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)'
3292 OVS_WAIT_UNTIL([test `grep OFPT_PACKET_IN ofctl_monitor.log | wc -l` -ge 3])
3293 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
3295 AT_CHECK([ofctl_strip < ofctl_monitor.log], [0], [dnl
3296 OFPT_PACKET_IN (OF1.2): total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
3297 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
3298 00000000 50 54 00 00 00 07 40 44-44 44 00 00 88 47 00 00
3299 00000010 01 40 45 00 00 28 00 00-00 00 40 06 f9 7c c0 a8
3300 00000020 00 01 c0 a8 00 02 00 00-00 00 00 00 00 00 00 00
3301 00000030 00 00 50 00 00 00 2e 91-00 00
3303 OFPT_PACKET_IN (OF1.2): total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
3304 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
3305 00000000 50 54 00 00 00 07 40 44-44 44 00 00 88 47 00 00
3306 00000010 01 40 45 00 00 28 00 00-00 00 40 06 f9 7c c0 a8
3307 00000020 00 01 c0 a8 00 02 00 00-00 00 00 00 00 00 00 00
3308 00000030 00 00 50 00 00 00 2e 91-00 00
3310 OFPT_PACKET_IN (OF1.2): total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
3311 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
3312 00000000 50 54 00 00 00 07 40 44-44 44 00 00 88 47 00 00
3313 00000010 01 40 45 00 00 28 00 00-00 00 40 06 f9 7c c0 a8
3314 00000020 00 01 c0 a8 00 02 00 00-00 00 00 00 00 00 00 00
3315 00000030 00 00 50 00 00 00 2e 91-00 00
3318 dnl In this test, we push an MPLS tag to an MPLS packet. The LSE should be
3319 dnl copied exactly, except for the BOS bit.
3320 AT_CHECK([ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P standard --detach --pidfile 2> ofctl_monitor.log])
3323 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)'
3325 OVS_WAIT_UNTIL([test `grep OFPT_PACKET_IN ofctl_monitor.log | wc -l` -ge 3])
3326 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
3328 AT_CHECK([ofctl_strip < ofctl_monitor.log], [0], [dnl
3329 OFPT_PACKET_IN (OF1.2): total_len=22 in_port=1 (via action) data_len=22 (unbuffered)
3330 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
3331 00000000 50 54 00 00 00 07 40 44-44 44 00 01 88 47 00 00
3332 00000010 a0 40 00 00 a1 40
3334 OFPT_PACKET_IN (OF1.2): total_len=22 in_port=1 (via action) data_len=22 (unbuffered)
3335 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
3336 00000000 50 54 00 00 00 07 40 44-44 44 00 01 88 47 00 00
3337 00000010 a0 40 00 00 a1 40
3339 OFPT_PACKET_IN (OF1.2): total_len=22 in_port=1 (via action) data_len=22 (unbuffered)
3340 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
3341 00000000 50 54 00 00 00 07 40 44-44 44 00 01 88 47 00 00
3342 00000010 a0 40 00 00 a1 40
3345 dnl In this test, we push an MPLS tag to an MPLS packet. The LSE should be
3346 dnl copied exactly, except for the BOS bit. The ethertype should be updated
3347 dnl to the MPLS ethertype of the MPLS push action which differs to that
3348 dnl of the input packet.
3349 AT_CHECK([ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P standard --detach --pidfile 2> ofctl_monitor.log])
3352 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)'
3354 OVS_WAIT_UNTIL([test `grep OFPT_PACKET_IN ofctl_monitor.log | wc -l` -ge 3])
3355 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
3357 AT_CHECK([ofctl_strip < ofctl_monitor.log], [0], [dnl
3358 OFPT_PACKET_IN (OF1.2): total_len=22 in_port=1 (via action) data_len=22 (unbuffered)
3359 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
3360 00000000 50 54 00 00 00 07 40 44-44 44 00 02 88 48 00 00
3361 00000010 a0 40 00 00 a1 40
3363 OFPT_PACKET_IN (OF1.2): total_len=22 in_port=1 (via action) data_len=22 (unbuffered)
3364 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
3365 00000000 50 54 00 00 00 07 40 44-44 44 00 02 88 48 00 00
3366 00000010 a0 40 00 00 a1 40
3368 OFPT_PACKET_IN (OF1.2): total_len=22 in_port=1 (via action) data_len=22 (unbuffered)
3369 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
3370 00000000 50 54 00 00 00 07 40 44-44 44 00 02 88 48 00 00
3371 00000010 a0 40 00 00 a1 40
3377 AT_SETUP([ofproto-dpif - VLAN+MPLS handling])
3378 OVS_VSWITCHD_START([dnl
3379 add-port br0 p1 -- set Interface p1 type=dummy
3381 on_exit 'kill `cat ovs-ofctl.pid`'
3383 AT_CAPTURE_FILE([ofctl_monitor.log])
3384 AT_DATA([flows.txt], [dnl
3385 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
3386 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
3387 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
3388 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
3389 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
3390 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
3391 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
3392 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
3393 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
3394 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
3396 AT_CHECK([ovs-ofctl --protocols=OpenFlow12 add-flows br0 flows.txt])
3398 dnl Modified MPLS controller action.
3399 dnl In this test, we push the MPLS tag before pushing a VLAN tag, so we see
3400 dnl both of these in the final flow
3401 AT_CHECK([ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P standard --detach --pidfile 2> ofctl_monitor.log])
3404 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)'
3406 OVS_WAIT_UNTIL([test `grep OFPT_PACKET_IN ofctl_monitor.log | wc -l` -ge 3])
3407 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
3409 AT_CHECK([ofctl_strip < ofctl_monitor.log], [0], [dnl
3410 OFPT_PACKET_IN (OF1.2): total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
3411 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
3412 00000000 50 54 00 00 00 07 40 44-44 44 54 50 81 00 20 63
3413 00000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
3414 00000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
3415 00000030 00 00 00 00 00 00 50 00-00 00 2e 91 00 00
3417 OFPT_PACKET_IN (OF1.2): total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
3418 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
3419 00000000 50 54 00 00 00 07 40 44-44 44 54 50 81 00 20 63
3420 00000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
3421 00000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
3422 00000030 00 00 00 00 00 00 50 00-00 00 2e 91 00 00
3424 OFPT_PACKET_IN (OF1.2): total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
3425 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
3426 00000000 50 54 00 00 00 07 40 44-44 44 54 50 81 00 20 63
3427 00000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
3428 00000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
3429 00000030 00 00 00 00 00 00 50 00-00 00 2e 91 00 00
3432 dnl Modified MPLS controller action.
3433 dnl In this test, the input packet is vlan-tagged, which should be stripped
3434 dnl before we push the MPLS and VLAN tags.
3435 AT_CHECK([ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P standard --detach --pidfile 2> ofctl_monitor.log])
3438 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))'
3440 OVS_WAIT_UNTIL([test `grep OFPT_PACKET_IN ofctl_monitor.log | wc -l` -ge 3])
3441 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
3443 AT_CHECK([ofctl_strip < ofctl_monitor.log], [0], [dnl
3444 OFPT_PACKET_IN (OF1.2): total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
3445 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
3446 00000000 50 54 00 00 00 07 40 44-44 44 54 51 81 00 20 63
3447 00000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
3448 00000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
3449 00000030 00 00 00 00 00 00 50 00-00 00 2e 91 00 00
3451 OFPT_PACKET_IN (OF1.2): total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
3452 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
3453 00000000 50 54 00 00 00 07 40 44-44 44 54 51 81 00 20 63
3454 00000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
3455 00000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
3456 00000030 00 00 00 00 00 00 50 00-00 00 2e 91 00 00
3458 OFPT_PACKET_IN (OF1.2): total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
3459 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
3460 00000000 50 54 00 00 00 07 40 44-44 44 54 51 81 00 20 63
3461 00000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
3462 00000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
3463 00000030 00 00 00 00 00 00 50 00-00 00 2e 91 00 00
3466 dnl Modified MPLS controller action.
3467 dnl In this test, we push the MPLS tag before pushing a VLAN tag, so we see
3468 dnl both of these in the final flow
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: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)'
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=62 in_port=1 (via action) data_len=62 (unbuffered)
3479 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
3480 00000000 52 54 00 00 00 07 40 44-44 44 54 52 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 2e 91 00 00
3485 OFPT_PACKET_IN (OF1.2): total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
3486 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
3487 00000000 52 54 00 00 00 07 40 44-44 44 54 52 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 2e 91 00 00
3492 OFPT_PACKET_IN (OF1.2): total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
3493 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
3494 00000000 52 54 00 00 00 07 40 44-44 44 54 52 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 2e 91 00 00
3500 dnl Modified MPLS controller action.
3501 dnl In this test, the input packet is vlan-tagged, which should be stripped
3502 dnl before we push the MPLS and VLAN tags.
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: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))'
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=62 in_port=1 (via action) data_len=62 (unbuffered)
3513 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
3514 00000000 50 54 00 00 00 07 40 44-44 44 54 53 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 2e 91 00 00
3519 OFPT_PACKET_IN (OF1.2): total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
3520 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
3521 00000000 50 54 00 00 00 07 40 44-44 44 54 53 81 00 20 63
3522 00000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
3523 00000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
3524 00000030 00 00 00 00 00 00 50 00-00 00 2e 91 00 00
3526 OFPT_PACKET_IN (OF1.2): total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
3527 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
3528 00000000 50 54 00 00 00 07 40 44-44 44 54 53 81 00 20 63
3529 00000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
3530 00000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
3531 00000030 00 00 00 00 00 00 50 00-00 00 2e 91 00 00
3534 dnl Modified MPLS controller action.
3535 dnl In this test, we push the VLAN tag before pushing a MPLS tag, but these
3536 dnl actions are reordered, so we see both of these in the final flow.
3537 AT_CHECK([ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P standard --detach --pidfile 2> ofctl_monitor.log])
3540 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)'
3542 OVS_WAIT_UNTIL([test `grep OFPT_PACKET_IN ofctl_monitor.log | wc -l` -ge 3])
3543 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
3545 AT_CHECK([ofctl_strip < ofctl_monitor.log], [0], [dnl
3546 OFPT_PACKET_IN (OF1.2): total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
3547 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
3548 00000000 50 54 00 00 00 07 40 44-44 44 54 54 81 00 20 63
3549 00000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
3550 00000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
3551 00000030 00 00 00 00 00 00 50 00-00 00 2e 91 00 00
3553 OFPT_PACKET_IN (OF1.2): total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
3554 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
3555 00000000 50 54 00 00 00 07 40 44-44 44 54 54 81 00 20 63
3556 00000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
3557 00000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
3558 00000030 00 00 00 00 00 00 50 00-00 00 2e 91 00 00
3560 OFPT_PACKET_IN (OF1.2): total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
3561 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
3562 00000000 50 54 00 00 00 07 40 44-44 44 54 54 81 00 20 63
3563 00000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
3564 00000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
3565 00000030 00 00 00 00 00 00 50 00-00 00 2e 91 00 00
3568 dnl Modified MPLS controller action.
3569 dnl In this test, the input packet is vlan-tagged, which should be stripped
3570 dnl before we push the MPLS and VLAN tags.
3571 AT_CHECK([ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P standard --detach --pidfile 2> ofctl_monitor.log])
3574 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))'
3576 OVS_WAIT_UNTIL([test `grep OFPT_PACKET_IN ofctl_monitor.log | wc -l` -ge 3])
3577 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
3579 AT_CHECK([ofctl_strip < ofctl_monitor.log], [0], [dnl
3580 OFPT_PACKET_IN (OF1.2): total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
3581 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
3582 00000000 50 54 00 00 00 07 40 44-44 44 54 55 81 00 20 63
3583 00000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
3584 00000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
3585 00000030 00 00 00 00 00 00 50 00-00 00 2e 91 00 00
3587 OFPT_PACKET_IN (OF1.2): total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
3588 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
3589 00000000 50 54 00 00 00 07 40 44-44 44 54 55 81 00 20 63
3590 00000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
3591 00000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
3592 00000030 00 00 00 00 00 00 50 00-00 00 2e 91 00 00
3594 OFPT_PACKET_IN (OF1.2): total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
3595 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
3596 00000000 50 54 00 00 00 07 40 44-44 44 54 55 81 00 20 63
3597 00000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
3598 00000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
3599 00000030 00 00 00 00 00 00 50 00-00 00 2e 91 00 00
3602 dnl Modified MPLS controller action.
3603 dnl In this test, we push the VLAN tag before pushing a MPLS tag, but these
3604 dnl actions are reordered, so we see both of these in the final flow.
3605 AT_CHECK([ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P standard --detach --pidfile 2> ofctl_monitor.log])
3608 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)'
3610 OVS_WAIT_UNTIL([test `grep OFPT_PACKET_IN ofctl_monitor.log | wc -l` -ge 3])
3611 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
3613 AT_CHECK([ofctl_strip < ofctl_monitor.log], [0], [dnl
3614 OFPT_PACKET_IN (OF1.2): total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
3615 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
3616 00000000 50 54 00 00 00 07 40 44-44 44 54 56 81 00 20 63
3617 00000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
3618 00000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
3619 00000030 00 00 00 00 00 00 50 00-00 00 2e 91 00 00
3621 OFPT_PACKET_IN (OF1.2): total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
3622 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
3623 00000000 50 54 00 00 00 07 40 44-44 44 54 56 81 00 20 63
3624 00000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
3625 00000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
3626 00000030 00 00 00 00 00 00 50 00-00 00 2e 91 00 00
3628 OFPT_PACKET_IN (OF1.2): total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
3629 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
3630 00000000 50 54 00 00 00 07 40 44-44 44 54 56 81 00 20 63
3631 00000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
3632 00000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
3633 00000030 00 00 00 00 00 00 50 00-00 00 2e 91 00 00
3636 dnl Modified MPLS controller action.
3637 dnl In this test, the input packet is vlan-tagged, which should be stripped
3638 dnl before we push the MPLS and VLAN tags.
3639 AT_CHECK([ovs-ofctl --protocols=OpenFlow12 monitor br0 -m 65534 -P standard --detach --pidfile 2> ofctl_monitor.log])
3642 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))'
3644 OVS_WAIT_UNTIL([test `grep OFPT_PACKET_IN ofctl_monitor.log | wc -l` -ge 3])
3645 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
3647 AT_CHECK([ofctl_strip < ofctl_monitor.log], [0], [dnl
3648 OFPT_PACKET_IN (OF1.2): total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
3649 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
3650 00000000 50 54 00 00 00 07 40 44-44 44 54 57 81 00 20 63
3651 00000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
3652 00000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
3653 00000030 00 00 00 00 00 00 50 00-00 00 2e 91 00 00
3655 OFPT_PACKET_IN (OF1.2): total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
3656 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
3657 00000000 50 54 00 00 00 07 40 44-44 44 54 57 81 00 20 63
3658 00000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
3659 00000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
3660 00000030 00 00 00 00 00 00 50 00-00 00 2e 91 00 00
3662 OFPT_PACKET_IN (OF1.2): total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
3663 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
3664 00000000 50 54 00 00 00 07 40 44-44 44 54 57 81 00 20 63
3665 00000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
3666 00000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
3667 00000030 00 00 00 00 00 00 50 00-00 00 2e 91 00 00
3670 dnl Modified MPLS controller action.
3671 dnl In this test, the input packet is vlan-tagged, which should be stripped
3672 dnl before we push the MPLS and VLAN tags.
3673 AT_CHECK([ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P standard --detach --pidfile 2> ofctl_monitor.log])
3676 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))'
3678 OVS_WAIT_UNTIL([test `grep OFPT_PACKET_IN ofctl_monitor.log | wc -l` -ge 3])
3679 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
3681 AT_CHECK([ofctl_strip < ofctl_monitor.log], [0], [dnl
3682 OFPT_PACKET_IN (OF1.2): total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
3683 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
3684 00000000 50 54 00 00 00 07 40 44-44 44 54 58 81 00 20 63
3685 00000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
3686 00000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
3687 00000030 00 00 00 00 00 00 50 00-00 00 2e 91 00 00
3689 OFPT_PACKET_IN (OF1.2): total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
3690 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
3691 00000000 50 54 00 00 00 07 40 44-44 44 54 58 81 00 20 63
3692 00000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
3693 00000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
3694 00000030 00 00 00 00 00 00 50 00-00 00 2e 91 00 00
3696 OFPT_PACKET_IN (OF1.2): total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
3697 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
3698 00000000 50 54 00 00 00 07 40 44-44 44 54 58 81 00 20 63
3699 00000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
3700 00000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
3701 00000030 00 00 00 00 00 00 50 00-00 00 2e 91 00 00
3704 dnl Modified MPLS controller action.
3705 dnl In this test, the input packet is vlan-tagged, which should be modified
3706 dnl before we push MPLS and VLAN tags.
3707 AT_CHECK([ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P standard --detach --pidfile 2> ofctl_monitor.log])
3710 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))'
3712 OVS_WAIT_UNTIL([test `grep OFPT_PACKET_IN ofctl_monitor.log | wc -l` -ge 3])
3713 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
3715 AT_CHECK([ofctl_strip < ofctl_monitor.log], [0], [dnl
3716 OFPT_PACKET_IN (OF1.2): total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
3717 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
3718 00000000 50 54 00 00 00 07 40 44-44 44 54 59 81 00 20 63
3719 00000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
3720 00000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
3721 00000030 00 00 00 00 00 00 50 00-00 00 2e 91 00 00
3723 OFPT_PACKET_IN (OF1.2): total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
3724 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
3725 00000000 50 54 00 00 00 07 40 44-44 44 54 59 81 00 20 63
3726 00000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
3727 00000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
3728 00000030 00 00 00 00 00 00 50 00-00 00 2e 91 00 00
3730 OFPT_PACKET_IN (OF1.2): total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
3731 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
3732 00000000 50 54 00 00 00 07 40 44-44 44 54 59 81 00 20 63
3733 00000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
3734 00000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
3735 00000030 00 00 00 00 00 00 50 00-00 00 2e 91 00 00
3738 AT_CHECK([ovs-appctl revalidator/purge], [0])
3739 AT_CHECK([ovs-ofctl --protocols=OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
3740 cookie=0xa, n_packets=3, n_bytes=162, 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
3741 cookie=0xa, n_packets=3, n_bytes=162, 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
3742 cookie=0xa, n_packets=3, n_bytes=162, 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
3743 cookie=0xa, n_packets=3, n_bytes=162, 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
3744 cookie=0xa, n_packets=3, n_bytes=174, 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
3745 cookie=0xa, n_packets=3, n_bytes=174, 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
3746 cookie=0xa, n_packets=3, n_bytes=174, 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
3747 cookie=0xa, n_packets=3, n_bytes=174, 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
3748 cookie=0xa, n_packets=3, n_bytes=174, 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
3749 cookie=0xa, n_packets=3, n_bytes=174, 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
3750 OFPST_FLOW reply (OF1.2):
3756 AT_SETUP([ofproto-dpif - fragment handling - trace])
3758 add_of_ports br0 1 2 3 4 5 6 90
3759 AT_DATA([flows.txt], [dnl
3760 priority=75 tcp ip_frag=no tp_dst=80 actions=move:OXM_OF_TCP_DST[[]]->OXM_OF_TCP_SRC[[]],output:1
3761 priority=75 tcp ip_frag=first tp_dst=80 actions=move:OXM_OF_TCP_DST[[]]->OXM_OF_TCP_SRC[[]],output:2
3762 priority=50 tcp ip_frag=no actions=move:OXM_OF_TCP_DST[[]]->OXM_OF_TCP_SRC[[]],output:4
3763 priority=50 tcp ip_frag=first actions=move:OXM_OF_TCP_DST[[]]->OXM_OF_TCP_SRC[[]],output:5
3764 priority=50 tcp ip_frag=later actions=output:6
3766 AT_CHECK([ovs-ofctl replace-flows br0 flows.txt])
3768 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"
3769 no_flow="$base_flow,frag=no),tcp(src=12345,dst=80)"
3770 first_flow="$base_flow,frag=first),tcp(src=12345,dst=80)"
3771 later_flow="$base_flow,frag=later)"
3773 # mode no first later
3776 'drop 1 drop drop' \
3785 AT_CHECK([ovs-ofctl set-frags br0 $mode])
3786 for type in no first later; do
3787 eval flow=\$${type}_flow exp_output=\$$type
3788 printf "\n%s\n" "----$mode $type-----"
3789 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
3791 if test $mode = drop && test $type != no; then
3792 echo 'Packets dropped because they are IP fragments and the fragment handling mode is "drop".' >> expout
3793 echo "Datapath actions: $exp_output" >> expout
3794 elif test $type = later; then
3795 echo "Datapath actions: $exp_output" >> expout
3797 echo "Datapath actions: set(tcp(src=80,dst=80)),$exp_output" >> expout
3799 AT_CHECK([grep 'IP fragments' stdout; tail -1 stdout], [0], [expout])
3805 AT_SETUP([ofproto-dpif - fragment handling - upcall])
3807 add_of_ports br0 1 2 3 4 5 6 90
3808 AT_DATA([flows.txt], [dnl
3809 priority=75 tcp ip_frag=no tp_dst=80 actions=set_field:81->tcp_dst,output:1
3810 priority=75 tcp ip_frag=first tp_dst=80 actions=set_field:81->tcp_dst,output:2
3811 priority=50 tcp ip_frag=no actions=set_field:81->tcp_dst,output:4
3812 priority=50 tcp ip_frag=first actions=set_field:81->tcp_dst,output:5
3813 priority=50 tcp ip_frag=later actions=output:6
3815 AT_CHECK([ovs-ofctl replace-flows br0 flows.txt])
3817 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"
3818 no_flow="$base_flow,frag=no),tcp(src=12345,dst=80)"
3819 first_flow="$base_flow,frag=first),tcp(src=12345,dst=80)"
3820 later_flow="$base_flow,frag=later)"
3822 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
3826 AT_CHECK([ovs-ofctl set-frags br0 $mode])
3827 for type in no first later; do
3828 eval flow=\$${type}_flow
3829 printf "\n%s\n" "----$mode $type-----"
3831 AT_CHECK([ovs-appctl netdev-dummy/receive p90 "$flow"], [0], [stdout])
3834 AT_CHECK([ovs-appctl dpctl/dump-flows], [0], [dnl
3835 flow-dump from non-dpdk interfaces:
3836 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
3837 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
3838 recirc_id(0),in_port(90),eth_type(0x0800),ipv4(proto=6,frag=later), packets:0, bytes:0, used:never, actions:6
3843 AT_CHECK([ovs-appctl revalidator/purge], [0])
3844 AT_CHECK([ovs-ofctl set-frags br0 $mode])
3845 for type in no first later; do
3846 eval flow=\$${type}_flow
3847 printf "\n%s\n" "----$mode $type-----"
3849 AT_CHECK([ovs-appctl netdev-dummy/receive p90 "$flow"], [0], [stdout])
3852 AT_CHECK([ovs-appctl dpctl/dump-flows], [0], [dnl
3853 flow-dump from non-dpdk interfaces:
3854 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
3855 recirc_id(0),in_port(90),eth_type(0x0800),ipv4(frag=first), packets:0, bytes:0, used:never, actions:drop
3856 recirc_id(0),in_port(90),eth_type(0x0800),ipv4(frag=later), packets:0, bytes:0, used:never, actions:drop
3861 AT_CHECK([ovs-appctl revalidator/purge], [0])
3862 AT_CHECK([ovs-ofctl set-frags br0 $mode])
3863 for type in no first later; do
3864 eval flow=\$${type}_flow
3865 printf "\n%s\n" "----$mode $type-----"
3867 AT_CHECK([ovs-appctl netdev-dummy/receive p90 "$flow"], [0], [stdout])
3870 AT_CHECK([ovs-appctl dpctl/dump-flows], [0], [dnl
3871 flow-dump from non-dpdk interfaces:
3872 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
3873 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
3874 recirc_id(0),in_port(90),eth_type(0x0800),ipv4(proto=6,frag=later), packets:0, bytes:0, used:never, actions:6
3880 AT_SETUP([ofproto-dpif - fragment handling - actions])
3882 add_of_ports br0 1 2 3 4 5 6 90
3884 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])
3885 AT_CHECK([tail -2 stderr | sed 's/^.*|WARN|//'], [0], [dnl
3886 source field tcp_dst lacks correct prerequisites
3887 ovs-ofctl: actions are invalid with specified match (OFPBAC_MATCH_INCONSISTENT)
3890 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])
3891 AT_CHECK([tail -2 stderr | sed 's/^.*|WARN|//'], [0], [dnl
3892 destination field tcp_src lacks correct prerequisites
3893 ovs-ofctl: actions are invalid with specified match (OFPBAC_MATCH_INCONSISTENT)
3896 AT_CHECK([ovs-ofctl add-flow br0 "udp,ip_frag=later actions=set_field:8888->udp_src,output:1"], [1], [], [stderr])
3897 AT_CHECK([tail -2 stderr | sed 's/^.*|WARN|//'], [0], [dnl
3898 set_field udp_src lacks correct prerequisities
3899 ovs-ofctl: actions are invalid with specified match (OFPBAC_MATCH_INCONSISTENT)
3902 AT_CHECK([ovs-ofctl add-flow br0 "udp,ip_frag=later actions=load:8888->NXM_OF_UDP_DST[[]],output:1"], [1], [], [stderr])
3903 AT_CHECK([tail -2 stderr | sed 's/^.*|WARN|//'], [0], [dnl
3904 set_field udp_dst lacks correct prerequisities
3905 ovs-ofctl: actions are invalid with specified match (OFPBAC_MATCH_INCONSISTENT)
3908 AT_CHECK([ovs-ofctl add-flow br0 "sctp,ip_frag=later actions=set_field:8888->sctp_src,output:1"], [1], [], [stderr])
3909 AT_CHECK([tail -2 stderr | sed 's/^.*|WARN|//'], [0], [dnl
3910 set_field sctp_src lacks correct prerequisities
3911 ovs-ofctl: actions are invalid with specified match (OFPBAC_MATCH_INCONSISTENT)
3914 AT_CHECK([ovs-ofctl add-flow br0 "sctp,ip_frag=later actions=set_field:8888->sctp_dst,output:1"], [1], [], [stderr])
3915 AT_CHECK([tail -2 stderr | sed 's/^.*|WARN|//'], [0], [dnl
3916 set_field sctp_dst lacks correct prerequisities
3917 ovs-ofctl: actions are invalid with specified match (OFPBAC_MATCH_INCONSISTENT)
3920 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])
3921 AT_CHECK([tail -2 stderr | sed 's/^.*|WARN|//'], [0], [dnl
3922 source field tcp_dst lacks correct prerequisites
3923 ovs-ofctl: actions are invalid with specified match (OFPBAC_MATCH_INCONSISTENT)
3926 AT_DATA([flows.txt], [dnl
3927 priority=75 tcp actions=load:42->OXM_OF_TCP_SRC[[0..7]],output:1
3929 AT_CHECK([ovs-ofctl -O OpenFlow12 replace-flows br0 flows.txt])
3931 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
3935 AT_CHECK([ovs-ofctl set-frags br0 $mode])
3936 for frag in 4000 6000 6008 4010; do
3937 printf "\n%s\n" "----$mode $frag-----"
3939 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"])
3942 dnl The set_field action only modifies 8 bits of the tcp_src, so both the flow
3943 dnl wildcard and the set_field action have a mask of 0xFF. Up to (including)
3944 dnl OVS-2.5, the wildcards and set_field mask are shared internally.
3945 AT_CHECK([ovs-appctl dpctl/dump-flows | sed 's/used:[[0-9]].[[0-9]]*s/used:0.001s/'], [0], [dnl
3946 flow-dump from non-dpdk interfaces:
3947 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
3948 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
3949 recirc_id(0),in_port(90),eth_type(0x0800),ipv4(proto=6,frag=later), packets:1, bytes:74, used:0.001s, actions:1
3952 AT_CHECK([ovs-appctl revalidator/purge], [0])
3953 AT_CHECK([ovs-ofctl set-frags br0 $mode])
3954 for frag in 4000 6000 6008 4010; do
3955 printf "\n%s\n" "----$mode $frag truncated transport header -----"
3957 AT_CHECK([ovs-appctl netdev-dummy/receive p90 "0021853763af 0026b98cb0f9 0800 4500 0018 2e24 $frag 40 06 465d ac11370d ac11370b 828b 0016"])
3960 AT_CHECK([ovs-appctl dpctl/dump-flows | sed 's/used:[[0-9]].[[0-9]]*s/used:0.001s/'], [0], [dnl
3961 flow-dump from non-dpdk interfaces:
3962 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
3963 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
3964 recirc_id(0),in_port(90),eth_type(0x0800),ipv4(proto=6,frag=later), packets:1, bytes:38, used:0.001s, actions:1
3967 AT_CHECK([ovs-appctl revalidator/purge], [0])
3968 AT_CHECK([ovs-ofctl set-frags br0 $mode])
3969 for frag in 4000 6000 6001 4002; do
3970 printf "\n%s\n" "----$mode $frag missing transport header-----"
3972 AT_CHECK([ovs-appctl netdev-dummy/receive p90 "0021853763af 0026b98cb0f9 0800 4500 0014 2e24 $frag 40 06 465d ac11370d ac11370b"])
3975 AT_CHECK([ovs-appctl dpctl/dump-flows | sed 's/used:[[0-9]].[[0-9]]*s/used:0.001s/'], [0], [dnl
3976 flow-dump from non-dpdk interfaces:
3977 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
3978 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
3979 recirc_id(0),in_port(90),eth_type(0x0800),ipv4(proto=6,frag=later), packets:1, bytes:34, used:0.001s, actions:1
3985 AT_SETUP([ofproto-dpif - exit])
3987 add_of_ports br0 1 2 3 10 11 12 13 14
3988 AT_DATA([flows.txt], [dnl
3989 in_port=1 actions=output:10,exit,output:11
3990 in_port=2 actions=output:12,resubmit:1,output:12
3991 in_port=3 actions=output:13,resubmit:2,output:14
3993 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
3994 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])
3995 AT_CHECK([tail -1 stdout], [0],
3996 [Datapath actions: 10
3998 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])
3999 AT_CHECK([tail -1 stdout], [0],
4000 [Datapath actions: 12,10
4002 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])
4003 AT_CHECK([tail -1 stdout], [0],
4004 [Datapath actions: 13,12,10
4010 AT_SETUP([ofproto-dpif - mirroring, select_all])
4011 AT_KEYWORDS([mirror mirrors mirroring])
4013 add_of_ports br0 1 2 3
4015 set Bridge br0 mirrors=@m --\
4016 --id=@p3 get Port p3 --\
4017 --id=@m create Mirror name=mymirror select_all=true output_port=@p3
4019 AT_DATA([flows.txt], [dnl
4020 in_port=1 actions=output:2
4021 in_port=2 actions=output:1
4023 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
4025 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)"
4026 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
4027 AT_CHECK_UNQUOTED([tail -1 stdout], [0],
4028 [Datapath actions: 3,2
4031 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)"
4032 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
4033 AT_CHECK_UNQUOTED([tail -1 stdout], [0],
4034 [Datapath actions: 3,1
4041 AT_SETUP([ofproto-dpif - mirroring, select_src])
4042 AT_KEYWORDS([mirror mirrors mirroring])
4044 add_of_ports br0 1 2 3
4046 set Bridge br0 mirrors=@m --\
4047 --id=@p1 get Port p1 -- --id=@p3 get Port p3 --\
4048 --id=@m create Mirror name=mymirror select_src_port=@p1 output_port=@p3
4050 AT_DATA([flows.txt], [dnl
4051 in_port=1 actions=output:2
4052 in_port=2 actions=output:1
4054 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
4056 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)"
4057 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
4058 AT_CHECK_UNQUOTED([tail -1 stdout], [0],
4059 [Datapath actions: 3,2
4062 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)"
4063 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
4064 AT_CHECK_UNQUOTED([tail -1 stdout], [0],
4065 [Datapath actions: 1
4070 AT_SETUP([ofproto-dpif - mirroring, OFPP_NONE ingress port])
4071 AT_KEYWORDS([mirror mirrors mirroring])
4073 add_of_ports br0 1 2
4075 set Bridge br0 mirrors=@m --\
4076 --id=@p2 get Port p2 --\
4077 --id=@m create Mirror name=mymirror select_all=true output_port=@p2
4079 AT_CHECK([ovs-ofctl add-flow br0 action=output:1])
4081 # "in_port" defaults to OFPP_NONE if it's not specified.
4082 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"
4083 AT_CHECK([ovs-appctl ofproto/trace br0 "$flow"], [0], [stdout])
4084 AT_CHECK_UNQUOTED([tail -1 stdout], [0],
4085 [Datapath actions: 1,2
4092 AT_SETUP([ofproto-dpif - mirroring, select_dst])
4093 AT_KEYWORDS([mirror mirrors mirroring])
4095 add_of_ports br0 1 2 3
4097 set Bridge br0 mirrors=@m --\
4098 --id=@p2 get Port p2 -- --id=@p3 get Port p3 --\
4099 --id=@m create Mirror name=mymirror select_dst_port=@p2 output_port=@p3
4101 AT_DATA([flows.txt], [dnl
4102 in_port=1 actions=output:2
4103 in_port=2 actions=output:1
4105 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
4107 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)"
4108 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
4109 AT_CHECK_UNQUOTED([tail -1 stdout], [0],
4110 [Datapath actions: 2,3
4113 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)"
4114 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
4115 AT_CHECK_UNQUOTED([tail -1 stdout], [0],
4116 [Datapath actions: 1
4123 AT_SETUP([ofproto-dpif - mirroring, select_vlan])
4124 AT_KEYWORDS([mirror mirrors mirroring])
4126 add_of_ports br0 1 2 3
4128 set Bridge br0 mirrors=@m --\
4129 --id=@p2 get Port p2 -- --id=@p3 get Port p3 --\
4130 --id=@m create Mirror name=mymirror select_all=true select_vlan=11 output_port=@p3
4132 AT_DATA([flows.txt], [dnl
4133 in_port=1, actions=output:2
4135 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
4137 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)"
4138 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
4139 AT_CHECK_UNQUOTED([tail -1 stdout], [0],
4140 [Datapath actions: 2
4143 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))"
4144 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
4145 AT_CHECK_UNQUOTED([tail -1 stdout], [0],
4146 [Datapath actions: 2
4149 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))"
4150 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
4151 AT_CHECK_UNQUOTED([tail -1 stdout], [0],
4152 [Datapath actions: 3,2
4159 AT_SETUP([ofproto-dpif - mirroring, output_port])
4160 AT_KEYWORDS([mirror mirrors mirroring])
4162 add_of_ports br0 1 2 3
4164 set Bridge br0 mirrors=@m --\
4165 --id=@p3 get Port p3 --\
4166 --id=@m create Mirror name=mymirror select_all=true output_port=@p3
4168 AT_DATA([flows.txt], [dnl
4169 in_port=1 actions=mod_vlan_vid:17,output:2
4170 in_port=2 actions=output:1
4172 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
4174 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)"
4175 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
4176 AT_CHECK_UNQUOTED([tail -1 stdout], [0],
4177 [Datapath actions: 3,push_vlan(vid=17,pcp=0),2
4180 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)"
4181 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
4182 AT_CHECK_UNQUOTED([tail -1 stdout], [0],
4183 [Datapath actions: 3,1
4189 AT_SETUP([ofproto-dpif - mirroring, output_vlan])
4190 AT_KEYWORDS([mirror mirrors mirroring])
4192 add_of_ports br0 1 2
4194 set Bridge br0 mirrors=@m --\
4195 --id=@m create Mirror name=mymirror select_all=true output_vlan=12
4197 AT_DATA([flows.txt], [dnl
4198 in_port=1 actions=output:2
4199 in_port=2 actions=mod_vlan_vid:17,output:1
4201 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
4203 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)"
4204 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
4205 actual=`tail -1 stdout | sed 's/Datapath actions: //'`
4207 expected="2,push_vlan(vid=12,pcp=0),1,2,100"
4208 AT_CHECK([ovs-dpctl normalize-actions "$flow" "$expected"], [0], [stdout])
4210 AT_CHECK([ovs-dpctl normalize-actions "$flow" "$actual"], [0], [expout])
4212 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)"
4213 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
4214 actual=`tail -1 stdout | sed 's/Datapath actions: //'`
4216 expected="push_vlan(vid=17,pcp=0),1,pop_vlan,push_vlan(vid=12,pcp=0),1,2,100"
4217 AT_CHECK([ovs-dpctl normalize-actions "$flow" "$expected"], [0], [stdout])
4219 AT_CHECK([ovs-dpctl normalize-actions "$flow" "$actual"], [0], [expout])
4224 # This verifies that we don't get duplicate mirroring when mirror_packet()
4225 # might be invoked recursively, as a check against regression.
4226 AT_SETUP([ofproto-dpif - multiple VLAN output mirrors])
4227 AT_KEYWORDS([mirror mirrors mirroring])
4229 add_of_ports br0 1 2 3
4231 -- set Bridge br0 fail-mode=standalone mirrors=@m1,@m2 \
4232 -- --id=@m1 create Mirror name=m1 select_all=true output_vlan=500 \
4233 -- --id=@m2 create Mirror name=m2 select_all=true output_vlan=501 \
4234 -- set Port br0 tag=0 \
4235 -- set Port p1 tag=0 \
4236 -- set Port p2 tag=500 \
4237 -- set Port p3 tag=501
4240 AT_CHECK([ovs-appctl ofproto/trace br0 "$flow"], [0], [stdout])
4241 AT_CHECK([tail -1 stdout | sed 's/Datapath actions: //
4243 /g' | sort], [0], [100
4251 # This test verifies that mirror state is preserved across recirculation.
4253 # Otherwise, post-recirculation the ingress and the output to port 4
4254 # would cause the packet to be mirrored to port 3 a second time.
4255 AT_SETUP([ofproto-dpif - mirroring with recirculation])
4256 AT_KEYWORDS([mirror mirrors mirroring])
4258 add_of_ports br0 1 2 3 4
4260 set Bridge br0 mirrors=@m --\
4261 --id=@p3 get Port p3 --\
4262 --id=@m create Mirror name=mymirror select_all=true output_port=@p3
4264 AT_DATA([flows.txt], [dnl
4265 in_port=1 actions=2,debug_recirc,4
4267 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
4269 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)"
4270 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow" -generate], [0], [stdout])
4271 AT_CHECK_UNQUOTED([tail -1 stdout], [0], [Datapath actions: 3,2,recirc(0x1)
4273 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow,recirc_id(1)" -generate], [0], [stdout])
4274 AT_CHECK_UNQUOTED([tail -1 stdout], [0], [Datapath actions: 4
4280 # Tests below verify the snaplen support for mirroring
4281 AT_SETUP([ofproto-dpif - mirroring, select_all with snaplen])
4282 AT_KEYWORDS([mirror mirrors mirroring])
4284 add_of_ports br0 1 2 3
4286 set Bridge br0 mirrors=@m --\
4287 --id=@p3 get Port p3 --\
4288 --id=@m create Mirror name=mymirror select_all=true output_port=@p3 snaplen=100
4290 AT_DATA([flows.txt], [dnl
4291 in_port=1 actions=output:2
4292 in_port=2 actions=output:1
4294 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
4296 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)"
4297 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
4298 AT_CHECK_UNQUOTED([tail -1 stdout], [0],
4299 [Datapath actions: trunc(100),3,2
4302 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)"
4303 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
4304 AT_CHECK_UNQUOTED([tail -1 stdout], [0],
4305 [Datapath actions: trunc(100),3,1
4311 AT_SETUP([ofproto-dpif - mirroring, select_src with snaplen])
4312 AT_KEYWORDS([mirror mirrors mirroring])
4314 add_of_ports br0 1 2 3
4316 set Bridge br0 mirrors=@m --\
4317 --id=@p1 get Port p1 -- --id=@p3 get Port p3 --\
4318 --id=@m create Mirror name=mymirror select_src_port=@p1 output_port=@p3 snaplen=100
4320 AT_DATA([flows.txt], [dnl
4321 in_port=1 actions=output:2
4322 in_port=2 actions=output:1
4324 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
4326 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)"
4327 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
4328 AT_CHECK_UNQUOTED([tail -1 stdout], [0],
4329 [Datapath actions: trunc(100),3,2
4332 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)"
4333 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
4334 AT_CHECK_UNQUOTED([tail -1 stdout], [0],
4335 [Datapath actions: 1
4340 AT_SETUP([ofproto-dpif - mirroring, OFPP_NONE ingress port with snaplen])
4341 AT_KEYWORDS([mirror mirrors mirroring])
4343 add_of_ports br0 1 2
4345 set Bridge br0 mirrors=@m --\
4346 --id=@p2 get Port p2 --\
4347 --id=@m create Mirror name=mymirror select_all=true output_port=@p2 snaplen=100
4349 AT_CHECK([ovs-ofctl add-flow br0 action=output:1])
4351 # "in_port" defaults to OFPP_NONE if it's not specified.
4352 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"
4353 AT_CHECK([ovs-appctl ofproto/trace br0 "$flow"], [0], [stdout])
4354 AT_CHECK_UNQUOTED([tail -1 stdout], [0],
4355 [Datapath actions: 1,trunc(100),2
4361 AT_SETUP([ofproto-dpif - mirroring, select_dst with snaplen])
4362 AT_KEYWORDS([mirror mirrors mirroring])
4364 add_of_ports br0 1 2 3
4366 set Bridge br0 mirrors=@m --\
4367 --id=@p2 get Port p2 -- --id=@p3 get Port p3 --\
4368 --id=@m create Mirror name=mymirror select_dst_port=@p2 output_port=@p3 snaplen=100
4370 AT_DATA([flows.txt], [dnl
4371 in_port=1 actions=output:2
4372 in_port=2 actions=output:1
4374 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
4376 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)"
4377 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
4378 AT_CHECK_UNQUOTED([tail -1 stdout], [0],
4379 [Datapath actions: 2,trunc(100),3
4382 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)"
4383 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
4384 AT_CHECK_UNQUOTED([tail -1 stdout], [0],
4385 [Datapath actions: 1
4391 AT_SETUP([ofproto-dpif - mirroring, select_vlan with snaplen])
4392 AT_KEYWORDS([mirror mirrors mirroring])
4394 add_of_ports br0 1 2 3
4396 set Bridge br0 mirrors=@m --\
4397 --id=@p2 get Port p2 -- --id=@p3 get Port p3 --\
4398 --id=@m create Mirror name=mymirror select_all=true select_vlan=11 output_port=@p3 snaplen=100
4400 AT_DATA([flows.txt], [dnl
4401 in_port=1, actions=output:2
4403 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
4405 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)"
4406 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
4407 AT_CHECK_UNQUOTED([tail -1 stdout], [0],
4408 [Datapath actions: 2
4411 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))"
4412 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
4413 AT_CHECK_UNQUOTED([tail -1 stdout], [0],
4414 [Datapath actions: 2
4417 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))"
4418 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
4419 AT_CHECK_UNQUOTED([tail -1 stdout], [0],
4420 [Datapath actions: trunc(100),3,2
4426 AT_SETUP([ofproto-dpif - mirroring, output_port with snaplen])
4427 AT_KEYWORDS([mirror mirrors mirroring])
4429 add_of_ports br0 1 2 3
4431 set Bridge br0 mirrors=@m --\
4432 --id=@p3 get Port p3 --\
4433 --id=@m create Mirror name=mymirror select_all=true output_port=@p3 snaplen=100
4435 AT_DATA([flows.txt], [dnl
4436 in_port=1 actions=mod_vlan_vid:17,output:2
4437 in_port=2 actions=output:1
4439 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
4441 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)"
4442 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
4443 AT_CHECK_UNQUOTED([tail -1 stdout], [0],
4444 [Datapath actions: trunc(100),3,push_vlan(vid=17,pcp=0),2
4447 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)"
4448 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
4449 AT_CHECK_UNQUOTED([tail -1 stdout], [0],
4450 [Datapath actions: trunc(100),3,1
4456 AT_SETUP([ofproto-dpif - mirroring, output_vlan with snaplen])
4457 AT_KEYWORDS([mirror mirrors mirroring])
4459 add_of_ports br0 1 2
4461 set Bridge br0 mirrors=@m --\
4462 --id=@m create Mirror name=mymirror select_all=true output_vlan=12 snaplen=100
4464 AT_DATA([flows.txt], [dnl
4465 in_port=1 actions=output:2
4466 in_port=2 actions=mod_vlan_vid:17,output:1
4468 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
4470 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)"
4471 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
4472 actual=`tail -1 stdout | sed 's/Datapath actions: //'`
4473 dnl Expect: "trunc(100),100,trunc(100),2,trunc(100),1", with different order
4474 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])
4476 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)"
4477 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
4478 actual=`tail -1 stdout | sed 's/Datapath actions: //'`
4479 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])
4484 AT_SETUP([ofproto-dpif - multiple VLAN output mirrors with snaplen])
4485 AT_KEYWORDS([mirror mirrors mirroring])
4487 add_of_ports br0 1 2 3
4489 -- set Bridge br0 fail-mode=standalone mirrors=@m1,@m2 \
4490 -- --id=@m1 create Mirror name=m1 select_all=true output_vlan=500 snaplen=200 \
4491 -- --id=@m2 create Mirror name=m2 select_all=true output_vlan=501 snaplen=300 \
4492 -- set Port br0 tag=0 \
4493 -- set Port p1 tag=0 \
4494 -- set Port p2 tag=500 \
4495 -- set Port p3 tag=501
4498 AT_CHECK([ovs-appctl ofproto/trace br0 "$flow"], [0], [stdout])
4499 AT_CHECK([tail -1 stdout | egrep "trunc\(200\),2,trunc\(300\),3,100|trunc\(300\),3,trunc\(200\),2,100"], [0], [stdout])
4504 # This test verifies that the table ID is preserved across recirculation
4505 # when a resubmit action requires it (because the action is relative to
4506 # the current table rather than specifying a table).
4507 AT_SETUP([ofproto-dpif - resubmit with recirculation])
4509 add_of_ports br0 1 2 3
4511 AT_DATA([flows.txt], [dnl
4512 table=0 in_port=1 actions=2,resubmit(,1)
4513 table=1 in_port=1 actions=debug_recirc,resubmit:55
4514 table=1 in_port=55 actions=3
4516 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
4518 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)"
4519 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow" -generate], [0], [stdout])
4520 AT_CHECK_UNQUOTED([tail -1 stdout], [0], [Datapath actions: 2,recirc(0x1)
4522 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow,recirc_id(1)" -generate], [0], [stdout])
4523 AT_CHECK_UNQUOTED([tail -1 stdout], [0], [Datapath actions: 3
4529 # This test verifies that "resubmit", when it triggers recirculation
4530 # indirectly through the flow that it recursively invokes, is not
4531 # re-executed when execution continues later post-recirculation.
4532 AT_SETUP([ofproto-dpif - recirculation after resubmit])
4534 add_of_ports br0 1 2
4536 AT_DATA([flows.txt], [dnl
4537 table=0 in_port=1 actions=resubmit(,1),2
4538 table=1 in_port=1 actions=debug_recirc
4540 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
4542 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)"
4543 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow" -generate], [0], [stdout])
4544 AT_CHECK_UNQUOTED([tail -1 stdout], [0], [Datapath actions: recirc(0x1)
4546 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow,recirc_id(1)" -generate], [0], [stdout])
4547 AT_CHECK_UNQUOTED([tail -1 stdout], [0], [Datapath actions: 2
4553 dnl CHECK_CONTINUATION(TITLE, N_PORTS0, N_PORTS1, ACTIONS0, ACTIONS1, [EXTRA_SETUP])
4555 dnl Checks the implementation of the continuation mechanism that allows the
4556 dnl packet processing pipeline to be paused and resumed. Starts by creating
4557 dnl bridge br0 with N_PORTS0 ports numbered 1 through N_PORTS0, and adds the
4558 dnl flows listed in ACTIONS0 to that bridge. Then, injects a packet at port 1
4559 dnl in the bridge, resuming each time the pipeline pauses, and expects a single
4560 dnl packet to be output at each port 2 through N_PORTS0. Then, as long as
4561 dnl ACTIONS0 still contains at least one "pause" action, removes one of them
4562 dnl and repeats the process.
4564 dnl If N_PORTS1 is nonzero, also creates a bridge br1 and adds ports numbered
4565 dnl N_PORTS0 + 1 to N_PORTS0 + N_PORTS1 to it, as well as flows ACTIONS1.
4566 dnl ACTIONS1 may also contain "pause" actions. Packets are only ever injected
4567 dnl into port 1 on br0, so br1 only comes into action if a patch port (added
4568 dnl by EXTRA_SETUP) jumps from one bridge to another.
4570 dnl EXTRA_SETUP is an optional list of extra commands to run after setting up
4571 dnl both bridges, e.g. to configure mirrors or patch ports.
4572 m4_define([CHECK_CONTINUATION], [dnl
4573 AT_SETUP([ofproto-dpif - continuation - $1])
4574 AT_KEYWORDS([continuations pause resume])
4577 # count_matches STRING
4579 # Prints on stdout the number of occurrences of STRING in stdin.
4586 add_of_ports --pcap br0 `seq 1 $2`
4587 m4_if([$3], [0], [],
4589 add_of_ports --pcap br1 `seq m4_eval([$2 + 1]) m4_eval([$2 + $3])`])
4591 AT_CAPTURE_FILE([ofctl_monitor0.log])
4592 AT_CHECK([ovs-ofctl monitor br0 resume --detach --no-chdir --pidfile=ovs-ofctl0.pid 2> ofctl_monitor0.log])
4593 m4_if([$3], [0], [],
4594 [AT_CAPTURE_FILE([ofctl_monitor1.log])
4595 AT_CHECK([ovs-ofctl monitor br1 resume --detach --no-chdir --pidfile=ovs-ofctl1.pid 2> ofctl_monitor1.log])])
4600 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)"
4604 printf "\n\nactions for br0:\n%s\n" "$actions0"
4605 m4_if([$3], [0], [], [printf "actions for br1:\n%s\n" "$actions1"])
4608 AT_CHECK([echo "$actions0" | sed 's/pause/controller(pause)/g' | ovs-ofctl -O OpenFlow13 add-flows br0 -])
4609 m4_if([$3], [0], [],
4610 [AT_CHECK([echo "$actions1" | sed 's/pause/controller(pause)/g' | ovs-ofctl -O OpenFlow13 add-flows br1 -])])
4612 # Make sure the datapath is up-to-date before sending the packet.
4613 ovs-appctl revalidator/wait
4615 # Run a packet through the switch.
4616 AT_CHECK([ovs-appctl netdev-dummy/receive p1 "$flow"], [0], [stdout])
4618 # Wait for the expected number of packets to show up.
4619 n_packets=`expr $n_packets + $2 - 1 + $3`
4620 echo "waiting for $n_packets packets..."
4621 OVS_WAIT_UNTIL([test $n_packets = `ovs-ofctl parse-pcap p*-tx.pcap | wc -l`])
4623 # Wait for the expected number of NXT_RESUMEs to be logged.
4624 n_resumes=$(expr $n_resumes + $(echo "$actions0 $actions1" | count_matches pause) )
4625 echo "waiting for $n_resumes NXT_RESUMEs..."
4626 OVS_WAIT_UNTIL([test $n_resumes = `cat ofctl_monitor*.log | grep -c NXT_RESUME`])
4628 # Eliminate one "pause" from the actions.
4630 # If there were none left, then we're done.
4631 next_actions0=`echo "$actions0" | sed '1,/pause/s/pause//'`
4632 if test X"$actions0" = X"$next_actions0"; then
4633 next_actions1=`echo "$actions1" | sed '1,/pause/s/pause//'`
4634 if test X"$actions1" = X"$next_actions1"; then
4637 actions1=$next_actions1
4640 actions0=$next_actions0
4643 # Delete all the flows and verify that there are none, so that we
4644 # can be sure that our updated flow tables is actually in use
4646 AT_CHECK([ovs-ofctl del-flows br0 && ovs-ofctl dump-flows br0 | strip_xids], [0],
4649 m4_if([$3], [0], [],
4650 [AT_CHECK([ovs-ofctl del-flows br1 && ovs-ofctl dump-flows br1 | strip_xids], [0],
4658 # Check that pause at the end of the pipeline works OK.
4660 # (xlate_continuation() has a special case for no-op actions; this
4661 # fails without that special case.)
4662 CHECK_CONTINUATION([pause at end of pipeline], [2], [0], [actions=2 pause])
4664 # Check that remaining actions are preserved following resume.
4665 CHECK_CONTINUATION([actions], [7], [0],
4666 [in_port=1 actions=pause 2 pause 3 pause 4 pause 5 pause 6 pause 7])
4668 # Check that multiple levels of resubmit continue following resume.
4670 # The "resubmit:55", which is relative to the current table, is
4671 # particularly interesting because it checks that the notion of the
4672 # current table is correctly preserved.
4673 CHECK_CONTINUATION([resubmit], [10], [0],
4674 [table=0 in_port=1 actions=pause 2 pause resubmit(,1) pause 10 pause
4675 table=1 in_port=1 actions=pause 3 pause resubmit(,2) pause 9 pause
4676 table=2 in_port=1 actions=pause 4 pause resubmit(,3) pause 8 pause
4677 table=3 in_port=1 actions=pause 5 pause resubmit:55 pause 7 pause
4678 table=3 in_port=55 actions=pause 6 pause])
4680 # Check that the action set is preserved across pause/resume.
4681 CHECK_CONTINUATION([action set], [3], [0],
4682 [in_port=1 actions=1 pause resubmit(,1) pause 2
4683 table=1 actions=write_actions(3)])
4685 # Check that metadata and the stack used by push and pop is preserved
4686 # across pause/resume.
4687 CHECK_CONTINUATION([data stack], [3], [0],
4688 [in_port=1 actions=pause dnl
4689 set_field:1->reg0 dnl
4691 set_field:2->reg1 dnl
4693 output:NXM_NX_REG0[[]] dnl
4695 push:NXM_NX_REG1[[]] dnl
4697 pop:NXM_NX_REG2[[]] dnl
4699 output:NXM_NX_REG2[[]] dnl
4703 # Check that mirror output occurs once and once only, even if
4704 # separated by pause/resume.
4705 CHECK_CONTINUATION([mirroring], [5], [0],
4706 [in_port=1 actions=pause 2 pause 3 pause 4 pause], [],
4708 set Bridge br0 mirrors=@m --\
4709 --id=@p2 get Port p2 --\
4710 --id=@p3 get Port p3 --\
4711 --id=@p4 get Port p4 --\
4712 --id=@p5 get Port p5 --\
4713 --id=@m create Mirror name=mymirror select_dst_port=@p2,@p3,@p4 output_port=@p5])
4715 # Check that pause works in the presence of patch ports.
4716 CHECK_CONTINUATION([patch ports], [4], [1],
4717 [table=0 in_port=1 actions=pause 2 resubmit(,1) pause 4
4718 table=1 in_port=1 actions=pause 3 pause 10 pause],
4719 [table=0 in_port=11 actions=pause 5 pause],
4721 -- add-port br0 patch10 \
4722 -- set interface patch10 type=patch options:peer=patch11 \
4724 -- add-port br1 patch11 \
4725 -- set interface patch11 type=patch options:peer=patch10 \
4728 # Two testcases below are for the ofproto/trace command
4729 # The first one tests all correct syntax:
4730 # ofproto/trace [dp_name] odp_flow [-generate|packet]
4731 # ofproto/trace br_name br_flow [-generate|packet]
4732 AT_SETUP([ofproto-dpif - ofproto/trace command 1])
4733 OVS_VSWITCHD_START([set bridge br0 fail-mode=standalone])
4734 add_of_ports br0 1 2 3
4736 AT_DATA([flows.txt], [dnl
4737 in_port=1 actions=output:2
4738 in_port=2 actions=output:1
4740 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
4742 odp_flow="in_port(p1)"
4744 # Test command: ofproto/trace odp_flow with in_port as a name.
4745 AT_CHECK([ovs-appctl ofproto/trace "$odp_flow"], [0], [stdout])
4746 AT_CHECK([tail -1 stdout], [0], [dnl
4750 odp_flow="in_port(1)"
4751 # Test command: ofproto/trace odp_flow
4752 AT_CHECK([ovs-appctl ofproto/trace "$odp_flow"], [0], [stdout])
4753 AT_CHECK([tail -1 stdout], [0], [dnl
4757 # Test command: ofproto/trace dp_name odp_flow
4758 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$odp_flow"], [0], [stdout])
4759 AT_CHECK([tail -1 stdout], [0], [dnl
4762 # Test commmand: ofproto/trace br_name br_flow
4763 AT_CHECK([ovs-appctl ofproto/trace br0 "$br_flow"], [0], [stdout])
4764 AT_CHECK([tail -1 stdout], [0], [dnl
4768 # Delete the inserted flows
4769 AT_CHECK([ovs-ofctl del-flows br0 "in_port=1"], [0], [stdout])
4770 AT_CHECK([ovs-ofctl del-flows br0 "in_port=2"], [0], [stdout])
4772 # This section below tests the [-generate] option
4773 odp_flow="in_port(3),eth(src=50:54:00:00:00:05,dst=ff:ff:ff:ff:ff:ff)"
4774 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"
4776 # Test command: ofproto/trace odp_flow
4777 AT_CHECK([ovs-appctl ofproto/trace "$odp_flow"], [0], [stdout])
4778 # Check for no MAC learning entry
4779 AT_CHECK_UNQUOTED([ovs-appctl fdb/show br0 | sed 's/[[0-9]]\{1,\}$/?/'], [0], [dnl
4783 # Test command: ofproto/trace br_name br_flow
4784 AT_CHECK([ovs-appctl ofproto/trace br0 "$br_flow"], [0], [stdout])
4785 # Check for no MAC learning entry
4786 AT_CHECK_UNQUOTED([ovs-appctl fdb/show br0 | sed 's/[[0-9]]\{1,\}$/?/'], [0], [dnl
4790 # Test command: ofproto/trace odp_flow -generate
4791 AT_CHECK([ovs-appctl ofproto/trace "$odp_flow" -generate], [0], [stdout])
4792 # Check for the MAC learning entry
4793 AT_CHECK_UNQUOTED([ovs-appctl fdb/show br0 | sed 's/[[0-9]]\{1,\}$/?/'], [0], [dnl
4795 3 0 50:54:00:00:00:05 ?
4798 # Test command: ofproto/trace dp_name odp_flow -generate
4799 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy \
4800 "in_port(1),eth(src=50:54:00:00:00:06,dst=50:54:00:00:00:05)" \
4801 -generate], [0], [stdout])
4802 # Check for both MAC learning entries
4803 AT_CHECK_UNQUOTED([ovs-appctl fdb/show br0 | sed 's/[[0-9]]\{1,\}$/?/'], [0], [dnl
4805 3 0 50:54:00:00:00:05 ?
4806 1 0 50:54:00:00:00:06 ?
4809 # Test command: ofproto/trace br_name br_flow -generate
4810 AT_CHECK([ovs-appctl ofproto/trace br0 \
4811 "in_port=2,dl_src=50:54:00:00:00:07,dl_dst=50:54:00:00:00:06" \
4812 -generate], [0], [stdout])
4813 # Check for both MAC learning entries.
4814 AT_CHECK_UNQUOTED([ovs-appctl fdb/show br0 | sed 's/[[0-9]]\{1,\}$/?/'], [0], [dnl
4816 3 0 50:54:00:00:00:05 ?
4817 1 0 50:54:00:00:00:06 ?
4818 2 0 50:54:00:00:00:07 ?
4821 # This section beflow tests the [packet] option
4822 # The ovs-tcpundump of packets between port1 and port2
4823 pkt1to2="50540000000250540000000108064500001C000100004001F98CC0A80001C0A800020800F7FF00000000"
4824 pkt2to1="50540000000150540000000208064500001C000100004001F98CC0A80002C0A800010800F7FF00000000"
4826 # Construct the MAC learning table
4827 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy \
4828 "in_port(1),eth(src=50:54:00:00:00:01,dst=ff:ff:ff:ff:ff:ff)" \
4829 -generate], [0], [stdout])
4831 # Construct the MAC learning table
4832 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy \
4833 "in_port(2),eth(src=50:54:00:00:00:02,dst=ff:ff:ff:ff:ff:ff)" \
4834 -generate], [0], [stdout])
4836 # Test command: ofproto/trace odp_flow packet
4837 AT_CHECK([ovs-appctl ofproto/trace \
4838 "in_port(1),skb_priority(1),skb_mark(2)" "$pkt1to2"], [0], [stdout])
4839 AT_CHECK([tail -1 stdout], [0], [dnl
4842 AT_CHECK([head -n 2 stdout], [0], [dnl
4844 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
4847 # Test command: ofproto/trace dp_name odp_flow packet
4848 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy \
4849 "in_port(1),skb_priority(1),skb_mark(2)" "$pkt1to2"], [0], [stdout])
4850 AT_CHECK([tail -1 stdout], [0], [dnl
4853 AT_CHECK([head -n 2 stdout], [0], [dnl
4855 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
4858 # Test command: ofproto/trace br_name br_flow packet
4859 AT_CHECK([ovs-appctl ofproto/trace br0 \
4860 "in_port=2,skb_priority=2,pkt_mark=1" "$pkt2to1"], [0], [stdout],[stderr])
4861 AT_CHECK([tail -1 stdout], [0], [dnl
4864 AT_CHECK([head -n 2 stdout], [0], [dnl
4866 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
4872 # The second test tests the corner cases
4873 AT_SETUP([ofproto-dpif - ofproto/trace command 2])
4875 add_of_ports br0 1 2
4878 odp_flow="in_port(1),eth(src=50:54:00:00:00:01,dst=50:54:00:00:00:02)"
4879 br_flow="in_port=1,dl_src=50:54:00:00:00:01,dl_dst=50:54:00:00:00:02"
4881 generate="-generate"
4882 pkt="50540000000250540000000108064500001C000100004001F98CC0A80001C0A800020800F7FF00000000"
4884 # Test incorrect command: ofproto/trace wrong_name odp_flow [-generate|packet]
4890 [AT_CHECK([ovs-appctl ofproto/trace wrong_name "$odp_flow" option],
4892 AT_CHECK([tail -2 stderr], [0], [dnl
4893 Cannot find the datapath
4894 ovs-appctl: ovs-vswitchd: server returned an error
4897 # Test incorrect command: ofproto/trace empty_string odp_flow [-generate|packet]
4903 [AT_CHECK([ovs-appctl ofproto/trace "" "$odp_flow" option],
4905 AT_CHECK([tail -2 stderr], [0], [dnl
4906 Cannot find the datapath
4907 ovs-appctl: ovs-vswitchd: server returned an error
4910 # Test incorrect command: ofproto/trace nonexist_dp_name odp_flow [-generate|packet]
4916 [AT_CHECK([ovs-appctl ofproto/trace ovs-system "$odp_flow" option],
4918 AT_CHECK([tail -2 stderr], [0], [dnl
4919 Cannot find the datapath
4920 ovs-appctl: ovs-vswitchd: server returned an error
4923 # Test incorrect command: ofproto/trace br_name odp_flow [-generate|packet]
4929 [AT_CHECK([ovs-appctl ofproto/trace br0 "$odp_flow" option],
4931 AT_CHECK([tail -2 stderr], [0], [dnl
4932 Cannot find the datapath
4933 ovs-appctl: ovs-vswitchd: server returned an error
4936 # Test incorrect command: ofproto/trace dp_name br_flow [-generate|packet]
4942 [AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$br_flow" option],
4944 AT_CHECK([tail -2 stderr], [0], [dnl
4946 ovs-appctl: ovs-vswitchd: server returned an error
4949 # Test incorrect command: ofproto/trace br_flow [-generate|packet]
4955 [AT_CHECK([ovs-appctl ofproto/trace "$br_flow" option],
4957 AT_CHECK([tail -2 stderr], [0], [dnl
4958 Must specify bridge name
4959 ovs-appctl: ovs-vswitchd: server returned an error
4962 # Test incorrect command: ofproto/trace dp_name odp_flow garbage_option
4963 AT_CHECK([ovs-appctl ofproto/trace \
4964 ovs-dummy "$odp_flow" garbage_option],
4965 [2], [stdout],[stderr])
4966 AT_CHECK([tail -2 stderr], [0], [dnl
4967 Trailing garbage in packet data
4968 ovs-appctl: ovs-vswitchd: server returned an error
4971 # Test incorrect command: ofproto/trace with 4 arguments
4972 AT_CHECK([ovs-appctl ofproto/trace \
4973 arg1, arg2, arg3, arg4], [2], [stdout],[stderr])
4974 AT_CHECK([tail -2 stderr], [0], [dnl
4975 "ofproto/trace" command takes at most 3 arguments
4976 ovs-appctl: ovs-vswitchd: server returned an error
4979 # Test incorrect command: ofproto/trace with 0 argument
4980 AT_CHECK([ovs-appctl ofproto/trace ], [2], [stdout],[stderr])
4981 AT_CHECK([tail -2 stderr], [0], [dnl
4982 "ofproto/trace" command requires at least 1 arguments
4983 ovs-appctl: ovs-vswitchd: server returned an error
4989 # The third test checks that the output of "ovs-dpctl -m" is valid to trace.
4990 AT_SETUP([ofproto-dpif - ofproto/trace from dpctl output])
4991 OVS_VSWITCHD_START([dnl
4992 set Open_vSwitch . other_config:max-idle=10000 \
4993 -- add-port br0 p1 -- set Interface p1 type=dummy])
4995 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)'])
4996 ovs-appctl revalidator/wait
4997 AT_CHECK([ovs-appctl dpif/dump-flows -m br0 | sed 's/, packets.*$//' > dp_flows1.txt])
4999 odp_flow=`cat dp_flows1.txt`
5000 AT_CHECK([ovs-appctl ofproto/trace "$odp_flow" | sed 's/\([[Ff]]low:\).*/\1 <cleared>/'], [0], [dnl
5003 No match, packets dropped because OFPPC_NO_PACKET_IN is set on in_port.
5005 Rule: table=254 cookie=0 priority=0,reg0=0x2
5006 OpenFlow actions=drop
5008 Final flow: <cleared>
5010 Datapath actions: drop
5013 dnl Now, try again without megaflows:
5014 ovs-appctl upcall/disable-megaflows
5016 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)'])
5017 ovs-appctl revalidator/wait
5018 AT_CHECK([ovs-appctl dpif/dump-flows -m br0 | sed 's/, packets.*$//' > dp_flows2.txt])
5020 odp_flow=`cat dp_flows2.txt`
5021 AT_CHECK([ovs-appctl ofproto/trace "$odp_flow" | sed 's/\([[Ff]]low:\).*/\1 <cleared>/'], [0], [dnl
5024 No match, packets dropped because OFPPC_NO_PACKET_IN is set on in_port.
5026 Rule: table=254 cookie=0 priority=0,reg0=0x2
5027 OpenFlow actions=drop
5029 Final flow: <cleared>
5031 Datapath actions: drop
5037 AT_SETUP([ofproto-dpif - ofproto/trace-packet-out])
5039 add_of_ports br0 1 2 3
5041 AT_DATA([flows.txt], [dnl
5042 in_port=1 actions=output:2
5043 in_port=2 actions=output:1
5045 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
5047 AT_CHECK([ovs-appctl ofproto/trace-packet-out br0 in_port=1 'mod_vlan_vid:123,resubmit(,0)'], [0], [stdout])
5048 AT_CHECK([tail -1 stdout], [0], [dnl
5049 Datapath actions: push_vlan(vid=123,pcp=0),2
5056 m4_define([OFPROTO_TRACE],
5058 AT_CHECK([ovs-appctl ofproto/trace $1 "$flow" $3], [0], [stdout])
5059 actual=`tail -1 stdout | sed 's/Datapath actions: //'`
5061 AT_CHECK([ovs-dpctl normalize-actions "$flow" "$expected" $5],
5064 AT_CHECK([ovs-dpctl normalize-actions "$flow" "$actual" $5],
5067 AT_SETUP([ofproto-dpif - MAC learning])
5068 OVS_VSWITCHD_START([set bridge br0 fail-mode=standalone])
5069 add_of_ports br0 1 2 3
5071 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)'
5073 # Trace an ARP packet arriving on p3, to create a MAC learning entry.
5076 [in_port(3),eth(src=50:54:00:00:00:05,dst=ff:ff:ff:ff:ff:ff),$arp],
5080 # Check for the MAC learning entry.
5081 AT_CHECK_UNQUOTED([ovs-appctl fdb/show br0 | sed 's/[[0-9]]\{1,\}$/?/'], [0], [dnl
5083 3 0 50:54:00:00:00:05 ?
5086 # Trace a packet arrival destined for the learned MAC.
5087 # (This will also learn a MAC.)
5090 [in_port(1),eth(src=50:54:00:00:00:06,dst=50:54:00:00:00:05),$arp],
5094 # Check for both MAC learning entries.
5095 AT_CHECK_UNQUOTED([ovs-appctl fdb/show br0 | sed 's/[[0-9]]\{1,\}$/?/'], [0], [dnl
5097 3 0 50:54:00:00:00:05 ?
5098 1 0 50:54:00:00:00:06 ?
5101 # Trace a packet arrival that updates the first learned MAC entry.
5104 [in_port(2),eth(src=50:54:00:00:00:05,dst=ff:ff:ff:ff:ff:ff),$arp],
5108 # Check that the MAC learning entry was updated.
5109 AT_CHECK_UNQUOTED([ovs-appctl fdb/show br0 | sed 's/[[0-9]]\{1,\}$/?/'], [0], [dnl
5111 1 0 50:54:00:00:00:06 ?
5112 2 0 50:54:00:00:00:05 ?
5115 # Add another bridge.
5119 -- set bridge br1 datapath-type=dummy])
5120 add_of_ports br1 4 5
5122 # Trace some packet arrivals in br1 to create MAC learning entries there too.
5125 [in_port(4),eth(src=50:54:00:00:00:06,dst=ff:ff:ff:ff:ff:ff),$arp],
5130 [in_port(5),eth(src=50:54:00:00:00:07,dst=ff:ff:ff:ff:ff:ff),$arp],
5134 # Check that the MAC learning entries were added.
5135 AT_CHECK_UNQUOTED([ovs-appctl fdb/show br1 | sed 's/[[0-9]]\{1,\}$/?/'], [0], [dnl
5137 4 0 50:54:00:00:00:06 ?
5138 5 0 50:54:00:00:00:07 ?
5141 # Delete port p1 and see that its MAC learning entry disappeared, and
5142 # that the MAC learning entry for the same MAC was also deleted from br1.
5143 AT_CHECK([ovs-vsctl del-port p1])
5144 AT_CHECK_UNQUOTED([ovs-appctl fdb/show br0 | sed 's/[[0-9]]\{1,\}$/?/'], [0], [dnl
5146 2 0 50:54:00:00:00:05 ?
5148 AT_CHECK_UNQUOTED([ovs-appctl fdb/show br1 | sed 's/[[0-9]]\{1,\}$/?/'], [0], [dnl
5150 5 0 50:54:00:00:00:07 ?
5156 AT_SETUP([ofproto-dpif - MAC table overflow])
5158 [set bridge br0 fail-mode=standalone other-config:mac-table-size=10])
5159 add_of_ports br0 1 2 3
5161 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)'
5163 AT_CHECK([ovs-appctl time/stop])
5165 # Trace 10 ARP packets arriving on p3, to create MAC learning entries.
5166 for i in 0 1 2 3 4 5 6 7 8 9; do
5169 [in_port(3),eth(src=50:54:00:00:00:0$i,dst=ff:ff:ff:ff:ff:ff),$arp],
5172 ovs-appctl time/warp 1000
5175 # Check for the MAC learning entries.
5176 AT_CHECK_UNQUOTED([ovs-appctl fdb/show br0 | sed 's/ *[[0-9]]\{1,\}$//' | sort],
5178 3 0 50:54:00:00:00:00
5179 3 0 50:54:00:00:00:01
5180 3 0 50:54:00:00:00:02
5181 3 0 50:54:00:00:00:03
5182 3 0 50:54:00:00:00:04
5183 3 0 50:54:00:00:00:05
5184 3 0 50:54:00:00:00:06
5185 3 0 50:54:00:00:00:07
5186 3 0 50:54:00:00:00:08
5187 3 0 50:54:00:00:00:09
5191 # Trace another ARP packet on another MAC.
5194 [in_port(3),eth(src=50:54:00:00:00:10,dst=ff:ff:ff:ff:ff:ff),$arp],
5198 # Check that the new one chased the oldest one out of the table.
5199 AT_CHECK_UNQUOTED([ovs-appctl fdb/show br0 | sed 's/[[0-9]]\{1,\}$/?/' | sort],
5201 3 0 50:54:00:00:00:01 ?
5202 3 0 50:54:00:00:00:02 ?
5203 3 0 50:54:00:00:00:03 ?
5204 3 0 50:54:00:00:00:04 ?
5205 3 0 50:54:00:00:00:05 ?
5206 3 0 50:54:00:00:00:06 ?
5207 3 0 50:54:00:00:00:07 ?
5208 3 0 50:54:00:00:00:08 ?
5209 3 0 50:54:00:00:00:09 ?
5210 3 0 50:54:00:00:00:10 ?
5216 AT_SETUP([ofproto-dpif - MAC table overflow fairness])
5218 [set bridge br0 fail-mode=standalone other-config:mac-table-size=10])
5219 add_of_ports br0 1 2 3 4 5 6
5221 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)'
5223 AT_CHECK([ovs-appctl time/stop])
5225 # Trace packets with 2 different source MACs arriving on each of the 5
5226 # ports, filling up the 10-entry learning table.
5227 for i in 0 1 2 3 4 5 6 7 8 9; do
5229 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
5230 ovs-appctl time/warp 1000
5233 # Check for the MAC learning entries.
5234 AT_CHECK_UNQUOTED([ovs-appctl fdb/show br0 | sed 's/ *[[0-9]]\{1,\}$//' | sort],
5236 1 0 50:54:00:00:00:00
5237 1 0 50:54:00:00:00:01
5238 2 0 50:54:00:00:00:02
5239 2 0 50:54:00:00:00:03
5240 3 0 50:54:00:00:00:04
5241 3 0 50:54:00:00:00:05
5242 4 0 50:54:00:00:00:06
5243 4 0 50:54:00:00:00:07
5244 5 0 50:54:00:00:00:08
5245 5 0 50:54:00:00:00:09
5249 # Now trace 16 new MACs on another port.
5250 for i in 0 1 2 3 4 5 6 7 8 9 a b c d e f; do
5251 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
5252 ovs-appctl time/warp 1000
5255 # Check the results.
5257 # Our eviction algorithm on overflow is that an arbitrary (but deterministic)
5258 # one of the ports with the most learned MACs loses the least recently used
5259 # one. Thus, the new port will end up with 3 MACs, 3 of the old ports with 1
5260 # MAC each, and the other 2 of the old ports with 2 MACs each.
5262 # (If someone changes lib/heap.c to do something different with equal-priority
5263 # nodes, then the output below could change, but it would still follow the
5264 # rules explained above.)
5265 AT_CHECK_UNQUOTED([ovs-appctl fdb/show br0 | sed 's/ *[[0-9]]\{1,\}$//' | sort],
5267 1 0 50:54:00:00:00:01
5268 2 0 50:54:00:00:00:03
5269 3 0 50:54:00:00:00:04
5270 3 0 50:54:00:00:00:05
5271 4 0 50:54:00:00:00:07
5272 5 0 50:54:00:00:00:08
5273 5 0 50:54:00:00:00:09
5274 6 0 50:54:00:00:0d:ff
5275 6 0 50:54:00:00:0e:ff
5276 6 0 50:54:00:00:0f:ff
5282 # CHECK_SFLOW_SAMPLING_PACKET(LOOPBACK_ADDR)
5284 # Test that sFlow samples packets correctly using IPv4/IPv6 sFlow collector
5285 m4_define([CHECK_SFLOW_SAMPLING_PACKET],
5286 [AT_XFAIL_IF([test "$IS_WIN32" = "yes"])
5287 OVS_VSWITCHD_START([set Bridge br0 fail-mode=standalone])
5289 on_exit 'kill `cat test-sflow.pid`'
5290 AT_CHECK([ovstest test-sflow --log-file --detach --no-chdir --pidfile 0:$1 > sflow.log], [0], [], [ignore])
5291 AT_CAPTURE_FILE([sflow.log])
5292 PARSE_LISTENING_PORT([test-sflow.log], [SFLOW_PORT])
5293 ovs-appctl time/stop
5295 add_of_ports br0 1 2
5297 set Interface br0 options:ifindex=1002 -- \
5298 set Interface p1 options:ifindex=1004 -- \
5299 set Interface p2 options:ifindex=1003 -- \
5300 set Bridge br0 sflow=@sf -- \
5301 --id=@sf create sflow targets=\"$1:$SFLOW_PORT\" \
5302 header=128 sampling=1 polling=1 agent=$LOOPBACK_INTERFACE
5304 dnl open with ARP packets to seed the bridge-learning. The output
5305 dnl ifIndex numbers should be reported predictably after that.
5306 dnl Since we set sampling=1 we should see all of these packets
5307 dnl reported. Sorting the output by data-source and seqNo makes
5308 dnl it deterministic. Ensuring that we send at least two packets
5309 dnl into each port means we get to check the seq nos are
5310 dnl incrementing correctly.
5311 dnl because packets from different ports can be handled by separate
5312 dnl threads, put some sleeps
5314 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)'
5316 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)'
5318 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)'
5320 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)'
5321 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)'
5323 dnl sleep long enough to get more than one counter sample
5324 dnl from each datasource so we can check sequence numbers
5325 ovs-appctl time/warp 2000 100
5327 OVS_APP_EXIT_AND_WAIT([test-sflow])
5329 AT_CHECK_UNQUOTED([[sort sflow.log | $EGREP 'HEADER|ERROR' | sed 's/ /\
5350 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
5370 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
5390 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
5410 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
5430 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
5433 AT_CHECK_UNQUOTED([[sort sflow.log | $EGREP 'IFCOUNTERS|ERROR|PORTNAME|OPENFLOWPORT' | head -18 | sed 's/ /\
5446 in_multicasts=4294967295
5447 in_broadcasts=4294967295
5448 in_discards=4294967295
5449 in_errors=4294967295
5450 in_unknownprotos=4294967295
5453 out_multicasts=4294967295
5454 out_broadcasts=4294967295
5455 out_discards=4294967295
5456 out_errors=4294967295
5469 in_multicasts=4294967295
5470 in_broadcasts=4294967295
5471 in_discards=4294967295
5472 in_errors=4294967295
5473 in_unknownprotos=4294967295
5476 out_multicasts=4294967295
5477 out_broadcasts=4294967295
5478 out_discards=4294967295
5479 out_errors=4294967295
5492 in_multicasts=4294967295
5493 in_broadcasts=4294967295
5494 in_discards=4294967295
5495 in_errors=4294967295
5496 in_unknownprotos=4294967295
5499 out_multicasts=4294967295
5500 out_broadcasts=4294967295
5501 out_discards=4294967295
5502 out_errors=4294967295
5515 in_multicasts=4294967295
5516 in_broadcasts=4294967295
5517 in_discards=4294967295
5518 in_errors=4294967295
5519 in_unknownprotos=4294967295
5522 out_multicasts=4294967295
5523 out_broadcasts=4294967295
5524 out_discards=4294967295
5525 out_errors=4294967295
5538 in_multicasts=4294967295
5539 in_broadcasts=4294967295
5540 in_discards=4294967295
5541 in_errors=4294967295
5542 in_unknownprotos=4294967295
5545 out_multicasts=4294967295
5546 out_broadcasts=4294967295
5547 out_discards=4294967295
5548 out_errors=4294967295
5561 in_multicasts=4294967295
5562 in_broadcasts=4294967295
5563 in_discards=4294967295
5564 in_errors=4294967295
5565 in_unknownprotos=4294967295
5568 out_multicasts=4294967295
5569 out_broadcasts=4294967295
5570 out_discards=4294967295
5571 out_errors=4294967295
5574 datapath_id=18364758544493064720
5577 datapath_id=18364758544493064720
5580 datapath_id=18364758544493064720
5583 datapath_id=18364758544493064720
5586 datapath_id=18364758544493064720
5589 datapath_id=18364758544493064720
5605 AT_SETUP([ofproto-dpif - basic truncate action])
5607 add_of_ports br0 1 2 3 4 5
5609 AT_CHECK([ovs-vsctl -- set Interface p1 type=dummy options:pcap=p1.pcap])
5610 AT_CHECK([ovs-vsctl -- set Interface p2 type=dummy options:pstream=punix:p2.sock])
5611 AT_CHECK([ovs-vsctl -- set Interface p3 type=dummy options:stream=unix:p2.sock])
5612 AT_CHECK([ovs-vsctl -- set Interface p4 type=dummy options:pstream=punix:p4.sock])
5613 AT_CHECK([ovs-vsctl -- set Interface p5 type=dummy options:stream=unix:p4.sock])
5615 AT_DATA([flows.txt], [dnl
5616 in_port=3,actions=drop
5617 in_port=5,actions=drop
5618 in_port=1,actions=output(port=2,max_len=64),output:4
5620 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
5622 dnl Datapath actions
5623 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])
5624 AT_CHECK([tail -1 stdout], [0],
5625 [Datapath actions: trunc(64),2,4
5628 dnl An 170 byte packet
5629 AT_CHECK([ovs-appctl netdev-dummy/receive p1 '000c29c8a0a4005056c0000808004500009cb4a6000040019003c0a8da01c0a8da640800cb5fa762000556f431ad0009388e08090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f'])
5631 AT_CHECK([ovs-ofctl parse-pcap p1.pcap], [0], [dnl
5632 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
5635 AT_CHECK([ovs-appctl revalidator/purge], [0])
5636 dnl packet with truncated size
5637 AT_CHECK([ovs-ofctl dump-flows br0 | grep "in_port=3" | sed -n 's/.*\(n\_bytes=[[0-9]]*\).*/\1/p'], [0], [dnl
5640 dnl packet with original size
5641 AT_CHECK([ovs-ofctl dump-flows br0 | grep "in_port=5" | sed -n 's/.*\(n\_bytes=[[0-9]]*\).*/\1/p'], [0], [dnl
5645 dnl More complicated case
5646 AT_CHECK([ovs-ofctl del-flows br0])
5647 AT_DATA([flows.txt], [dnl
5648 in_port=3,actions=drop
5649 in_port=5,actions=drop
5650 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
5652 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
5654 dnl Datapath actions
5655 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])
5656 AT_CHECK([tail -1 stdout], [0],
5657 [Datapath actions: trunc(64),2,trunc(128),2,trunc(60),4,2,4
5660 dnl An 170 byte packet
5661 AT_CHECK([ovs-appctl netdev-dummy/receive p1 '000c29c8a0a4005056c0000808004500009cb4a6000040019003c0a8da01c0a8da640800cb5fa762000556f431ad0009388e08090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f'])
5663 AT_CHECK([ovs-appctl revalidator/purge], [0])
5664 dnl packet size: 64 + 128 + 170 = 362
5665 AT_CHECK([ovs-ofctl dump-flows br0 | grep "in_port=3" | sed -n 's/.*\(n\_bytes=[[0-9]]*\).*/\1/p'], [0], [dnl
5668 dnl packet size: 60 + 170 = 230
5669 AT_CHECK([ovs-ofctl dump-flows br0 | grep "in_port=5" | sed -n 's/.*\(n\_bytes=[[0-9]]*\).*/\1/p'], [0], [dnl
5674 AT_CHECK([ovs-ofctl add-flow br0 'actions=output(port=ALL,max_len=100)'], [1], [], [dnl
5675 ovs-ofctl: output to unsupported truncate port: ALL
5681 AT_SETUP([ofproto-dpif - truncate and output to patch port])
5682 OVS_VSWITCHD_START([add-br br1 \
5683 -- set bridge br1 datapath-type=dummy fail-mode=secure \
5684 -- add-port br1 pbr1 -- set int pbr1 type=patch options:peer=pbr0 ofport_request=1 \
5685 -- add-port br0 pbr0 -- set int pbr0 type=patch options:peer=pbr1])
5689 AT_CHECK([ovs-ofctl add-flow br0 actions='output(port=1,max_len=100),output:2'])
5690 AT_CHECK([ovs-ofctl add-flow br1 actions=NORMAL])
5692 AT_CHECK([ovs-appctl ofproto/trace br0 in_port=LOCAL,dl_src=10:20:30:40:50:60],
5694 AT_CHECK([tail -1 stdout], [0], [Datapath actions: 2
5696 dnl the output(port=1,max_len=100) fails the translation, only output:2 in datapath
5697 AT_CHECK([grep "output_trunc does not support port: [[0-9]]*" stdout], [0], [stdout])
5702 AT_SETUP([ofproto-dpif - truncate and output to gre tunnel])
5703 OVS_VSWITCHD_START([add-port br0 p1 -- set Interface p1 type=gre \
5704 options:remote_ip=1.1.1.1 options:local_ip=2.2.2.2 \
5705 options:key=5 ofport_request=1\
5706 -- add-port br0 p2 -- set Interface p2 type=dummy \
5708 AT_DATA([flows.txt], [dnl
5709 actions=output(max_len=100, port=1)
5711 OVS_VSWITCHD_DISABLE_TUNNEL_PUSH_POP
5712 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
5714 AT_CHECK([ovs-appctl dpif/show | tail -n +3], [0], [dnl
5715 br0 65534/100: (dummy-internal)
5716 p1 1/1: (gre: key=5, local_ip=2.2.2.2, remote_ip=1.1.1.1)
5721 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])
5722 AT_CHECK([tail -1 stdout], [0],
5723 [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
5729 AT_SETUP([ofproto-dpif - sFlow packet sampling - IPv4 collector])
5730 CHECK_SFLOW_SAMPLING_PACKET([127.0.0.1])
5733 AT_SETUP([ofproto-dpif - sFlow packet sampling - IPv6 collector])
5734 AT_SKIP_IF([test $HAVE_IPV6 = no])
5735 CHECK_SFLOW_SAMPLING_PACKET([[[::1]]])
5738 dnl Test sFlow LAG structures
5739 AT_SETUP([ofproto-dpif - sFlow packet sampling - LACP structures])
5740 AT_SKIP_IF([test "$IS_WIN32" = "yes"])
5741 OVS_VSWITCHD_START([dnl
5742 add-bond br0 bond p1 p2 -- \
5743 set Port bond lacp=active bond-mode=active-backup \
5744 other_config:lacp-time="fast" \
5745 other_config:lacp-system-id=11:22:33:44:55:66 \
5746 other_config:lacp-system-priority=54321 -- \
5747 set Interface p1 type=dummy \
5748 other_config:lacp-port-id=11 \
5749 other_config:lacp-port-priority=111 \
5750 other_config:lacp-aggregation-key=3333 -- \
5751 set Interface p2 type=dummy \
5752 other_config:lacp-port-id=22 \
5753 other_config:lacp-port-priority=222 \
5754 other_config:lacp-aggregation-key=3333 ])
5756 on_exit 'kill `cat test-sflow.pid`'
5757 AT_CHECK([ovstest test-sflow --log-file --detach --no-chdir --pidfile 0:127.0.0.1 > sflow.log], [0], [], [ignore])
5758 AT_CAPTURE_FILE([sflow.log])
5759 PARSE_LISTENING_PORT([test-sflow.log], [SFLOW_PORT])
5761 ovs-appctl time/stop
5764 set Interface p1 options:ifindex=1003 -- \
5765 set Bridge br0 sflow=@sf -- \
5766 --id=@sf create sflow targets=\"127.0.0.1:$SFLOW_PORT\" \
5767 header=128 sampling=1 polling=1
5769 dnl sleep long enough to get the sFlow datagram flushed out (may be delayed for up to 1 second)
5770 AT_CHECK([ovs-appctl time/warp 2000 100], [0], [ignore])
5771 AT_CHECK([ovs-appctl revalidator/purge], [0])
5773 OVS_APP_EXIT_AND_WAIT([test-sflow])
5774 AT_CHECK([[sort sflow.log | $EGREP 'LACPCOUNTERS|ERROR' | head -n 1 | sed 's/ /\
5777 sysID=11:22:33:44:55:66
5778 partnerID=00:00:00:00:00:00
5785 markerPDUsRx=4294967295
5786 markerRespPDUsRx=4294967295
5787 unknownRx=4294967295
5790 markerPDUsTx=4294967295
5791 markerRespPDUsTx=4294967295
5796 AT_SETUP([ofproto-dpif - sFlow packet sampling - tunnel set])
5797 AT_XFAIL_IF([test "$IS_WIN32" = "yes"])
5798 OVS_VSWITCHD_START([set Bridge br0 fail-mode=standalone])
5800 dnl set up sFlow logging
5801 AT_CHECK([ovstest test-sflow --log-file --detach --no-chdir --pidfile 0:127.0.0.1 > sflow.log], [0], [], [ignore])
5802 AT_CAPTURE_FILE([sflow.log])
5803 PARSE_LISTENING_PORT([test-sflow.log], [SFLOW_PORT])
5804 ovs-appctl time/stop
5806 OVS_VSWITCHD_DISABLE_TUNNEL_PUSH_POP
5807 AT_CHECK([ovs-vsctl add-port br0 gre0 -- set Interface gre0 type=gre \
5808 options:remote_ip=1.1.1.1 options:key=456 ofport_request=3])
5809 AT_CHECK([ovs-vsctl add-port br0 p1 -- set Interface p1 type=dummy ofport_request=4])
5811 AT_CHECK([ovs-ofctl add-flow br0 action=3])
5815 set Bridge br0 sflow=@sf -- \
5816 --id=@sf create sflow targets=\"127.0.0.1:$SFLOW_PORT\" \
5817 header=128 sampling=1 polling=0
5819 dnl introduce a packet that will be flooded to the tunnel
5820 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)'])
5822 dnl sleep long enough to get the sFlow datagram flushed out (may be delayed for up to 1 second)
5823 for i in `seq 1 30`; do
5824 ovs-appctl time/warp 100
5827 OVS_APP_EXIT_AND_WAIT([test-sflow])
5829 AT_CHECK_UNQUOTED([[sort sflow.log | $EGREP 'HEADER|ERROR' | sed 's/ /\
5835 tunnel4_out_length=0
5836 tunnel4_out_protocol=47
5837 tunnel4_out_src=0.0.0.0
5838 tunnel4_out_dst=1.1.1.1
5839 tunnel4_out_src_port=0
5840 tunnel4_out_dst_port=0
5841 tunnel4_out_tcp_flags=0
5859 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
5865 AT_SETUP([ofproto-dpif - sFlow packet sampling - tunnel push])
5866 AT_XFAIL_IF([test "$IS_WIN32" = "yes"])
5868 OVS_VSWITCHD_START([add-port br0 p0 -- set Interface p0 type=dummy ofport_request=1 options:ifindex=1010])
5870 dnl set up sFlow logging
5871 AT_CHECK([ovstest test-sflow --log-file --detach --no-chdir --pidfile 0:127.0.0.1 > sflow.log], [0], [], [ignore])
5872 AT_CAPTURE_FILE([sflow.log])
5873 PARSE_LISTENING_PORT([test-sflow.log], [SFLOW_PORT])
5874 ovs-appctl time/stop
5876 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
5877 AT_CHECK([ovs-vsctl add-br int-br -- set bridge int-br datapath_type=dummy], [0])
5878 AT_CHECK([ovs-vsctl -- add-port int-br t1 -- set Interface t1 type=gre \
5879 options:remote_ip=1.1.2.92 options:key=456 ofport_request=4\
5880 -- add-port int-br vm1 -- set Interface vm1 type=dummy \
5881 options:ifindex=2011 ofport_request=5
5884 AT_CHECK([ovs-appctl dpif/show], [0], [dnl
5885 dummy@ovs-dummy: hit:0 missed:0
5887 br0 65534/100: (dummy-internal)
5888 p0 1/1: (dummy: ifindex=1010)
5890 int-br 65534/2: (dummy-internal)
5891 t1 4/4: (gre: key=456, remote_ip=1.1.2.92)
5892 vm1 5/3: (dummy: ifindex=2011)
5895 dnl set up route to 1.1.2.92 via br0 and action=normal
5896 AT_CHECK([ovs-appctl netdev-dummy/ip4addr br0 1.1.2.88/24], [0], [OK
5898 AT_CHECK([ovs-appctl ovs/route/add 1.1.2.92/24 br0], [0], [OK
5900 AT_CHECK([ovs-ofctl add-flow br0 action=normal])
5902 dnl Prime ARP Cache for 1.1.2.92
5903 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)'])
5905 dnl configure sflow on int-br only
5907 set Bridge int-br sflow=@sf -- \
5908 --id=@sf create sflow targets=\"127.0.0.1:$SFLOW_PORT\" \
5909 header=128 sampling=1 polling=0
5911 dnl set up route to 192.168.1.2 via br0
5912 AT_CHECK([ovs-appctl netdev-dummy/ip4addr br0 192.168.1.1/16], [0], [OK
5914 AT_CHECK([ovs-appctl ovs/route/add 192.168.0.0/16 br0], [0], [OK
5917 dnl add rule for int-br to force packet onto tunnel. There is no ifindex
5918 dnl for this port so the sFlow output will just report that it went to
5919 dnl 1 output (out_format=2, out_ifindex=1)
5920 AT_CHECK([ovs-ofctl add-flow int-br "actions=4"])
5922 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)'])
5924 dnl sleep long enough to get the sFlow datagram flushed out (may be delayed for up to 1 second)
5925 for i in `seq 1 30`; do
5926 ovs-appctl time/warp 100
5929 OVS_APP_EXIT_AND_WAIT([test-sflow])
5931 AT_CHECK_UNQUOTED([[sort sflow.log | $EGREP 'HEADER|ERROR' | sed 's/ /\
5937 tunnel4_out_length=0
5938 tunnel4_out_protocol=47
5939 tunnel4_out_src=1.1.2.88
5940 tunnel4_out_dst=1.1.2.92
5941 tunnel4_out_src_port=0
5942 tunnel4_out_dst_port=0
5943 tunnel4_out_tcp_flags=0
5961 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
5967 AT_SETUP([ofproto-dpif - sFlow packet sampling - MPLS])
5968 AT_XFAIL_IF([test "$IS_WIN32" = "yes"])
5970 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
5971 add_of_ports br0 1 2
5972 AT_DATA([flows.txt], [dnl
5973 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
5974 table=0 dl_src=50:54:00:00:00:0b actions=pop_mpls:0x0800,2
5976 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
5978 dnl set up sFlow logging
5979 AT_CHECK([ovstest test-sflow --log-file --detach --no-chdir --pidfile 0:127.0.0.1 > sflow.log], [0], [], [ignore])
5980 AT_CAPTURE_FILE([sflow.log])
5981 PARSE_LISTENING_PORT([test-sflow.log], [SFLOW_PORT])
5982 ovs-appctl time/stop
5986 set Bridge br0 sflow=@sf -- \
5987 --id=@sf create sflow targets=\"127.0.0.1:$SFLOW_PORT\" \
5988 header=128 sampling=1 polling=0
5990 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)'])
5991 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)'])
5993 dnl sleep long enough to get the sFlow datagram flushed out (may be delayed for up to 1 second)
5994 for i in `seq 1 30`; do
5995 ovs-appctl time/warp 100
5998 OVS_APP_EXIT_AND_WAIT([test-sflow])
6000 AT_CHECK_UNQUOTED([[sort sflow.log | $EGREP 'HEADER|ERROR' | sed 's/ /\
6029 hdr=50-54-00-00-00-0A-50-54-00-00-00-09-88-47-00-00-B7-40
6053 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
6060 # CHECK_NETFLOW_EXPIRATION(LOOPBACK_ADDR)
6062 # Test that basic NetFlow reports flow statistics correctly:
6063 # The initial packet of a flow are correctly accounted.
6064 # Later packets within a flow are correctly accounted.
6065 # Flow actions changing (in this case, due to MAC learning)
6066 # cause a record to be sent.
6067 m4_define([CHECK_NETFLOW_EXPIRATION],
6068 [OVS_VSWITCHD_START([set Bridge br0 fail-mode=standalone])
6069 add_of_ports br0 1 2
6071 ovs-appctl time/stop
6072 on_exit 'kill `cat test-netflow.pid`'
6073 AT_CHECK([ovstest test-netflow --log-file --detach --no-chdir --pidfile 0:$1 > netflow.log], [0], [], [ignore])
6074 AT_CAPTURE_FILE([netflow.log])
6075 PARSE_LISTENING_PORT([test-netflow.log], [NETFLOW_PORT])
6078 set Bridge br0 netflow=@nf -- \
6079 --id=@nf create NetFlow targets=\"$1:$NETFLOW_PORT\" \
6080 engine_id=1 engine_type=2 active_timeout=30 add-id-to-interface=false
6082 for delay in 1000 30000; do
6083 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)'
6084 sleep 1 # ensure the order in which these two packets are processed
6085 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)'
6087 ovs-appctl time/warp $delay
6090 ovs-appctl time/warp 6000
6091 ovs-appctl revalidator/wait
6093 OVS_APP_EXIT_AND_WAIT([test-netflow])
6095 AT_CHECK([test `grep "192.168.0.1 > 192.168.0.2, if 1 > 65535, 1 pkts, 42 bytes, ICMP 8:0" netflow.log | wc -l` -eq 1])
6097 AT_CHECK([test `grep "192.168.0.1 > 192.168.0.2, if 1 > 2, 1 pkts, 42 bytes, ICMP 8:0" netflow.log | wc -l` -eq 1])
6099 combined=`grep "192.168.0.2 > 192.168.0.1, if 2 > 1, 2 pkts, 84 bytes, ICMP 0:0" netflow.log | wc -l`
6100 separate=`grep "192.168.0.2 > 192.168.0.1, if 2 > 1, 1 pkts, 42 bytes, ICMP 0:0" netflow.log | wc -l`
6101 AT_CHECK([test $separate = 2 || test $combined = 1], [0])])
6103 AT_SETUP([ofproto-dpif - NetFlow flow expiration - IPv4 collector])
6104 CHECK_NETFLOW_EXPIRATION([127.0.0.1])
6107 AT_SETUP([ofproto-dpif - NetFlow flow expiration - IPv6 collector])
6108 AT_SKIP_IF([test $HAVE_IPV6 = no])
6109 CHECK_NETFLOW_EXPIRATION([[[::1]]])
6112 # CHECK_NETFLOW_ACTIVE_EXPIRATION(LOOPBACK_ADDR)
6114 # Test that basic NetFlow reports active expirations correctly.
6115 m4_define([CHECK_NETFLOW_ACTIVE_EXPIRATION],
6116 [OVS_VSWITCHD_START([set Bridge br0 fail-mode=standalone])
6117 add_of_ports br0 1 2
6119 on_exit 'kill `cat test-netflow.pid`'
6120 AT_CHECK([ovstest test-netflow --log-file --detach --no-chdir --pidfile 0:$1 > netflow.log], [0], [], [ignore])
6121 AT_CAPTURE_FILE([netflow.log])
6122 PARSE_LISTENING_PORT([test-netflow.log], [NETFLOW_PORT])
6125 set Bridge br0 netflow=@nf -- \
6126 --id=@nf create NetFlow targets=\"$1:$NETFLOW_PORT\" \
6127 engine_id=1 engine_type=2 active_timeout=10 add-id-to-interface=false
6129 AT_CHECK([ovs-appctl time/stop])
6131 while test $n -le 60; do
6134 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)'
6135 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)'
6137 ovs-appctl time/warp 1000
6140 ovs-appctl time/warp 10000
6142 ovs-appctl revalidator/wait
6144 OVS_APP_EXIT_AND_WAIT([test-netflow])
6146 # Count the number of reported packets:
6147 # - From source to destination before MAC learning kicks in (just one).
6148 # - From source to destination after that.
6149 # - From destination to source.
6157 pkts=`echo "$line" | sed 's/.*, \([[0-9]]*\) pkts,.*/\1/'`
6164 "seq "*": 192.168.0.1 > 192.168.0.2, if 1 > 65535, "*" pkts, "*" bytes, TCP 1234 > 80, time "*)
6167 "seq "*": 192.168.0.1 > 192.168.0.2, if 1 > 2, "*" pkts, "*" bytes, TCP 1234 > 80, time "*)
6170 "seq "*": 192.168.0.2 > 192.168.0.1, if 2 > 1, "*" pkts, "*" bytes, TCP 80 > 1234, time "*)
6177 eval $counter=\`expr \$$counter + \$pkts\`
6178 n_recs=`expr $n_recs + 1`
6181 # There should be exactly 1 MAC learning packet,
6182 # exactly 59 other packets in that direction,
6183 # and exactly 60 packets in the other direction.
6184 AT_CHECK([echo $n_learn $n_in $n_out $n_other], [0], [1 59 60 0
6187 AT_SETUP([ofproto-dpif - NetFlow active expiration - IPv4 collector])
6188 CHECK_NETFLOW_ACTIVE_EXPIRATION([127.0.0.1])
6191 AT_SETUP([ofproto-dpif - NetFlow active expiration - IPv6 collector])
6192 AT_SKIP_IF([test $HAVE_IPV6 = no])
6193 CHECK_NETFLOW_ACTIVE_EXPIRATION([[[::1]]])
6196 dnl In the absence of an IPFIX collector to verify protocol correctness, simply
6197 dnl configure bridge IPFIX and ensure that sample action generation works at the
6199 AT_SETUP([ofproto-dpif - Bridge IPFIX sanity check])
6201 add_of_ports br0 1 2
6203 dnl Sample every packet using bridge-based sampling.
6204 AT_CHECK([ovs-vsctl -- set bridge br0 ipfix=@fix -- \
6205 --id=@fix create ipfix targets=\"127.0.0.1:4739\" \
6206 sampling=1], [0], [ignore])
6208 dnl Send some packets that should be sampled.
6209 for i in `seq 1 3`; do
6210 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)'])
6212 AT_CHECK([ovs-appctl dpctl/dump-flows | sed 's/.*\(packets:\)/\1/' | sed 's/used:[[0-9]].[[0-9]]*s/used:0.001s/'], [0], [dnl
6213 flow-dump from non-dpdk interfaces:
6214 packets:2, bytes:68, used:0.001s, actions:sample(sample=100.0%,actions(userspace(pid=0,ipfix(output_port=4294967295))))
6217 dnl Remove the IPFIX configuration.
6218 AT_CHECK([ovs-vsctl clear bridge br0 ipfix])
6219 AT_CHECK([ovs-appctl revalidator/purge])
6221 dnl Send some more packets, to ensure that these are not sampled.
6222 for i in `seq 1 3`; do
6223 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)'])
6225 AT_CHECK([ovs-appctl dpctl/dump-flows | sed 's/.*\(packets:\)/\1/' | sed 's/used:[[0-9]].[[0-9]]*s/used:0.001s/'], [0], [dnl
6226 flow-dump from non-dpdk interfaces:
6227 packets:2, bytes:68, used:0.001s, actions:drop
6230 OVS_VSWITCHD_STOP(["/sending to collector failed/d"])
6233 dnl Bridge IPFIX statistics check
6234 AT_SETUP([ofproto-dpif - Bridge IPFIX statistics check])
6236 add_of_ports br0 1 2
6238 dnl Negative test check.
6239 AT_CHECK([ovs-ofctl dump-ipfix-bridge br0], [0], [dnl
6240 OFPT_ERROR (xid=0x2): NXST_NOT_CONFIGURED
6241 NXST_IPFIX_BRIDGE request (xid=0x2):
6244 dnl Sample every packet using bridge-based sampling.
6245 AT_CHECK([ovs-vsctl -- set bridge br0 ipfix=@fix -- \
6246 --id=@fix create ipfix targets=\"127.0.0.1:4739\" \
6247 sampling=1], [0], [ignore])
6249 dnl Send some packets that should be sampled.
6250 for i in `seq 1 20`; do
6251 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)'])
6254 dnl There are 4 extra IPFIX template packets.
6255 AT_CHECK([ovs-ofctl dump-ipfix-bridge br0 | sed 's/tx pkts=[[0-9]]*/tx pkts=24/' | sed 's/tx errs=[[0-9]]*/tx errs=0/'], [0], [dnl
6256 NXST_IPFIX_BRIDGE reply (xid=0x2):
6257 bridge ipfix: flows=20, current flows=0, sampled pkts=20, ipv4 ok=0, ipv6 ok=0, tx pkts=24
6258 pkts errs=20, ipv4 errs=20, ipv6 errs=0, tx errs=0
6261 dnl Remove the IPFIX configuration.
6262 AT_CHECK([ovs-vsctl clear bridge br0 ipfix])
6263 AT_CHECK([ovs-appctl revalidator/purge])
6265 dnl Send some more packets, to ensure that these are not sampled.
6266 for i in `seq 1 2`; do
6267 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)'])
6269 AT_CHECK([ovs-ofctl dump-ipfix-bridge br0], [0], [dnl
6270 OFPT_ERROR (xid=0x2): NXST_NOT_CONFIGURED
6271 NXST_IPFIX_BRIDGE request (xid=0x2):
6274 OVS_VSWITCHD_STOP(["/sending to collector failed/d"])
6277 dnl Flow IPFIX sanity check
6278 AT_SETUP([ofproto-dpif - Flow IPFIX sanity check])
6280 add_of_ports br0 1 2
6282 AT_CHECK([ovs-vsctl -- --id=@br0 get Bridge br0 \
6283 -- --id=@ipfix create IPFIX targets=\"127.0.0.1:4739\" \
6284 -- --id=@cs create Flow_Sample_Collector_Set id=1 bridge=@br0 ipfix=@ipfix],
6287 AT_DATA([flows.txt], [dnl
6288 in_port=1, actions=sample(probability=65535,collector_set_id=1),output:2
6291 AT_CHECK([ovs-ofctl add-flows br0 flows.txt], [0], [ignore])
6293 dnl Send some packets that should be sampled.
6294 for i in `seq 1 3`; do
6295 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)'])
6297 AT_CHECK([ovs-appctl dpctl/dump-flows | sed 's/.*\(packets:\)/\1/' | sed 's/used:[[0-9]].[[0-9]]*s/used:0.001s/'], [0], [dnl
6298 flow-dump from non-dpdk interfaces:
6299 packets:2, bytes:68, 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
6302 dnl Remove the flow which contains sample action.
6303 AT_CHECK([ovs-ofctl del-flows br0 in_port=1], [0], [ignore])
6304 AT_CHECK([ovs-appctl revalidator/purge])
6306 dnl Send some more packets, to ensure that these are not sampled.
6307 for i in `seq 1 3`; do
6308 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)'])
6310 AT_CHECK([ovs-appctl dpctl/dump-flows | sed 's/.*\(packets:\)/\1/' | sed 's/used:[[0-9]].[[0-9]]*s/used:0.001s/'], [0], [dnl
6311 flow-dump from non-dpdk interfaces:
6312 packets:2, bytes:68, used:0.001s, actions:drop
6315 OVS_VSWITCHD_STOP(["/sending to collector failed/d"])
6318 dnl Flow IPFIX sanity check for tunnel set
6319 AT_SETUP([ofproto-dpif - Flow IPFIX sanity check - tunnel set])
6320 OVS_VSWITCHD_START([add-port br0 p1 -- set Interface p1 type=gre \
6321 options:remote_ip=1.1.1.1 options:local_ip=2.2.2.2 \
6322 options:key=5 ofport_request=1\
6323 -- add-port br0 p2 -- set Interface p2 type=stt \
6324 options:remote_ip=1.1.1.2 options:local_ip=2.2.2.3 \
6325 options:key=6 ofport_request=2\
6326 -- add-port br0 p3 -- set Interface p3 type=dummy \
6328 -- --id=@br0 get Bridge br0 \
6329 -- --id=@ipfix create IPFIX targets=\"127.0.0.1:4739\" \
6330 -- --id=@cs create Flow_Sample_Collector_Set id=1 bridge=@br0 ipfix=@ipfix],
6335 OVS_VSWITCHD_DISABLE_TUNNEL_PUSH_POP
6337 dnl Add openflow sample action without sampling_port.
6338 AT_DATA([flows.txt], [dnl
6339 in_port=3, actions=sample(probability=65535,collector_set_id=1),output:1
6341 AT_CHECK([ovs-ofctl add-flows br0 flows.txt], [0], [ignore])
6343 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])
6344 AT_CHECK([tail -1 stdout], [0], [dnl
6345 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
6348 dnl Remove the flow which contains sample action.
6349 AT_CHECK([ovs-ofctl del-flows br0 in_port=3], [0], [ignore])
6350 AT_CHECK([ovs-appctl revalidator/purge])
6352 dnl Add openflow sample action with sampling_port which is
6353 dnl equal to output port.
6354 AT_DATA([flows2.txt], [dnl
6355 in_port=3, actions=sample(probability=65535,collector_set_id=1,sampling_port=1),output:1
6357 AT_CHECK([ovs-ofctl add-flows br0 flows2.txt], [0], [ignore])
6359 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])
6360 dnl Make sure flow sample action in datapath is behind set tunnel
6361 dnl action at egress point of tunnel port.
6362 AT_CHECK([tail -1 stdout], [0], [dnl
6363 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
6366 dnl Remove the flow which contains sample action.
6367 AT_CHECK([ovs-ofctl del-flows br0 in_port=3], [0], [ignore])
6368 AT_CHECK([ovs-appctl revalidator/purge])
6370 dnl Add a rule with two sample actions and each sample action
6371 dnl has a sampling_port
6372 AT_DATA([flows3.txt], [dnl
6373 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
6375 AT_CHECK([ovs-ofctl add-flows br0 flows3.txt], [0], [ignore])
6377 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])
6378 dnl Make sure flow sample action in datapath is behind set tunnel
6379 dnl action at egress point of tunnel port.
6380 AT_CHECK([tail -1 stdout], [0], [dnl
6381 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,tp_dst=7471,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
6384 dnl Remove the flow which contains sample action.
6385 AT_CHECK([ovs-ofctl del-flows br0 in_port=3], [0], [ignore])
6386 AT_CHECK([ovs-vsctl destroy Flow_Sample_Collector_Set 1], [0], [ignore])
6391 dnl Flow based IPFIX statistics check
6392 AT_SETUP([ofproto-dpif - Flow IPFIX statistics check])
6394 add_of_ports br0 1 2
6396 dnl Negative test check.
6397 AT_CHECK([ovs-ofctl dump-ipfix-flow br0], [0], [dnl
6398 OFPT_ERROR (xid=0x2): NXST_NOT_CONFIGURED
6399 NXST_IPFIX_FLOW request (xid=0x2):
6402 AT_CHECK([ovs-vsctl -- --id=@br0 get Bridge br0 \
6403 -- --id=@ipfix create IPFIX targets=\"127.0.0.1:4739\" \
6404 -- --id=@cs create Flow_Sample_Collector_Set id=1 bridge=@br0 ipfix=@ipfix],
6407 AT_DATA([flows.txt], [dnl
6408 in_port=1, actions=sample(probability=65535,collector_set_id=1),output:2
6411 AT_CHECK([ovs-ofctl add-flows br0 flows.txt], [0], [ignore])
6413 dnl Send some packets that should be sampled.
6414 for i in `seq 1 20`; do
6415 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)'])
6418 dnl There are 4 extra IPFIX template packets.
6419 AT_CHECK([ovs-ofctl dump-ipfix-flow br0 | sed 's/tx pkts=[[0-9]]*/tx pkts=24/' | sed 's/tx errs=[[0-9]]*/tx errs=0/'], [0], [dnl
6420 NXST_IPFIX_FLOW reply (xid=0x2): 1 ids
6421 id 1: flows=20, current flows=0, sampled pkts=20, ipv4 ok=0, ipv6 ok=0, tx pkts=24
6422 pkts errs=20, ipv4 errs=20, ipv6 errs=0, tx errs=0
6425 dnl Remove the flow which contains sample action.
6426 AT_CHECK([ovs-ofctl del-flows br0 in_port=1], [0], [ignore])
6427 AT_CHECK([ovs-vsctl destroy Flow_Sample_Collector_Set 1], [0], [ignore])
6428 AT_CHECK([ovs-appctl revalidator/purge])
6430 dnl Send some more packets, to ensure that these are not sampled.
6431 for i in `seq 1 3`; do
6432 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)'])
6434 AT_CHECK([ovs-ofctl dump-ipfix-flow br0], [0], [dnl
6435 OFPT_ERROR (xid=0x2): NXST_NOT_CONFIGURED
6436 NXST_IPFIX_FLOW request (xid=0x2):
6439 OVS_VSWITCHD_STOP(["/sending to collector failed/d"])
6442 AT_SETUP([ofproto-dpif - flow stats])
6444 AT_CHECK([ovs-ofctl add-flow br0 "ip,actions=NORMAL"])
6445 AT_CHECK([ovs-ofctl add-flow br0 "icmp,actions=NORMAL"])
6447 ovs-appctl time/stop
6449 for i in `seq 1 10`; do
6450 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)'
6453 AT_CHECK([ovs-appctl time/warp 1000], [0], [ignore])
6454 AT_CHECK([ovs-appctl revalidator/purge], [0])
6455 AT_CHECK([ovs-ofctl dump-flows br0], [0], [stdout])
6456 AT_CHECK([strip_xids < stdout | sed -n 's/duration=[[0-9]]*\.[[0-9]]*s/duration=0.0s/p' | sort], [0], [dnl
6457 cookie=0x0, duration=0.0s, table=0, n_packets=0, n_bytes=0, idle_age=1, icmp actions=NORMAL
6458 cookie=0x0, duration=0.0s, table=0, n_packets=10, n_bytes=540, idle_age=1, ip actions=NORMAL
6463 AT_SETUP([ofproto-dpif - flow stats reset_counts])
6465 flow="ip,actions=NORMAL"
6467 ovs-appctl time/stop
6469 AT_CHECK([ovs-ofctl add-flow br0 $flow])
6471 warp_and_dump_NXM () {
6472 AT_CHECK([ovs-appctl time/warp 1000], [0], [ignore])
6473 AT_CHECK([ovs-appctl revalidator/purge], [0])
6475 AT_CHECK_UNQUOTED([ovs-ofctl dump-flows br0], [0], [stdout])
6476 if [[ $5 -gt 0 ]]; then
6477 expected=" cookie=0x0, duration=$1s, table=0, n_packets=$2, n_bytes=$3, idle_age=$4, hard_age=$5, ip actions=NORMAL"
6479 expected=" cookie=0x0, duration=$1s, table=0, n_packets=$2, n_bytes=$3, idle_age=$4, ip actions=NORMAL"
6481 AT_CHECK_UNQUOTED([strip_xids < stdout | sed -n 's/duration=\([[0-9]]*\)\.*[[0-9]]*s/duration=\1s/p' | sort], [0], [dnl
6486 warp_and_dump_OF () {
6487 AT_CHECK([ovs-appctl time/warp 1000], [0], [ignore])
6488 AT_CHECK([ovs-appctl revalidator/purge], [0])
6490 AT_CHECK_UNQUOTED([ovs-ofctl -O OpenFlow$1 dump-flows br0], [0], [stdout])
6491 if [[ $1 -lt 13 -o "$5X" = "X" ]]; then
6492 expected=" cookie=0x0, duration=$2s, table=0, n_packets=$3, n_bytes=$4, ip actions=NORMAL"
6494 expected=" cookie=0x0, duration=$2s, table=0, n_packets=$3, n_bytes=$4, $5 ip actions=NORMAL"
6496 AT_CHECK_UNQUOTED([strip_xids < stdout | sed -n 's/duration=\([[0-9]]*\)\.*[[0-9]]*s/duration=\1s/p' | sort], [0], [dnl
6502 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)'
6505 # OpenFlow 1.0, implicit reset_counts
6507 warp_and_dump_NXM 1 1 54 1
6508 AT_CHECK_UNQUOTED([ovs-ofctl -O OpenFlow10 add-flow br0 $flow])
6509 # add-flow resets duration and counts,
6510 # but idle age is inherited from the old flow
6511 warp_and_dump_NXM 1 0 0 2
6514 warp_and_dump_NXM 2 1 54 1
6515 AT_CHECK_UNQUOTED([ovs-ofctl -O OpenFlow10 mod-flows br0 $flow])
6516 # mod-flows resets hard_age, but not counts
6517 # but duration and idle_age is inherited from the old flow
6518 warp_and_dump_NXM 3 1 54 2 1
6520 # OpenFlow 1.1, implicit reset_counts
6522 warp_and_dump_OF 11 4 2 108
6523 AT_CHECK_UNQUOTED([ovs-ofctl -O OpenFlow11 add-flow br0 $flow])
6524 # add-flow resets duration and counts,
6525 # but idle age is inherited from the old flow
6526 warp_and_dump_NXM 1 0 0 2
6527 warp_and_dump_OF 11 2 0 0
6530 warp_and_dump_OF 11 3 1 54
6531 AT_CHECK_UNQUOTED([ovs-ofctl -O OpenFlow11 mod-flows br0 $flow])
6532 # mod-flows resets hard_age, but not counts
6533 # but duration and idle_age is inherited from the old flow
6534 warp_and_dump_NXM 4 1 54 2 1
6535 warp_and_dump_OF 11 5 1 54
6537 # OpenFlow 1.2, explicit reset_counts
6539 warp_and_dump_OF 12 6 2 108
6540 AT_CHECK_UNQUOTED([ovs-ofctl -O OpenFlow12 add-flow br0 $flow])
6541 # add-flow without flags resets duration, but not counts,
6542 # idle age is inherited from the old flow
6543 warp_and_dump_NXM 1 2 108 2
6544 warp_and_dump_OF 12 2 2 108
6547 warp_and_dump_OF 12 3 3 162
6548 AT_CHECK_UNQUOTED([ovs-ofctl -O OpenFlow12 mod-flows br0 $flow])
6549 # mod-flows without flags does not reset duration nor counts,
6550 # idle age is inherited from the old flow
6551 warp_and_dump_NXM 4 3 162 2 1
6552 warp_and_dump_OF 12 5 3 162
6555 warp_and_dump_OF 12 6 4 216
6556 AT_CHECK_UNQUOTED([ovs-ofctl -O OpenFlow12 add-flow br0 reset_counts,$flow])
6557 # add-flow with reset_counts resets both duration and counts,
6558 # idle age is inherited from the old flow
6559 warp_and_dump_NXM 1 0 0 2
6560 warp_and_dump_OF 12 2 0 0
6563 warp_and_dump_OF 12 3 1 54
6564 AT_CHECK_UNQUOTED([ovs-ofctl -O OpenFlow12 mod-flows br0 reset_counts,$flow])
6565 # mod-flows with reset_counts resets counts, but not duration,
6566 # idle age is inherited from the old flow
6567 warp_and_dump_NXM 4 0 0 2 1
6568 warp_and_dump_OF 12 5 0 0
6570 # OpenFlow > 1.3, explicit reset_counts
6571 flow_mods_reset_counts () {
6572 # Reset to a known state
6573 AT_CHECK([ovs-ofctl add-flow br0 $flow])
6576 warp_and_dump_OF $1 1 1 54 reset_counts
6577 AT_CHECK_UNQUOTED([ovs-ofctl -O OpenFlow$1 add-flow br0 $flow])
6578 # add-flow without flags resets duration, but not counts,
6579 # idle age is inherited from the old flow
6580 warp_and_dump_NXM 1 1 54 2
6581 warp_and_dump_OF $1 2 1 54
6584 warp_and_dump_OF $1 3 2 108
6585 AT_CHECK_UNQUOTED([ovs-ofctl -O OpenFlow$1 mod-flows br0 $flow])
6586 # mod-flows without flags does not reset duration nor counts,
6587 # idle age is inherited from the old flow
6588 warp_and_dump_NXM 4 2 108 2 1
6589 warp_and_dump_OF $1 5 2 108
6592 warp_and_dump_OF $1 6 3 162
6593 AT_CHECK_UNQUOTED([ovs-ofctl -O OpenFlow$1 add-flow br0 reset_counts,$flow])
6594 # add-flow with reset_counts resets both duration and counts,
6595 # idle age is inherited from the old flow
6596 warp_and_dump_NXM 1 0 0 2
6597 warp_and_dump_OF $1 2 0 0 reset_counts
6600 warp_and_dump_OF $1 3 1 54 reset_counts
6601 AT_CHECK_UNQUOTED([ovs-ofctl -O OpenFlow$1 mod-flows br0 reset_counts,$flow])
6602 # mod-flows with reset_counts resets counts, but not duration,
6603 # idle age is inherited from the old flow
6604 warp_and_dump_NXM 4 0 0 2 1
6605 warp_and_dump_OF $1 5 0 0 reset_counts
6607 # Modify flow having reset_counts flag without reset_counts
6609 warp_and_dump_OF $1 6 1 54 reset_counts
6610 AT_CHECK_UNQUOTED([ovs-ofctl -O OpenFlow$1 mod-flows br0 $flow])
6611 warp_and_dump_NXM 7 1 54 2 1
6612 warp_and_dump_OF $1 8 1 54 reset_counts
6614 # Add flow having reset_counts flag without reset_counts
6616 warp_and_dump_OF $1 9 2 108 reset_counts
6617 AT_CHECK_UNQUOTED([ovs-ofctl -O OpenFlow$1 add-flow br0 $flow])
6618 warp_and_dump_NXM 1 2 108 2
6619 warp_and_dump_OF $1 2 2 108
6621 # Modify flow w/o reset_counts flag with a flow_mod having reset_counts
6623 warp_and_dump_OF $1 3 3 162
6624 AT_CHECK_UNQUOTED([ovs-ofctl -O OpenFlow$1 mod-flows br0 reset_counts,$flow])
6625 warp_and_dump_NXM 4 0 0 2 1
6626 warp_and_dump_OF $1 5 0 0
6629 # OpenFlow versions >= 1.3 should behave the same way
6630 flow_mods_reset_counts 13
6631 flow_mods_reset_counts 14
6632 flow_mods_reset_counts 15
6637 AT_SETUP([ofproto-dpif - flow stats, set-n-threads])
6639 AT_CHECK([ovs-ofctl add-flow br0 "ip,actions=NORMAL"])
6640 AT_CHECK([ovs-ofctl add-flow br0 "icmp,actions=NORMAL"])
6642 ovs-appctl time/stop
6644 for i in `seq 1 10`; do
6645 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)'
6648 ovs-appctl time/warp 100
6649 AT_CHECK([ovs-vsctl set Open_vSwitch . other-config:n-revalidator-threads=2])
6650 ovs-appctl time/warp 1000
6652 AT_CHECK([ovs-ofctl dump-flows br0], [0], [stdout])
6653 AT_CHECK([strip_xids < stdout | sed -n 's/duration=[[0-9]]*\.[[0-9]]*s/duration=0.0s/p' | sort], [0], [dnl
6654 cookie=0x0, duration=0.0s, table=0, n_packets=0, n_bytes=0, idle_age=1, icmp actions=NORMAL
6655 cookie=0x0, duration=0.0s, table=0, n_packets=10, n_bytes=540, idle_age=1, ip actions=NORMAL
6660 AT_SETUP([ofproto-dpif - idle_age and hard_age increase over time])
6663 # get_ages DURATION HARD IDLE
6665 # Fetch the flow duration, hard age, and idle age into the variables
6666 # whose names are given as arguments. Rounds DURATION down to the
6667 # nearest integer. If hard_age doesn't appear in the output, sets
6668 # HARD to "none". If idle_age doesn't appear in the output, sets IDLE
6671 AT_CHECK([ovs-ofctl dump-flows br0], [0], [stdout])
6673 duration=`sed -n 's/.*duration=\([[0-9]]*\)\(\.[[0-9]]*\)\{0,1\}s.*/\1/p' stdout`
6674 AT_CHECK([[expr X"$duration" : 'X[0-9][0-9]*$']], [0], [ignore])
6675 AS_VAR_COPY([$1], [duration])
6677 hard=`sed -n 's/.*hard_age=\([[0-9]]*\),.*/\1/p' stdout`
6678 if test X"$hard" = X; then
6681 AT_CHECK([[expr X"$hard" : 'X[0-9][0-9]*$']], [0], [ignore])
6683 AS_VAR_COPY([$2], [hard])
6685 idle=`sed -n 's/.*idle_age=\([[0-9]]*\),.*/\1/p' stdout`
6686 if test X"$idle" = X; then
6689 AT_CHECK([[expr X"$idle" : 'X[0-9][0-9]*$']], [0], [ignore])
6691 AS_VAR_COPY([$3], [idle])
6694 # Add a flow and get its initial hard and idle age.
6695 AT_CHECK([ovs-ofctl add-flow br0 hard_timeout=199,idle_timeout=188,actions=drop])
6696 get_ages duration1 hard1 idle1
6698 ovs-appctl time/stop
6699 # Warp time forward by 10 seconds, then modify the flow's actions.
6700 ovs-appctl time/warp 10000
6701 get_ages duration2 hard2 idle2
6702 AT_CHECK([ovs-ofctl mod-flows br0 actions=flood])
6704 # Warp time forward by 10 seconds.
6705 ovs-appctl time/warp 10000
6706 get_ages duration3 hard3 idle3
6708 # Warp time forward 10 more seconds, then pass some packets through the flow,
6709 # then warp forward a few more times because idle times are only updated
6711 ovs-appctl time/warp 10000
6712 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)'
6713 ovs-appctl time/warp 3000 1000
6715 get_ages duration4 hard4 idle4
6717 printf "duration: %4s => %4s => %4s => %4s\n" $duration1 $duration2 $duration3 $duration4
6718 printf "hard_age: %4s => %4s => %4s => %4s\n" $hard1 $hard2 $hard3 $hard4
6719 printf "idle_age: %4s => %4s => %4s => %4s\n" $idle1 $idle2 $idle3 $idle4
6721 # Duration should increase steadily over time.
6722 AT_CHECK([test $duration1 -lt $duration2])
6723 AT_CHECK([test $duration2 -lt $duration3])
6724 AT_CHECK([test $duration3 -lt $duration4])
6726 # Hard age should be "none" initially because it's the same as flow_duration,
6727 # then it should increase.
6728 AT_CHECK([test $hard1 = none])
6729 AT_CHECK([test $hard2 = none])
6730 AT_CHECK([test $hard3 != none])
6731 AT_CHECK([test $hard4 != none])
6732 AT_CHECK([test $hard3 -lt $hard4])
6734 # Idle age should increase from 1 to 2 to 3, then decrease.
6735 AT_CHECK([test $idle1 -lt $idle2])
6736 AT_CHECK([test $idle2 -lt $idle3])
6737 AT_CHECK([test $idle3 -gt $idle4])
6739 # Check some invariant relationships.
6740 AT_CHECK([test $duration1 = $idle1])
6741 AT_CHECK([test $duration2 = $idle2])
6742 AT_CHECK([test $duration3 = $idle3])
6743 AT_CHECK([test $idle3 -gt $hard3])
6744 AT_CHECK([test $idle4 -lt $hard4])
6745 AT_CHECK([test $hard4 -lt $duration4])
6750 AT_SETUP([ofproto-dpif - fin_timeout])
6752 ovs-appctl time/stop
6753 AT_CHECK([ovs-ofctl add-flow br0 'idle_timeout=60,actions=fin_timeout(idle_timeout=5)'])
6754 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip], [0],
6756 idle_timeout=60, actions=fin_timeout(idle_timeout=5)
6759 # Check that a TCP SYN packet does not change the timeout. (Because
6760 # flow stats updates are mainly what implements the fin_timeout
6761 # feature, we warp forward a couple of times to ensure that flow stats
6762 # run before re-checking the flow table.)
6763 AT_CHECK([ovs-appctl netdev-dummy/receive br0 0021853763af0026b98cb0f908004500003c2e2440004006465dac11370dac11370b828b0016751e267b00000000a00216d017360000020405b40402080a2d25085f0000000001030307])
6764 AT_CHECK([ovs-appctl time/warp 1000 && ovs-appctl time/warp 1000], [0], [warped
6767 AT_CHECK([ovs-appctl revalidator/purge], [0])
6768 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip], [0],
6770 n_packets=1, n_bytes=74, idle_timeout=60, actions=fin_timeout(idle_timeout=5)
6772 # Check that a TCP FIN packet does change the timeout.
6773 AT_CHECK([ovs-appctl netdev-dummy/receive br0 0021853763af0026b98cb0f90800451000342e3e40004006463bac11370dac11370b828b0016751e319dfc96399b801100717ae800000101080a2d250a9408579588])
6774 AT_CHECK([ovs-appctl time/warp 1000 && ovs-appctl time/warp 1000], [0], [warped
6777 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip], [0],
6779 n_packets=2, n_bytes=140, idle_timeout=5, actions=fin_timeout(idle_timeout=5)
6784 AT_SETUP([ofproto-dpif - ovs-appctl dpif/dump-dps])
6785 OVS_VSWITCHD_START([add-br br1 -- set bridge br1 datapath-type=dummy])
6786 add_of_ports br0 1 2
6789 AT_CHECK([ovs-appctl dpif/dump-dps], [0], [dnl
6796 AT_SETUP([ofproto-dpif - ovs-appctl dpif/show])
6797 OVS_VSWITCHD_START([add-br br1 -- set bridge br1 datapath-type=dummy], [], [],
6798 [--dummy-numa="0,0,0,0,1,1,1,1"])
6799 add_pmd_of_ports br0 1 2
6802 AT_CHECK([ovs-appctl dpif/show | sed 's/\(dummy-pmd: \).*)/\1<cleared>)/'], [0], [dnl
6803 dummy@ovs-dummy: hit:0 missed:0
6805 br0 65534/100: (dummy-internal)
6806 p1 1/1: (dummy-pmd: <cleared>)
6807 p2 2/2: (dummy-pmd: <cleared>)
6809 br1 65534/101: (dummy-internal)
6815 AT_SETUP([ofproto-dpif - ovs-appctl dpif/dump-flows])
6816 # bump max-idle to avoid the flows being reclaimed behind us
6817 OVS_VSWITCHD_START([add-br br1 -- \
6818 set bridge br1 datapath-type=dummy fail-mode=secure -- \
6819 set Open_vSwitch . other_config:max-idle=10000], [], [],
6820 [--dummy-numa="0,0,0,0,1,1,1,1"])
6822 add_pmd_of_ports br0 2
6825 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)'])
6826 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)'])
6827 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)'])
6828 ovs-appctl revalidator/wait
6829 AT_CHECK([ovs-appctl dpif/dump-flows br0 | strip_ufid | strip_used | sort], [0], [dnl
6830 recirc_id(0),in_port(1),eth_type(0x0800),ipv4(frag=no), packets:0, bytes:0, used:never, actions:drop
6831 recirc_id(0),in_port(2),eth_type(0x0800),ipv4(frag=no), packets:0, bytes:0, used:never, actions:drop
6834 AT_CHECK([ovs-appctl dpif/dump-flows br1 | strip_ufid | strip_used | sort], [0], [dnl
6835 recirc_id(0),in_port(3),eth_type(0x0800),ipv4(frag=no), packets:0, bytes:0, used:never, actions:drop
6838 AT_CHECK([ovs-appctl dpif/dump-flows -m br0 | strip_ufid | strip_used | sort], [0], [dnl
6839 skb_priority(0/0),skb_mark(0/0),ct_state(0/0),ct_zone(0/0),ct_mark(0/0),ct_label(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
6840 skb_priority(0/0),skb_mark(0/0),ct_state(0/0),ct_zone(0/0),ct_mark(0/0),ct_label(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
6843 AT_CHECK([ovs-appctl dpif/dump-flows -m br1 | strip_ufid | strip_used | sort], [0], [dnl
6844 skb_priority(0/0),skb_mark(0/0),ct_state(0/0),ct_zone(0/0),ct_mark(0/0),ct_label(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
6850 m4_define([OFPROTO_DPIF_GET_FLOW],
6851 [AT_SETUP([ofproto-dpif - ovs-appctl dpif/get-flow$1])
6853 OVS_VSWITCHD_START([add-br br1 -- \
6854 set bridge br1 datapath-type=dummy fail-mode=secure -- \
6855 set Open_vSwitch . other_config:max-idle=10000], [], [],
6856 [m4_if([$1], [], [], [--dummy-numa="0,0,0,0,1,1,1,1"])])
6858 func=`echo -n "$1_" | cut -c 4-`
6859 add_${func}of_ports br0 1 2
6861 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)'])
6862 ovs-appctl revalidator/wait
6863 AT_CHECK([ovs-appctl dpif/dump-flows -m br0], [0], [stdout])
6865 UFID=`sed -n 's/\(ufid:[[-0-9a-fA-F]]*\).*/\1/p' stdout`
6866 AT_CHECK([ovs-appctl dpctl/get-flow $UFID], [0], [dnl
6867 recirc_id(0),in_port(1),eth_type(0x0800),ipv4(frag=no), packets:0, bytes:0, used:never, actions:drop
6873 OFPROTO_DPIF_GET_FLOW([])
6874 OFPROTO_DPIF_GET_FLOW([ - pmd])
6876 AT_SETUP([ofproto-dpif - MPLS actions that result in a userspace action])
6877 OVS_VSWITCHD_START([dnl
6878 add-port br0 p1 -- set Interface p1 type=dummy
6880 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
6881 on_exit 'kill `cat ovs-ofctl.pid`'
6883 AT_CAPTURE_FILE([ofctl_monitor.log])
6884 AT_DATA([flows.txt], [dnl
6885 dl_src=60:66:66:66:66:00 actions=push_mpls:0x8847,controller
6886 dl_src=60:66:66:66:66:01 actions=pop_mpls:0x8847,controller
6888 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
6890 dnl Packet is sent to userspace because a MPLS push or pop action is applied to
6891 dnl a packet with 2 MPLS LSEs but dpif-netdev can't handle any labels.
6893 dnl The input is a frame with two MPLS labels which tcpdump -vve shows as:
6894 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)
6895 dnl (label 20, exp 0, [S], ttl 32)
6896 dnl (tos 0x0, ttl 64, id 0, offset 0, flags [none], proto TCP (6), length 44, bad cksum 3b78 (->f978)!)
6897 dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x7744 (correct), seq 42:46, win 10000, length 4
6899 for dl_src in 00 01; do
6900 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"])
6902 sleep 1 # wait for the datapath flow installed
6903 AT_CHECK_UNQUOTED([strip_ufid < ovs-vswitchd.log | filter_flow_install | strip_used], [0], [dnl
6904 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))
6905 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))
6912 AT_SETUP([ofproto-dpif - MPLS actions that result in a drop])
6913 OVS_VSWITCHD_START([dnl
6914 add-port br0 p1 -- set Interface p1 type=dummy
6916 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
6917 on_exit 'kill `cat ovs-ofctl.pid`'
6919 AT_CAPTURE_FILE([ofctl_monitor.log])
6920 AT_DATA([flows.txt], [dnl
6921 dl_src=60:66:66:66:66:00 actions=push_mpls:0x8847,controller
6922 dl_src=60:66:66:66:66:01 actions=pop_mpls:0x8847,controller
6924 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
6926 dnl Packet is dropped because an MPLS PUSH action is applied to a packet with
6927 dnl 4 MPLS LSEs but ovs-vswtichd can only handle up to 3 MPLS LSEs and thus
6928 dnl can't determine the resulting MPLS label after MPLS push/pop actions.
6930 dnl The input is a frame with two MPLS headers which tcpdump -vve shows as:
6931 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)
6932 dnl (label 20, exp 0, ttl 32)
6933 dnl (label 20, exp 0, ttl 32)
6934 dnl (label 20, exp 0, [S], ttl 32)
6935 dnl (tos 0x0, ttl 64, id 0, offset 0, flags [none], proto TCP (6), length 44, bad cksum 3b78 (->f978)!)
6936 dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x7744 (correct), seq 42:46, win 10000, length 4
6938 for dl_src in 00 01; do
6939 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"])
6941 sleep 1 # wait for the datapath flow installed
6942 AT_CHECK_UNQUOTED([strip_ufid < ovs-vswitchd.log | filter_flow_install | strip_used], [0], [dnl
6943 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))
6944 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))
6950 AT_SETUP([ofproto-dpif - patch ports])
6951 OVS_VSWITCHD_START([add-br br1 \
6952 -- set bridge br1 datapath-type=dummy fail-mode=secure \
6953 -- add-port br1 pbr1 -- set int pbr1 type=patch options:peer=pbr0 \
6954 -- add-port br0 pbr0 -- set int pbr0 type=patch options:peer=pbr1])
6959 AT_CHECK([ovs-appctl upcall/disable-ufid], [0], [Datapath dumping tersely using UFID disabled
6961 AT_CHECK([ovs-appctl time/stop])
6962 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
6964 AT_CHECK([ovs-ofctl add-flow br0 actions=LOCAL,output:1,output:2])
6965 AT_CHECK([ovs-ofctl add-flow br1 actions=LOCAL,output:1,output:3])
6967 for i in $(seq 1 10); do
6968 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)'
6969 if [[ $i -eq 1 ]]; then
6974 for i in $(seq 1 5); do
6975 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)'
6976 if [[ $i -eq 1 ]]; then
6981 AT_CHECK([ovs-appctl time/warp 500], [0],
6984 sleep 1 # wait for log writer
6986 AT_CHECK([ovs-appctl dpif/show], [0], [dnl
6987 dummy@ovs-dummy: hit:13 missed:2
6989 br0 65534/100: (dummy-internal)
6991 pbr0 1/none: (patch: peer=pbr1)
6993 br1 65534/101: (dummy-internal)
6995 pbr1 1/none: (patch: peer=pbr0)
6998 AT_CHECK([strip_ufid < ovs-vswitchd.log | filter_flow_install | strip_used], [0], [dnl
6999 recirc_id(0),in_port(100),eth_type(0x0800),ipv4(frag=no), actions:101,3,2
7000 recirc_id(0),in_port(101),eth_type(0x0800),ipv4(frag=no), actions:100,2,3
7003 AT_CHECK([grep -e 'in_port(100).*packets:9' ovs-vswitchd.log | strip_ufid | filter_flow_dump], [0], [dnl
7004 skb_priority(0/0),skb_mark(0/0),ct_state(0/0),ct_zone(0/0),ct_mark(0/0),ct_label(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:378, used:0.0s, actions:101,3,2
7006 AT_CHECK([grep -e 'in_port(101).*packets:4' ovs-vswitchd.log | strip_ufid | filter_flow_dump], [0], [dnl
7007 skb_priority(0/0),skb_mark(0/0),ct_state(0/0),ct_zone(0/0),ct_mark(0/0),ct_label(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:168, used:0.0s, actions:100,2,3
7010 AT_CHECK([ovs-ofctl dump-ports br0 pbr0], [0], [dnl
7011 OFPST_PORT reply (xid=0x4): 1 ports
7012 port 1: rx pkts=5, bytes=210, drop=?, errs=?, frame=?, over=?, crc=?
7013 tx pkts=10, bytes=420, drop=?, errs=?, coll=?
7016 AT_CHECK([ovs-ofctl dump-ports br1 pbr1], [0], [dnl
7017 OFPST_PORT reply (xid=0x4): 1 ports
7018 port 1: rx pkts=10, bytes=420, drop=?, errs=?, frame=?, over=?, crc=?
7019 tx pkts=5, bytes=210, drop=?, errs=?, coll=?
7025 AT_SETUP([ofproto-dpif - patch ports - stack])
7026 OVS_VSWITCHD_START([add-br br1 \
7027 -- set bridge br1 datapath-type=dummy fail-mode=secure \
7028 -- add-port br1 pbr1 -- set int pbr1 type=patch options:peer=pbr0 \
7029 -- add-port br0 pbr0 -- set int pbr0 type=patch options:peer=pbr1])
7034 AT_CHECK([ovs-appctl upcall/disable-ufid], [0], [Datapath dumping tersely using UFID disabled
7036 AT_CHECK([ovs-appctl time/stop])
7037 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
7039 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"])
7040 # Try to pop from empty stack, and push and leave data to stack.
7041 AT_CHECK([ovs-ofctl add-flow br1 "ip actions=pop:OXM_OF_IPV4_DST[[0..31]],push:NXM_NX_REG1[[0..31]],LOCAL"])
7043 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)'
7045 AT_CHECK([ovs-appctl time/warp 500], [0],
7049 OVS_WAIT_UNTIL([test `grep flow_add ovs-vswitchd.log | wc -l` -ge 1])
7051 AT_CHECK([ovs-appctl dpif/show], [0], [dnl
7052 dummy@ovs-dummy: hit:0 missed:1
7054 br0 65534/100: (dummy-internal)
7056 pbr0 1/none: (patch: peer=pbr1)
7058 br1 65534/101: (dummy-internal)
7060 pbr1 1/none: (patch: peer=pbr0)
7063 AT_CHECK([strip_ufid < ovs-vswitchd.log | filter_flow_install | strip_used], [0], [dnl
7064 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
7067 AT_CHECK([grep -e '|nx_match|WARN|' ovs-vswitchd.log | sed "s/^.*|WARN|//"], [0], [dnl
7068 Failed to pop from an empty stack. On flow
7071 OVS_VSWITCHD_STOP(["/Failed to pop from an empty stack/d"])
7074 AT_SETUP([ofproto-dpif - port duration])
7075 OVS_VSWITCHD_START([set Bridge br0 protocols=OpenFlow13])
7076 add_of_ports br0 1 2
7078 ovs-appctl time/stop
7079 ovs-appctl time/warp 10000
7081 AT_CHECK([ovs-ofctl -O openflow13 dump-ports br0], [0], [stdout])
7082 AT_CHECK([sed -n 's/=[[0-9]][[0-9]]\(\.[[0-9]][[0-9]]*\)\{0,1\}s/=?s/p' stdout], [0],
7091 dnl ----------------------------------------------------------------------
7092 AT_BANNER([ofproto-dpif -- megaflows])
7094 AT_SETUP([ofproto-dpif megaflow - port classification])
7096 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
7097 add_of_ports br0 1 2
7098 AT_DATA([flows.txt], [dnl
7099 table=0 in_port=1 actions=output(2)
7101 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
7102 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)'])
7104 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)'])
7106 AT_CHECK([filter_flow_install < ovs-vswitchd.log | strip_xout], [0], [dnl
7107 recirc_id(0),in_port(1),eth_type(0x0800),ipv4(frag=no), actions: <del>
7112 AT_SETUP([ofproto-dpif megaflow - L2 classification])
7114 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
7115 add_of_ports br0 1 2
7116 AT_DATA([flows.txt], [dnl
7117 table=0 in_port=1,dl_src=50:54:00:00:00:09 actions=output(2)
7119 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
7120 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)'])
7121 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)'])
7123 AT_CHECK([filter_flow_install < ovs-vswitchd.log | strip_xout], [0], [dnl
7124 recirc_id(0),in_port(1),eth(src=50:54:00:00:00:09),eth_type(0x0800),ipv4(frag=no), actions: <del>
7125 recirc_id(0),in_port(1),eth(src=50:54:00:00:00:0b),eth_type(0x0800),ipv4(frag=no), actions: <del>
7130 AT_SETUP([ofproto-dpif megaflow - L3 classification])
7132 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
7133 add_of_ports br0 1 2
7134 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], [])
7135 AT_DATA([flows.txt], [dnl
7136 table=0 in_port=1,icmp,nw_src=10.0.0.4 actions=output(2)
7138 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
7139 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)'])
7140 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)'])
7142 AT_CHECK([filter_flow_install < ovs-vswitchd.log | strip_xout], [0], [dnl
7143 recirc_id(0),in_port(1),eth_type(0x0800),ipv4(src=10.0.0.2/255.255.255.252,frag=no), actions: <del>
7144 recirc_id(0),in_port(1),eth_type(0x0800),ipv4(src=10.0.0.4,proto=1,frag=no), actions: <del>
7149 AT_SETUP([ofproto-dpif megaflow - IPv6 classification])
7151 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
7152 add_of_ports br0 1 2
7153 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], [])
7154 AT_DATA([flows.txt], [dnl
7155 table=0 in_port=1,ipv6,ipv6_src=2001:db8:3c4d:1:2:3:4:5 actions=output(2)
7157 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
7158 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)'])
7159 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)'])
7161 AT_CHECK([filter_flow_install < ovs-vswitchd.log | strip_xout], [0], [dnl
7162 recirc_id(0),in_port(1),eth_type(0x86dd),ipv6(src=2001:db8:3c4d:1:2:3:4:5,frag=no), actions: <del>
7163 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>
7168 AT_SETUP([ofproto-dpif megaflow - L4 classification])
7170 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
7171 add_of_ports br0 1 2
7172 AT_DATA([flows.txt], [dnl
7173 table=0 in_port=1,icmp,icmp_type=8 actions=output(2)
7175 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
7176 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)'])
7178 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)'])
7180 AT_CHECK([filter_flow_install < ovs-vswitchd.log | strip_xout], [0], [dnl
7181 recirc_id(0),in_port(1),eth_type(0x0800),ipv4(proto=1,frag=no),icmp(type=8), actions: <del>
7186 m4_define([OFPROTO_DPIF_MEGAFLOW_NORMAL],
7187 [AT_SETUP([ofproto-dpif megaflow - normal$1])
7188 OVS_VSWITCHD_START([], [], [], [m4_if([$1], [], [], [--dummy-numa="0,0,0,0,1,1,1,1"])])
7189 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
7190 func=`echo -n "$1_" | cut -c 4-`
7191 add_${func}of_ports br0 1 2
7192 AT_CHECK([ovs-ofctl add-flow br0 action=normal])
7193 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)'])
7194 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)'])
7196 AT_CHECK([filter_flow_install < ovs-vswitchd.log | strip_xout], [0], [dnl
7197 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>
7198 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>
7203 OFPROTO_DPIF_MEGAFLOW_NORMAL([])
7204 OFPROTO_DPIF_MEGAFLOW_NORMAL([ - pmd])
7206 AT_SETUP([ofproto-dpif megaflow - mpls])
7208 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
7209 add_of_ports br0 1 2
7210 AT_DATA([flows.txt], [dnl
7211 table=0 dl_src=50:54:00:00:00:09 actions=push_mpls:0x8847,2
7212 table=0 dl_src=50:54:00:00:00:0b actions=pop_mpls:0x0800,2
7214 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
7215 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)'])
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:0a),eth_type(0x8847),mpls(label=11,tc=3,ttl=64,bos=1)'])
7218 AT_CHECK([filter_flow_install < ovs-vswitchd.log | strip_xout_keep_actions], [0], [dnl
7219 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
7220 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
7225 # CHECK_MEGAFLOW_NETFLOW(LOOPBACK_ADDR)
7226 m4_define([CHECK_MEGAFLOW_NETFLOW],
7228 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
7229 add_of_ports br0 1 2
7231 dnl NetFlow configuration disables wildcarding relevant fields
7232 on_exit 'kill `cat test-netflow.pid`'
7233 AT_CHECK([ovstest test-netflow --log-file --detach --no-chdir --pidfile 0:$1 > netflow.log], [0], [], [ignore])
7234 AT_CAPTURE_FILE([netflow.log])
7235 PARSE_LISTENING_PORT([test-netflow.log], [NETFLOW_PORT])
7237 set Bridge br0 netflow=@nf -- \
7238 --id=@nf create NetFlow targets=\"$1:$NETFLOW_PORT\" \
7239 engine_id=1 engine_type=2 active_timeout=30 add-id-to-interface=false
7241 AT_CHECK([ovs-ofctl add-flow br0 action=normal])
7242 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)'])
7243 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)'])
7245 AT_CHECK([filter_flow_install < ovs-vswitchd.log | strip_xout], [0], [dnl
7246 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>
7247 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>
7249 OVS_APP_EXIT_AND_WAIT([test-netflow])
7252 AT_SETUP([ofproto-dpif megaflow - netflow - IPv4 collector])
7253 CHECK_MEGAFLOW_NETFLOW([127.0.0.1], [IPv4])
7256 AT_SETUP([ofproto-dpif megaflow - netflow - IPv6 collector])
7257 AT_SKIP_IF([test $HAVE_IPV6 = no])
7258 CHECK_MEGAFLOW_NETFLOW([[[::1]]], [IPv6])
7261 m4_define([OFPROTO_DPIF_MEGAFLOW_NORMAL_ACB_BOND],
7262 [AT_SETUP([ofproto-dpif megaflow - normal, active-backup bonding - $1])
7264 [add-port br0 p1 -- set Interface p1 type=$1 ofport_request=1 -- \
7265 add-bond br0 bond0 p2 p3 bond_mode=active-backup -- \
7266 set interface p2 type=$1 ofport_request=2 -- \
7267 set interface p3 type=$1 ofport_request=3], [], [],
7268 [m4_if([$1], [dummy-pmd], [--dummy-numa="0,0,0,0,1,1,1,1"], [])])
7269 AT_CHECK([ovs-appctl netdev-dummy/set-admin-state up], 0, [OK
7271 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
7273 AT_CHECK([ovs-ofctl add-flow br0 action=normal])
7274 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)'])
7275 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)'])
7277 AT_CHECK([filter_flow_install < ovs-vswitchd.log | strip_xout], [0], [dnl
7278 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>
7279 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>
7284 OFPROTO_DPIF_MEGAFLOW_NORMAL_ACB_BOND([dummy])
7285 OFPROTO_DPIF_MEGAFLOW_NORMAL_ACB_BOND([dummy-pmd])
7287 AT_SETUP([ofproto-dpif megaflow - normal, balance-slb bonding])
7289 [add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1 -- \
7290 add-bond br0 bond0 p2 p3 bond_mode=balance-slb -- \
7291 set interface p2 type=dummy ofport_request=2 -- \
7292 set interface p3 type=dummy ofport_request=3])
7293 AT_CHECK([ovs-appctl netdev-dummy/set-admin-state up], 0, [OK
7295 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
7297 AT_CHECK([ovs-ofctl add-flow br0 action=normal])
7298 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)'])
7299 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 AT_CHECK([filter_flow_install < ovs-vswitchd.log | strip_xout], [0], [dnl
7302 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>
7303 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>
7308 AT_SETUP([ofproto-dpif megaflow - normal, balance-tcp bonding])
7309 # Create bond0 on br0 with interfaces p0 and p1
7310 # and bond1 on br1 with interfaces p2 and p3
7311 # with p0 patched to p2 and p1 patched to p3.
7313 [add-bond br0 bond0 p0 p1 bond_mode=balance-tcp lacp=active \
7314 other-config:lacp-time=fast \
7315 other-config:bond-rebalance-interval=0 -- \
7316 set interface p0 type=patch options:peer=p2 ofport_request=1 -- \
7317 set interface p1 type=patch options:peer=p3 ofport_request=2 -- \
7319 set bridge br1 other-config:hwaddr=aa:66:aa:66:00:00 -- \
7320 set bridge br1 datapath-type=dummy other-config:datapath-id=1234 \
7321 fail-mode=secure -- \
7322 add-bond br1 bond1 p2 p3 bond_mode=balance-tcp lacp=active \
7323 other-config:lacp-time=fast \
7324 other-config:bond-rebalance-interval=0 -- \
7325 set interface p2 type=patch options:peer=p0 ofport_request=3 -- \
7326 set interface p3 type=patch options:peer=p1 ofport_request=4 --])
7328 AT_CHECK([ovs-appctl netdev-dummy/set-admin-state up], 0, [OK
7330 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
7332 AT_CHECK([ovs-ofctl add-flow br0 action=normal])
7333 AT_CHECK([ovs-ofctl add-flow br1 action=normal])
7334 ovs-appctl time/stop
7335 ovs-appctl time/warp 5000
7336 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)'])
7337 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)'])
7339 AT_CHECK([filter_flow_install < ovs-vswitchd.log | strip_xout], [0], [dnl
7340 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>
7341 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>
7346 AT_SETUP([ofproto-dpif megaflow - resubmit port action])
7348 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
7349 add_of_ports br0 1 2
7350 AT_DATA([flows.txt], [dnl
7351 table=0 in_port=1,ip actions=resubmit(90)
7352 table=0 in_port=90,dl_src=50:54:00:00:00:09 actions=output(2)
7354 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
7355 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)'])
7356 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)'])
7358 AT_CHECK([filter_flow_install < ovs-vswitchd.log | strip_xout], [0], [dnl
7359 recirc_id(0),in_port(1),eth(src=50:54:00:00:00:09),eth_type(0x0800),ipv4(frag=no), actions: <del>
7360 recirc_id(0),in_port(1),eth(src=50:54:00:00:00:0b),eth_type(0x0800),ipv4(frag=no), actions: <del>
7365 AT_SETUP([ofproto-dpif megaflow - resubmit table action])
7367 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
7368 add_of_ports br0 1 2
7369 AT_DATA([flows.txt], [dnl
7370 table=0 in_port=1,ip actions=resubmit(,1)
7371 table=1 dl_src=50:54:00:00:00:09 actions=output(2)
7373 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
7374 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)'])
7375 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=
7376 1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
7378 AT_CHECK([filter_flow_install < ovs-vswitchd.log | strip_xout], [0], [dnl
7379 recirc_id(0),in_port(1),eth(src=50:54:00:00:00:09),eth_type(0x0800),ipv4(frag=no), actions: <del>
7380 recirc_id(0),in_port(1),eth(src=50:54:00:00:00:0b),eth_type(0x0800),ipv4(frag=no), actions: <del>
7385 AT_SETUP([ofproto-dpif megaflow - goto_table action])
7387 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
7388 add_of_ports br0 1 2
7389 AT_DATA([flows.txt], [dnl
7390 table=0 in_port=1,ip actions=goto_table(1)
7391 table=1 dl_src=50:54:00:00:00:09 actions=output(2)
7393 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flows br0 flows.txt])
7394 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)'])
7395 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)'])
7397 AT_CHECK([filter_flow_install < ovs-vswitchd.log | strip_xout], [0], [dnl
7398 recirc_id(0),in_port(1),eth(src=50:54:00:00:00:09),eth_type(0x0800),ipv4(frag=no), actions: <del>
7399 recirc_id(0),in_port(1),eth(src=50:54:00:00:00:0b),eth_type(0x0800),ipv4(frag=no), actions: <del>
7404 AT_SETUP([ofproto-dpif megaflow - mirroring, select_all])
7405 AT_KEYWORDS([mirror mirrors mirroring])
7407 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
7408 add_of_ports br0 1 2 3
7410 set Bridge br0 mirrors=@m --\
7411 --id=@p3 get Port p3 --\
7412 --id=@m create Mirror name=mymirror select_all=true output_port=@p3
7414 AT_DATA([flows.txt], [dnl
7415 in_port=1 actions=output:2
7417 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
7418 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)'])
7420 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)'])
7422 AT_CHECK([filter_flow_install < ovs-vswitchd.log | strip_xout], [0], [dnl
7423 recirc_id(0),in_port(1),eth_type(0x0800),ipv4(frag=no), actions: <del>
7428 AT_SETUP([ofproto-dpif megaflow - mirroring, select_vlan])
7430 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
7431 add_of_ports br0 1 2 3
7433 set Bridge br0 mirrors=@m --\
7434 --id=@p2 get Port p2 -- --id=@p3 get Port p3 --\
7435 --id=@m create Mirror name=mymirror select_all=true select_vlan=11 output_port=@p3
7437 AT_DATA([flows.txt], [dnl
7438 in_port=1 actions=output:2
7440 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
7441 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))'])
7442 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)'])
7444 AT_CHECK([filter_flow_install < ovs-vswitchd.log | strip_xout], [0], [dnl
7445 recirc_id(0),in_port(1),eth_type(0x0800),ipv4(frag=no), actions: <del>
7446 recirc_id(0),in_port(1),eth_type(0x8100),vlan(vid=11,pcp=7/0x0),encap(eth_type(0x0800),ipv4(frag=no)), actions: <del>
7451 AT_SETUP([ofproto-dpif megaflow - move action])
7453 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
7454 add_of_ports br0 1 2
7455 AT_DATA([flows.txt], [dnl
7456 table=0 in_port=1 ip,actions=move:NXM_OF_IP_SRC[[]]->NXM_NX_REG0[[]],resubmit(90)
7457 table=0 in_port=90 ip,actions=move:NXM_NX_REG0[[]]->NXM_NX_REG1[[]],resubmit(91)
7458 table=0 in_port=91 reg0=0x0a000002,actions=output(2)
7460 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
7461 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)'])
7462 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)'])
7464 AT_CHECK([filter_flow_install < ovs-vswitchd.log | strip_xout], [0], [dnl
7465 recirc_id(0),in_port(1),eth_type(0x0800),ipv4(src=10.0.0.2,frag=no), actions: <del>
7466 recirc_id(0),in_port(1),eth_type(0x0800),ipv4(src=10.0.0.4,frag=no), actions: <del>
7471 AT_SETUP([ofproto-dpif megaflow - push action])
7473 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
7474 add_of_ports br0 1 2
7475 AT_DATA([flows.txt], [dnl
7476 table=0 in_port=1 ip,actions=push:NXM_OF_IP_SRC[[]],output(2)
7478 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
7479 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)'])
7480 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)'])
7482 AT_CHECK([filter_flow_install < ovs-vswitchd.log | strip_xout], [0], [dnl
7483 recirc_id(0),in_port(1),eth_type(0x0800),ipv4(src=10.0.0.2,frag=no), actions: <del>
7484 recirc_id(0),in_port(1),eth_type(0x0800),ipv4(src=10.0.0.4,frag=no), actions: <del>
7489 AT_SETUP([ofproto-dpif megaflow - learning])
7491 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
7492 add_of_ports br0 1 2
7493 AT_DATA([flows.txt], [dnl
7494 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
7496 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
7497 ovs-appctl time/stop
7498 # We send each packet twice because the first packet in each flow causes the
7499 # flow table to change and thus revalidations, which (depending on timing)
7500 # can keep a megaflow from being installed. The revalidations are done by
7501 # the second iteration, allowing the flows to be installed.
7503 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)'])
7504 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)'])
7505 ovs-appctl time/warp 100
7508 dnl The original flow is missing due to a revalidation.
7509 AT_CHECK([filter_flow_install < ovs-vswitchd.log | strip_xout], [0], [dnl
7510 recirc_id(0),in_port(1),eth(src=50:54:00:00:00:09),eth_type(0x0800),ipv4(frag=no), actions: <del>
7511 recirc_id(0),in_port(1),eth(src=50:54:00:00:00:0b),eth_type(0x0800),ipv4(frag=no), actions: <del>
7516 AT_SETUP([ofproto-dpif megaflow - tunnels])
7518 [add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1])
7519 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
7520 AT_CHECK([ovs-vsctl add-port br0 p2 -- set Interface p2 type=gre \
7521 options:remote_ip=1.1.1.1 ofport_request=2 options:key=flow])
7522 AT_CHECK([ovs-vsctl add-port br0 p3 -- set Interface p3 type=dummy \
7524 AT_CHECK([ovs-vsctl add-port br0 p4 -- set Interface p4 type=gre \
7525 options:remote_ip=1.1.1.2 options:tos=inherit options:ttl=inherit \
7526 ofport_request=4 options:key=flow])
7527 AT_DATA([flows.txt], [dnl
7528 in_port=1,actions=output(2)
7529 in_port=3,actions=output(4)
7531 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
7532 dnl ECN bits are always copied out, but don't use 0x3 (CE), since that
7533 dnl will cause the packet to be dropped.
7534 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)'])
7536 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)'])
7537 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)'])
7539 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)'])
7541 AT_CHECK([filter_flow_install < ovs-vswitchd.log | strip_xout], [0], [dnl
7542 recirc_id(0),in_port(1),eth_type(0x0800),ipv4(tos=0xfd/0x3,frag=no), actions: <del>
7543 recirc_id(0),in_port(3),eth_type(0x0800),ipv4(tos=0x1,ttl=64,frag=no), actions: <del>
7544 recirc_id(0),in_port(3),eth_type(0x0800),ipv4(tos=0xfd,ttl=128,frag=no), actions: <del>
7549 AT_SETUP([ofproto-dpif megaflow - dec_ttl])
7551 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
7552 add_of_ports br0 1 2
7553 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], [])
7554 AT_DATA([flows.txt], [dnl
7555 table=0 in_port=1,icmp,nw_src=10.0.0.4 actions=dec_ttl,output(2)
7557 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
7558 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)'])
7559 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)'])
7561 AT_CHECK([filter_flow_install < ovs-vswitchd.log | strip_xout], [0], [dnl
7562 recirc_id(0),in_port(1),eth_type(0x0800),ipv4(src=10.0.0.2/255.255.255.252,frag=no), actions: <del>
7563 recirc_id(0),in_port(1),eth_type(0x0800),ipv4(src=10.0.0.4,proto=1,ttl=64,frag=no), actions: <del>
7568 AT_SETUP([ofproto-dpif megaflow - set dl_dst])
7570 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
7571 add_of_ports br0 1 2
7572 AT_DATA([flows.txt], [dnl
7573 table=0 in_port=1 actions=mod_dl_dst(50:54:00:00:00:0a),output(2)
7575 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
7576 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)'])
7577 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)'])
7579 dnl The first packet is essentially a no-op, as the new destination MAC is the
7580 dnl same as the original. The second entry actually updates the destination
7582 AT_CHECK([strip_ufid < ovs-vswitchd.log | filter_flow_install | strip_used], [0], [dnl
7583 recirc_id(0),in_port(1),eth(dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(frag=no), actions:2
7584 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
7589 m4_define([OFPROTO_DPIF_MEGAFLOW_DISABLED],
7590 [AT_SETUP([ofproto-dpif megaflow - disabled$1])
7591 OVS_VSWITCHD_START([], [], [], [m4_if([$1], [], [], [--dummy-numa="0,0,0,0,1,1,1,1"])])
7592 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
7593 func=`echo -n "$1_" | cut -c 4-`
7594 add_${func}of_ports br0 1 2
7595 AT_DATA([flows.txt], [dnl
7596 table=0 in_port=1,ip,nw_dst=10.0.0.1 actions=output(2)
7597 table=0 in_port=1,ip,nw_dst=10.0.0.3 actions=drop
7599 AT_CHECK([ovs-appctl upcall/disable-megaflows], [0], [megaflows disabled
7601 AT_CHECK([ovs-appctl upcall/disable-ufid], [0], [Datapath dumping tersely using UFID disabled
7603 AT_CHECK([ovs-appctl vlog/set dpif_netdev:dbg], [0], [], [])
7604 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
7605 for i in 1 2 3 4; do
7606 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)'])
7607 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)'])
7608 if [[ $i -eq 1 ]]; then
7613 AT_CHECK([strip_ufid < ovs-vswitchd.log | filter_flow_install | strip_used], [0], [dnl
7614 skb_priority(0),skb_mark(0),ct_state(-new-est-rel-rpl-inv-trk-snat-dnat),ct_zone(0),ct_mark(0),ct_label(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
7615 skb_priority(0),skb_mark(0),ct_state(-new-est-rel-rpl-inv-trk-snat-dnat),ct_zone(0),ct_mark(0),ct_label(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
7617 AT_CHECK([strip_ufid < ovs-vswitchd.log | filter_flow_dump | grep 'packets:3'], [0], [dnl
7618 skb_priority(0),skb_mark(0),ct_state(0/0xff),ct_zone(0),ct_mark(0),ct_label(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:126, used:0.0s, actions:2
7619 skb_priority(0),skb_mark(0),ct_state(0/0xff),ct_zone(0),ct_mark(0),ct_label(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:126, used:0.0s, actions:drop
7624 OFPROTO_DPIF_MEGAFLOW_DISABLED([])
7625 OFPROTO_DPIF_MEGAFLOW_DISABLED([ - pmd])
7627 AT_SETUP([ofproto-dpif - datapath port number change])
7628 OVS_VSWITCHD_START([set Bridge br0 fail-mode=standalone])
7631 # Trace a flow that should output to p1.
7632 AT_CHECK([ovs-appctl ofproto/trace br0 in_port=LOCAL,dl_src=10:20:30:40:50:60],
7634 AT_CHECK([tail -1 stdout], [0], [Datapath actions: 1
7637 # Change p1's port number to 5.
7638 AT_CHECK([ovs-appctl dpif-dummy/change-port-number ovs-dummy p1 5])
7640 # Trace a flow that should output to p1 in its new location.
7641 AT_CHECK([ovs-appctl ofproto/trace br0 in_port=LOCAL,dl_src=10:20:30:40:50:60],
7643 AT_CHECK([tail -1 stdout], [0], [Datapath actions: 5
7648 # Tests the bundling with various bfd and cfm configurations.
7649 AT_SETUP([ofproto - bundle with variable bfd/cfm config])
7650 OVS_VSWITCHD_START([add-br br1 -- set bridge br1 datapath-type=dummy -- \
7651 add-bond br0 br0bond p0 p2 bond-mode=active-backup -- \
7652 add-bond br1 br1bond p1 p3 bond-mode=active-backup -- \
7653 set Interface p1 type=patch options:peer=p0 ofport_request=2 -- \
7654 set Interface p3 type=patch options:peer=p2 ofport_request=4 -- \
7655 set Interface p0 type=patch options:peer=p1 ofport_request=1 -- \
7656 set Interface p2 type=patch options:peer=p3 ofport_request=3 -- \
7657 set Interface p0 bfd:enable=true bfd:min_tx=300 bfd:min_rx=300 -- \
7658 set Interface p0 cfm_mpid=1 -- \
7659 set Interface p1 bfd:enable=true bfd:min_tx=500 bfd:min_rx=500])
7661 ovs-appctl time/stop
7662 # advance the clock to stablize everything.
7663 ovs-appctl time/warp 5000 100
7664 # cfm/show should show 'recv' fault.
7665 AT_CHECK([ovs-appctl cfm/show | sed -n '/^.*fault:.*/p'], [0], [dnl
7668 # bfd/show should show 'up'.
7669 AT_CHECK([ovs-appctl bfd/show | sed -n '/^.*Session State:.*/p'], [0], [dnl
7670 Local Session State: up
7671 Remote Session State: up
7672 Local Session State: up
7673 Remote Session State: up
7675 # bond/show should show 'may-enable: true' for all slaves.
7676 AT_CHECK([ovs-appctl bond/show | sed -n '/^.*may_enable:.*/p'], [0], [dnl
7683 # now disable the bfd on p1.
7684 AT_CHECK([ovs-vsctl set Interface p1 bfd:enable=false])
7685 # advance the clock to stablize everything.
7686 ovs-appctl time/warp 5000 100
7687 # cfm/show should show 'recv' fault.
7688 AT_CHECK([ovs-appctl cfm/show | sed -n '/^.*fault:.*/p'], [0], [dnl
7691 # bfd/show should show 'down'.
7692 AT_CHECK([ovs-appctl bfd/show | sed -n '/^.*Session State:.*/p'], [0], [dnl
7693 Local Session State: down
7694 Remote Session State: down
7696 # bond/show should show 'may-enable: false' for p0.
7697 AT_CHECK([ovs-appctl bond/show br0bond | sed -n '/^.*may_enable:.*/p'], [0], [dnl
7702 # now enable the bfd on p1 and disable bfd on p0.
7703 AT_CHECK([ovs-vsctl set Interface p1 bfd:enable=true])
7704 AT_CHECK([ovs-vsctl set Interface p0 bfd:enable=false])
7705 # advance the clock to stablize everything.
7706 ovs-appctl time/warp 5000 100
7707 # cfm/show should show 'recv' fault.
7708 AT_CHECK([ovs-appctl cfm/show | sed -n '/^.*fault:.*/p'], [0], [dnl
7711 # bfd/show should show 'down'.
7712 AT_CHECK([ovs-appctl bfd/show | sed -n '/^.*Session State:.*/p'], [0], [dnl
7713 Local Session State: down
7714 Remote Session State: down
7716 # bond/show should show 'may-enable: false' for p0 and p1.
7717 AT_CHECK([ovs-appctl bond/show | sed -n '/^.*may_enable:.*/p'], [0], [dnl
7727 AT_SETUP([ofproto-dpif - ofproto-dpif-monitor 1])
7728 OVS_VSWITCHD_START([add-port br0 p0 -- set interface p0 type=gre options:remote_ip=1.2.3.4])
7731 AT_CHECK([ovs-vsctl set interface p0 bfd:enable=true])
7733 OVS_WAIT_UNTIL([grep "monitor thread created" ovs-vswitchd.log])
7734 # disable bfd on p0.
7735 AT_CHECK([ovs-vsctl set interface p0 bfd:enable=false])
7737 OVS_WAIT_UNTIL([grep "monitor thread terminated" ovs-vswitchd.log])
7738 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])
7741 AT_CHECK([ovs-vsctl set interface p0 cfm_mpid=10])
7743 OVS_WAIT_UNTIL([grep "monitor thread created" ovs-vswitchd.log])
7744 # disable cfm on p0.
7745 AT_CHECK([ovs-vsctl remove interface p0 cfm_mpid 10])
7747 OVS_WAIT_UNTIL([grep "monitor thread terminated" ovs-vswitchd.log])
7748 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])
7750 # enable both bfd and cfm on p0.
7751 AT_CHECK([ovs-vsctl set interface p0 bfd:enable=true cfm_mpid=10])
7753 OVS_WAIT_UNTIL([grep "monitor thread created" ovs-vswitchd.log])
7754 # disable bfd on p0.
7755 AT_CHECK([ovs-vsctl set interface p0 bfd:enable=false])
7756 # check log, there should not be the log of thread terminated.
7757 AT_CHECK([sed -n "s/^.*|ofproto_dpif_monitor(monitor[[0-9]]*)|INFO|\(.* terminated\)$/\1/p" ovs-vswitchd.log], [0], [dnl
7759 # reenable bfd on p0.
7760 AT_CHECK([ovs-vsctl set interface p0 bfd:enable=true])
7761 # check log, should still be on log of thread created.
7762 AT_CHECK([sed -n "s/^.*|ofproto_dpif_monitor(monitor[[0-9]]*)|INFO|\(.* created\)$/\1/p" ovs-vswitchd.log], [0], [dnl
7763 monitor thread created
7765 # disable bfd and cfm together.
7766 AT_CHECK([ovs-vsctl set interface p0 bfd:enable=false -- remove interface p0 cfm_mpid 10])
7768 OVS_WAIT_UNTIL([grep "monitor thread terminated" ovs-vswitchd.log])
7773 # this test helps avoid the deadlock between the main thread and monitor thread.
7774 AT_SETUP([ofproto-dpif - ofproto-dpif-monitor 2])
7777 for i in `seq 1 199`
7779 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])
7785 AT_BANNER([ofproto-dpif - flow translation resource limits])
7787 dnl Resubmits to later tables do not count against the depth limit, so we
7788 dnl can do 99 of them even though the maximum depth is 64.
7789 AT_SETUP([ofproto-dpif - forward resubmit])
7791 (for i in `seq 0 99`; do
7793 echo "table=$i, actions=resubmit(,$j)"
7795 echo "table=100, actions=local") > flows
7796 AT_CHECK([ovs-ofctl add-flows br0 flows])
7797 AT_CHECK([ovs-appctl -vpoll_loop:off ofproto/trace br0 'eth_dst=ff:ff:ff:ff:ff:ff'],
7799 AT_CHECK([tail -1 stdout], [0], [Datapath actions: 100
7804 dnl Resubmits to the same or an earlier table count against the depth limit,
7805 dnl so only 64 of them are allowed.
7806 AT_SETUP([ofproto-dpif - backward resubmit])
7808 (echo "table=0, actions=resubmit(,66)"
7809 for i in `seq 2 66`; do
7811 echo "table=$i, actions=resubmit(,$j)"
7813 echo "table=1, actions=local") > flows
7814 AT_CHECK([ovs-ofctl add-flows br0 flows])
7815 AT_CHECK([ovs-appctl -vpoll_loop:off ofproto/trace br0 'eth_dst=ff:ff:ff:ff:ff:ff'],
7817 AT_CHECK([tail -1 stdout], [0],
7818 [Translation failed (Recursion too deep), packet is dropped.
7820 AT_CHECK([grep -c 'over max translation depth 64' stdout],
7823 OVS_VSWITCHD_STOP(["/resubmit actions recursed/d"])
7826 AT_SETUP([ofproto-dpif - infinite resubmit])
7828 AT_CHECK([ovs-ofctl add-flow br0 actions=resubmit:1,resubmit:2,output:3])
7829 AT_CHECK([ovs-appctl -vpoll_loop:off ofproto/trace br0 'eth_dst=ff:ff:ff:ff:ff:ff'],
7831 AT_CHECK([tail -1 stdout], [0],
7832 [Translation failed (Recursion too deep), packet is dropped.
7834 AT_CHECK([grep -c 'over max translation depth 64' stdout],
7837 OVS_VSWITCHD_STOP(["/resubmit actions recursed/d"])
7840 AT_SETUP([ofproto-dpif - exponential resubmit chain])
7843 (for i in `seq 1 64`; do
7845 echo "in_port=$i, actions=resubmit:$j, resubmit:$j, local"
7847 echo "in_port=65, actions=local") > flows
7848 AT_CHECK([ovs-ofctl add-flows br0 flows])
7849 AT_CHECK([ovs-appctl -vpoll_loop:off ofproto/trace br0 'in_port=1'], [0], [stdout])
7850 AT_CHECK([tail -1 stdout], [0],
7851 [Translation failed (Too many resubmits), packet is dropped.
7853 AT_CHECK([grep -c 'over 4096 resubmit actions' stdout], [0], [1
7855 OVS_VSWITCHD_STOP(["/over.*resubmit actions/d"])
7858 AT_SETUP([ofproto-dpif - too many output actions])
7861 (for i in `seq 1 12`; do
7863 echo "in_port=$i, actions=resubmit:$j, resubmit:$j, local"
7865 echo "in_port=13, actions=local,local,local,local,local,local,local,local") > flows
7866 AT_CHECK([ovs-ofctl add-flows br0 flows])
7867 AT_CHECK([ovs-appctl -vpoll_loop:off ofproto/trace br0 'in_port=1'], [0], [stdout])
7868 AT_CHECK([grep -c -e '- Uses action(s) not supported by datapath' stdout],
7871 AT_CHECK([grep -c 'resubmits yielded over 64 kB of actions' stdout], [0], [1
7873 OVS_VSWITCHD_STOP(["/resubmits yielded over 64 kB of actions/d"])
7876 AT_SETUP([ofproto-dpif - stack too deep])
7879 (for i in `seq 1 12`; do
7881 echo "in_port=$i, actions=resubmit:$j, resubmit:$j, local"
7883 push="push:NXM_NX_REG0[[]]"
7884 echo "in_port=13, actions=$push,$push,$push,$push,$push,$push,$push,$push") > flows
7885 AT_CHECK([ovs-ofctl add-flows br0 flows])
7886 AT_CHECK([ovs-appctl -vpoll_loop:off ofproto/trace br0 'in_port=1'], [0], [stdout])
7887 AT_CHECK([tail -1 stdout], [0],
7888 [Translation failed (Stack too deep), packet is dropped.
7890 AT_CHECK([grep -c 'resubmits yielded over 64 kB of stack' stdout], [0], [1
7892 OVS_VSWITCHD_STOP(["/resubmits yielded over 64 kB of stack/d"])
7896 AT_SETUP([ofproto-dpif packet-out controller])
7898 add_of_ports br0 1 2
7900 AT_CHECK([ovs-ofctl add-flow br0 'dl_dst=50:54:00:00:00:0a actions=controller'])
7902 AT_CAPTURE_FILE([ofctl_monitor.log])
7903 AT_CHECK([ovs-ofctl monitor br0 65534 invalid_ttl -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
7906 AT_CHECK([ovs-ofctl -O OpenFlow13 packet-out br0 CONTROLLER controller '50540000000a5054000000091234'])
7909 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
7910 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
7911 NXT_PACKET_IN (xid=0x0): total_len=14 in_port=CONTROLLER (via action) data_len=14 (unbuffered)
7912 vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,dl_type=0x1234
7914 NXT_PACKET_IN (xid=0x0): total_len=14 in_port=CONTROLLER (via action) data_len=14 (unbuffered)
7915 vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,dl_type=0x1234
7917 NXT_PACKET_IN (xid=0x0): total_len=14 in_port=CONTROLLER (via action) data_len=14 (unbuffered)
7918 vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,dl_type=0x1234
7921 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
7922 dl_dst=50:54:00:00:00:0a actions=CONTROLLER:65535
7926 (echo "OFPST_TABLE reply (OF1.3) (xid=0x2):
7928 active=1, lookup=0, matched=0
7931 active=0, lookup=0, matched=0
7933 for i in `seq 2 253`; do
7934 printf ' table %d: ditto\n' $i
7936 AT_CHECK([ovs-ofctl -O OpenFlow13 dump-tables br0 ], [0], [expout])
7941 AT_SETUP([ofproto-dpif packet-out controller (patch port)])
7944 add-port br0 p1 -- \
7945 set interface p1 type=patch options:peer=p2 -- \
7947 set bridge br1 datapath-type=dummy -- \
7948 set bridge br1 fail-mode=secure -- \
7949 set bridge br1 protocols='[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13]' -- \
7950 add-port br1 p2 -- \
7951 set interface p2 type=patch options:peer=p1 --])
7953 AT_CAPTURE_FILE([ofctl_monitor.log])
7954 AT_CHECK([ovs-ofctl monitor br1 65534 invalid_ttl -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
7957 AT_CHECK([ovs-ofctl -O OpenFlow13 packet-out br0 CONTROLLER output:1 '50540000000a5054000000091234'])
7960 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=14 in_port=1 (via no_match) data_len=14 (unbuffered)
7963 vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,dl_type=0x1234
7965 NXT_PACKET_IN (xid=0x0): cookie=0x0 total_len=14 in_port=1 (via no_match) data_len=14 (unbuffered)
7966 vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,dl_type=0x1234
7968 NXT_PACKET_IN (xid=0x0): cookie=0x0 total_len=14 in_port=1 (via no_match) data_len=14 (unbuffered)
7969 vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,dl_type=0x1234
7972 (echo "OFPST_TABLE reply (OF1.3) (xid=0x2):
7974 active=0, lookup=0, matched=0
7976 for i in `seq 1 253`; do
7977 printf ' table %d: ditto\n' $i
7979 AT_CHECK([ovs-ofctl -O OpenFlow13 dump-tables br0 ], [0], [expout])
7981 (echo "OFPST_TABLE reply (OF1.3) (xid=0x2):
7983 active=0, lookup=3, matched=0
7986 active=0, lookup=0, matched=0
7988 for i in `seq 2 253`; do
7989 printf ' table %d: ditto\n' $i
7991 AT_CHECK([ovs-ofctl -O OpenFlow13 dump-tables br1 ], [0], [expout])
7997 AT_SETUP([ofproto-dpif packet-out goto_table])
7999 add_of_ports br0 1 2
8001 AT_DATA([flows.txt], [dnl
8002 table=0 dl_dst=50:54:00:00:00:0a actions=goto_table(1)
8003 table=1 dl_dst=50:54:00:00:00:0a actions=controller
8005 AT_CHECK([ovs-ofctl -O OpenFlow13 add-flows br0 flows.txt])
8007 AT_CAPTURE_FILE([ofctl_monitor.log])
8008 AT_CHECK([ovs-ofctl monitor br0 65534 invalid_ttl -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
8011 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)'
8014 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
8015 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
8016 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
8017 NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=14 in_port=1 (via action) data_len=14 (unbuffered)
8018 vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,dl_type=0x1234
8020 NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=14 in_port=1 (via action) data_len=14 (unbuffered)
8021 vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,dl_type=0x1234
8023 NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=14 in_port=1 (via action) data_len=14 (unbuffered)
8024 vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,dl_type=0x1234
8027 AT_CHECK([ovs-appctl revalidator/purge], [0])
8028 AT_CHECK([ovs-ofctl -O OpenFlow13 dump-flows br0 | ofctl_strip | sort], [0], [dnl
8029 n_packets=3, n_bytes=42, dl_dst=50:54:00:00:00:0a actions=goto_table:1
8030 table=1, n_packets=3, n_bytes=42, dl_dst=50:54:00:00:00:0a actions=CONTROLLER:65535
8031 OFPST_FLOW reply (OF1.3):
8034 (echo "OFPST_TABLE reply (OF1.3) (xid=0x2):
8036 active=1, lookup=3, matched=3
8040 active=0, lookup=0, matched=0
8042 for i in `seq 3 253`; do
8043 printf ' table %d: ditto\n' $i
8045 AT_CHECK([ovs-ofctl -O OpenFlow13 dump-tables br0 ], [0], [expout])
8051 AT_SETUP([ofproto-dpif packet-out table-miss (continue)])
8053 add_of_ports br0 1 2
8055 AT_CHECK([ovs-ofctl -O OpenFlow11 add-flow br0 'table=1 dl_dst=50:54:00:00:00:0a actions=controller'])
8056 AT_CHECK([ovs-ofctl -O OpenFlow11 mod-table br0 all continue])
8058 AT_CAPTURE_FILE([ofctl_monitor.log])
8059 AT_CHECK([ovs-ofctl monitor br0 65534 invalid_ttl -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
8062 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)'
8065 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
8066 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
8067 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
8068 NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=14 in_port=1 (via action) data_len=14 (unbuffered)
8069 vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,dl_type=0x1234
8071 NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=14 in_port=1 (via action) data_len=14 (unbuffered)
8072 vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,dl_type=0x1234
8074 NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=14 in_port=1 (via action) data_len=14 (unbuffered)
8075 vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,dl_type=0x1234
8078 AT_CHECK([ovs-appctl revalidator/purge], [0])
8079 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort], [0], [dnl
8080 table=1, n_packets=3, n_bytes=42, dl_dst=50:54:00:00:00:0a actions=CONTROLLER:65535
8081 OFPST_FLOW reply (OF1.1):
8084 (echo "OFPST_TABLE reply (OF1.3) (xid=0x2):
8086 active=0, lookup=3, matched=0
8089 active=1, lookup=3, matched=3
8092 active=0, lookup=0, matched=0
8094 for i in `seq 3 253`; do
8095 printf ' table %d: ditto\n' $i
8097 AT_CHECK([ovs-ofctl -O OpenFlow13 dump-tables br0 ], [0], [expout])
8102 AT_SETUP([ofproto-dpif - ICMPv6])
8106 AT_CAPTURE_FILE([ofctl_monitor.log])
8108 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
8110 ovs-appctl netdev-dummy/receive p1 '0060970769ea0000860580da86dd6000000000203afffe80000000000000020086fffe0580dafe80000000000000026097fffe0769ea870068bd00000000fe80000000000000026097fffe0769ea01010000860580da'
8112 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
8114 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
8115 NXT_PACKET_IN (xid=0x0): cookie=0x0 total_len=86 in_port=1 (via no_match) data_len=86 (unbuffered)
8116 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
8122 AT_SETUP([ofproto-dpif - ICMPv6 type match])
8124 add_of_ports br0 1 2 3
8126 AT_CHECK([ovs-ofctl add-flow br0 'icmp6,icmp_type=128,actions=2'])
8127 AT_CHECK([ovs-ofctl add-flow br0 'icmp6,icmp_type=129,actions=3'])
8129 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
8131 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)'])
8132 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)'])
8133 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)'])
8134 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)'])
8136 AT_CHECK([ovs-appctl revalidator/purge], [0])
8138 AT_CHECK([strip_ufid < ovs-vswitchd.log | filter_flow_install | strip_used], [0], [dnl
8139 recirc_id(0),in_port(1),eth_type(0x86dd),ipv6(proto=58,frag=no),icmpv6(type=128), actions:2
8140 recirc_id(0),in_port(1),eth_type(0x86dd),ipv6(proto=58,frag=no),icmpv6(type=129), actions:3
8143 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
8144 n_packets=2, n_bytes=124, icmp6,icmp_type=128 actions=output:2
8145 n_packets=2, n_bytes=124, icmp6,icmp_type=129 actions=output:3
8152 AT_SETUP([ofproto-dpif - Neighbor Discovery set-field with checksum update])
8155 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])
8157 AT_CAPTURE_FILE([ofctl_monitor.log])
8159 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
8161 ovs-appctl netdev-dummy/receive p1 '0060970769ea0000860580da86dd6000000000203afffe80000000000000020086fffe0580dafe80000000000000026097fffe0769ea870068bd00000000fe80000000000000026097fffe0769ea01010000860580da'
8163 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
8165 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
8166 NXT_PACKET_IN (xid=0x0): cookie=0x0 total_len=86 in_port=1 (via action) data_len=86 (unbuffered)
8167 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
8173 # Tests the exact match of CFI bit in installed datapath flows matching VLAN.
8174 AT_SETUP([ofproto-dpif - vlan matching])
8176 [add-port br0 p0 -- set Interface p0 type=dummy ofport_request=1])
8177 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
8179 AT_CHECK([ovs-ofctl del-flows br0])
8180 AT_CHECK([ovs-ofctl add-flow br0 "vlan_tci=0x000a/0x0fff,action=output:local"])
8182 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))'])
8184 OVS_WAIT_UNTIL([grep flow_add: ovs-vswitchd.log])
8185 AT_CHECK([grep 'in_port([[1]])' ovs-vswitchd.log | filter_flow_install | strip_xout], [0], [dnl
8186 recirc_id(0),in_port(1),eth_type(0x8100),vlan(vid=10),encap(eth_type(0x0800),ipv4(frag=no)), actions: <del>
8191 # Tests in place modification of installed datapath flows.
8192 AT_SETUP([ofproto-dpif - in place modification])
8194 [add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1])
8195 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
8197 AT_CHECK([ovs-ofctl del-flows br0])
8198 AT_CHECK([ovs-ofctl add-flow br0 in_port=1,actions=mod_vlan_vid:3,output:local])
8200 ovs-appctl vlog/set PATTERN:ANY:'%c|%p|%m'
8202 ovs-appctl time/stop
8204 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)'])
8206 # Wait for the flow setup to be done.
8207 OVS_WAIT_UNTIL([grep 'flow_add:' ovs-vswitchd.log])
8210 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)'
8213 AT_CHECK([ovs-appctl dpif/dump-flows br0 | strip_ufid | strip_used | sort], [0], [dnl
8214 recirc_id(0),in_port(1),eth_type(0x1234), packets:2, bytes:28, used:0.0s, actions:push_vlan(vid=3,pcp=0),100
8217 AT_CHECK([ovs-ofctl add-flow br0 priority=60000,in_port=1,actions=mod_vlan_vid:4,output:local])
8219 ovs-appctl time/warp 500
8220 ovs-appctl time/warp 500
8223 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)'
8226 AT_CHECK([ovs-appctl dpif/dump-flows br0 | strip_ufid | strip_used | sort], [0], [dnl
8227 recirc_id(0),in_port(1),eth_type(0x1234), packets:5, bytes:70, used:0.0s, actions:push_vlan(vid=4,pcp=0),100
8230 AT_CHECK([grep 'modify' ovs-vswitchd.log | strip_ufid ], [0], [dnl
8231 dpif|DBG|dummy@ovs-dummy: put[[modify]] skb_priority(0/0),skb_mark(0/0),ct_state(0/0),ct_zone(0/0),ct_mark(0/0),ct_label(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
8236 # Tests in place modification of installed datapath flows with vlans.
8237 AT_SETUP([ofproto-dpif - in place modification (vlan)])
8239 [add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1])
8240 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
8242 AT_CHECK([ovs-ofctl del-flows br0])
8243 AT_CHECK([ovs-ofctl add-flow br0 in_port=1,actions=output:local])
8245 ovs-appctl vlog/set PATTERN:ANY:'%c|%p|%m'
8247 ovs-appctl time/stop
8249 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)'])
8251 # Check that a correct datapath flow is created.
8252 OVS_WAIT_UNTIL([grep 'flow_add:' ovs-vswitchd.log])
8255 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)'
8258 AT_CHECK([ovs-appctl dpif/dump-flows br0 | strip_ufid | strip_used | sort], [0], [dnl
8259 recirc_id(0),in_port(1),eth_type(0x1234), packets:2, bytes:28, used:0.0s, actions:100
8262 # Delete the flow. Then check that the datapath flow is modified to
8263 # drop the packets. A modified flow inherits the stats, a new
8264 # datapath flow would start from sero.
8265 AT_CHECK([ovs-ofctl del-flows br0])
8267 ovs-appctl time/warp 500
8268 ovs-appctl time/warp 500
8271 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)'
8274 AT_CHECK([ovs-appctl dpif/dump-flows br0 | strip_ufid | strip_used | sort], [0], [dnl
8275 recirc_id(0),in_port(1),eth_type(0x1234), packets:5, bytes:70, used:0.0s, actions:drop
8278 # Add a flow that matches the non-presence of a vlan tag, and check
8279 # that the datapath flow is modified accordingly.
8280 AT_CHECK([ovs-ofctl add-flow br0 in_port=1,vlan_tci=0x0000/0x1fff,actions=output:local])
8282 ovs-appctl time/warp 500
8283 ovs-appctl time/warp 500
8286 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)'
8289 AT_CHECK([ovs-appctl dpif/dump-flows br0 | strip_ufid | strip_used | sort], [0], [dnl
8290 recirc_id(0),in_port(1),eth_type(0x1234), packets:8, bytes:112, used:0.0s, actions:100
8293 # Check that VLAN packets will not hit the same datapath megaflow.
8295 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))'])
8296 OVS_WAIT_UNTIL([grep 'flow_add:.*vlan(vid=99' ovs-vswitchd.log])
8299 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))'
8302 AT_CHECK([ovs-appctl dpif/dump-flows br0 | strip_ufid | strip_used | sort], [0], [dnl
8303 recirc_id(0),in_port(1),eth_type(0x1234), packets:8, bytes:112, used:0.0s, actions:100
8304 recirc_id(0),in_port(1),eth_type(0x8100),vlan(vid=99,pcp=7/0x0),encap(eth_type(0x1234)), packets:2, bytes:36, used:0.0s, actions:drop
8307 # Check that the new flow matches the CFI bit, while both vid and pcp
8309 AT_CHECK([grep '\(modify\)\|\(flow_add\)' ovs-vswitchd.log | strip_ufid ], [0], [dnl
8310 dpif_netdev|DBG|flow_add: recirc_id(0),in_port(1),eth_type(0x1234), actions:100
8311 dpif|DBG|dummy@ovs-dummy: put[[modify]] skb_priority(0/0),skb_mark(0/0),ct_state(0/0),ct_zone(0/0),ct_mark(0/0),ct_label(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)
8312 dpif|DBG|dummy@ovs-dummy: put[[modify]] skb_priority(0/0),skb_mark(0/0),ct_state(0/0),ct_zone(0/0),ct_mark(0/0),ct_label(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
8313 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
8318 AT_SETUP([ofproto-dpif - trace (unchanged)])
8320 AT_CHECK([ovs-appctl ofproto/trace br0 'in_port=1'], [0], [stdout])
8321 AT_CHECK([grep "Final flow:" stdout], [0], [Final flow: unchanged
8323 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(100)'], [0], [stdout])
8324 AT_CHECK([grep "Final flow:" stdout], [0], [Final flow: unchanged
8330 AT_SETUP([ofproto-dpif - conntrack - controller])
8333 add_of_ports br0 1 2
8335 AT_CHECK([ovs-appctl vlog/set dpif_netdev:dbg vconn:info ofproto_dpif:info])
8337 dnl Allow new connections on p1->p2, but not on p2->p1.
8338 AT_DATA([flows.txt], [dnl
8341 table=0,priority=100,arp,action=normal
8342 table=0,priority=10,in_port=1,udp,action=ct(commit,zone=0),controller
8343 table=0,priority=10,in_port=2,udp,action=ct(table=1,zone=0)
8344 table=0,priority=1,action=drop
8348 table=1,priority=10,in_port=2,ct_state=+trk+est-new,udp,action=controller
8349 table=1,priority=1,action=drop
8352 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
8354 AT_CAPTURE_FILE([ofctl_monitor.log])
8355 AT_CHECK([ovs-ofctl monitor br0 65534 invalid_ttl -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
8357 AT_CHECK([ovs-appctl netdev-dummy/receive p2 'in_port(2),eth(src=50:54:00:00:00:0a,dst=50:54:00:00:00:09),eth_type(0x0800),ipv4(src=10.1.1.2,dst=10.1.1.1,proto=17,tos=0,ttl=64,frag=no),udp(src=2,dst=1)'])
8359 dnl OK, now start a new connection from port 1.
8360 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.1.1.1,dst=10.1.1.2,proto=17,tos=0,ttl=64,frag=no),udp(src=1,dst=2)'])
8362 dnl Now try a reply from port 2.
8363 AT_CHECK([ovs-appctl netdev-dummy/receive p2 'in_port(2),eth(src=50:54:00:00:00:0a,dst=50:54:00:00:00:09),eth_type(0x0800),ipv4(src=10.1.1.2,dst=10.1.1.1,proto=17,tos=0,ttl=64,frag=no),udp(src=2,dst=1)'])
8365 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 4])
8366 OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
8368 dnl Check this output. We only see the latter two packets, not the first.
8369 dnl Note that the first packet doesn't have the ct_state bits set. This
8370 dnl happens because the ct_state field is available only after recirc.
8371 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
8372 NXT_PACKET_IN (xid=0x0): cookie=0x0 total_len=42 in_port=1 (via action) data_len=42 (unbuffered)
8373 udp,vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,nw_src=10.1.1.1,nw_dst=10.1.1.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=1,tp_dst=2 udp_csum:e9d6
8375 NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=42 ct_state=est|rpl|trk,in_port=2 (via action) data_len=42 (unbuffered)
8376 udp,vlan_tci=0x0000,dl_src=50:54:00:00:00:0a,dl_dst=50:54:00:00:00:09,nw_src=10.1.1.2,nw_dst=10.1.1.1,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=2,tp_dst=1 udp_csum:e9d6
8379 AT_CHECK([ovs-ofctl monitor br0 65534 invalid_ttl -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
8381 dnl OK, now start a second connection from port 1
8382 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.1.1.1,dst=10.1.1.2,proto=17,tos=0,ttl=64,frag=no),udp(src=3,dst=4)'])
8384 dnl Now try a reply from port 2.
8385 AT_CHECK([ovs-appctl netdev-dummy/receive p2 'in_port(2),eth(src=50:54:00:00:00:0a,dst=50:54:00:00:00:09),eth_type(0x0800),ipv4(src=10.1.1.2,dst=10.1.1.1,proto=17,tos=0,ttl=64,frag=no),udp(src=4,dst=3)'])
8388 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 4])
8389 OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
8391 dnl Check this output. We should see both packets
8392 dnl Note that the first packet doesn't have the ct_state bits set. This
8393 dnl happens because the ct_state field is available only after recirc.
8394 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
8395 NXT_PACKET_IN (xid=0x0): cookie=0x0 total_len=42 in_port=1 (via action) data_len=42 (unbuffered)
8396 udp,vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,nw_src=10.1.1.1,nw_dst=10.1.1.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=3,tp_dst=4 udp_csum:e9d2
8398 NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=42 ct_state=est|rpl|trk,in_port=2 (via action) data_len=42 (unbuffered)
8399 udp,vlan_tci=0x0000,dl_src=50:54:00:00:00:0a,dl_dst=50:54:00:00:00:09,nw_src=10.1.1.2,nw_dst=10.1.1.1,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=4,tp_dst=3 udp_csum:e9d2
8405 AT_SETUP([ofproto-dpif - conntrack - ipv6])
8408 add_of_ports br0 1 2
8410 AT_CHECK([ovs-appctl vlog/set dpif_netdev:dbg vconn:info ofproto_dpif:info])
8412 dnl Allow new connections on p1->p2, but not on p2->p1.
8413 AT_DATA([flows.txt], [dnl
8416 table=0,priority=100,arp,action=normal
8417 table=0,priority=10,in_port=1,udp6,action=ct(commit,zone=0),controller
8418 table=0,priority=10,in_port=2,udp6,action=ct(table=1,zone=0)
8419 table=0,priority=1,action=drop
8422 table=1,priority=10,in_port=2,ct_state=+trk+est-new,udp6,action=controller
8423 table=1,priority=1,action=drop
8426 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
8428 AT_CAPTURE_FILE([ofctl_monitor.log])
8429 AT_CHECK([ovs-ofctl monitor br0 65534 invalid_ttl -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
8431 AT_CHECK([ovs-appctl netdev-dummy/receive p2 'in_port(2),eth(src=50:54:00:00:00:0a,dst=50:54:00:00:00:09),eth_type(0x86dd),ipv6(src=2001:db8::2,dst=2001:db8::1,label=0,proto=17,tclass=0x70,hlimit=128,frag=no),udp(src=2,dst=1)'])
8433 dnl OK, now start a new connection from port 1.
8434 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::1,dst=2001:db8::2,label=0,proto=17,tclass=0x70,hlimit=128,frag=no),udp(src=1,dst=2)'])
8436 dnl Now try a reply from port 2.
8437 AT_CHECK([ovs-appctl netdev-dummy/receive p2 'in_port(2),eth(src=50:54:00:00:00:0a,dst=50:54:00:00:00:09),eth_type(0x86dd),ipv6(src=2001:db8::2,dst=2001:db8::1,label=0,proto=17,tclass=0x70,hlimit=128,frag=no),udp(src=2,dst=1)'])
8439 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 4])
8440 OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
8442 dnl Check this output. We only see the latter two packets, not the first.
8443 dnl Note that the first packet doesn't have the ct_state bits set. This
8444 dnl happens because the ct_state field is available only after recirc.
8445 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
8446 NXT_PACKET_IN (xid=0x0): cookie=0x0 total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
8447 udp6,vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,ipv6_src=2001:db8::1,ipv6_dst=2001:db8::2,ipv6_label=0x00000,nw_tos=112,nw_ecn=0,nw_ttl=128,tp_src=1,tp_dst=2 udp_csum:a466
8448 NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=62 ct_state=est|rpl|trk,in_port=2 (via action) data_len=62 (unbuffered)
8449 udp6,vlan_tci=0x0000,dl_src=50:54:00:00:00:0a,dl_dst=50:54:00:00:00:09,ipv6_src=2001:db8::2,ipv6_dst=2001:db8::1,ipv6_label=0x00000,nw_tos=112,nw_ecn=0,nw_ttl=128,tp_src=2,tp_dst=1 udp_csum:a466
8455 AT_SETUP([ofproto-dpif - conntrack - output action])
8458 add_of_ports br0 1 2
8460 AT_CHECK([ovs-appctl vlog/set dpif_netdev:dbg vconn:info ofproto_dpif:info])
8462 dnl Allow new connections on p1->p2. Allow only established connections p2->p1
8463 AT_DATA([flows.txt], [dnl
8464 dnl The flows are in two separate tables for two reasons:
8465 dnl * To make the pipeline more clear.
8466 dnl * To make megaflows more consistent (we check megaflows below). The
8467 dnl unwildcarding in megaflows depends on the internal ordering of the
8468 dnl subtables, which are sorted using the system qsort(). qsort()
8469 dnl is provided by libc and may or may not be stable, so we can't rely
8470 dnl on that. By having separate tables we have more control over which
8471 dnl subtables are visited, meaning consistent megaflows.
8475 table=0,priority=100,arp,action=normal
8476 table=0,priority=10,in_port=1,udp,action=ct(commit,zone=0),2
8477 table=0,priority=10,in_port=2,udp,action=ct(table=1,zone=0)
8478 table=0,priority=1,action=drop
8482 table=1,priority=10,in_port=2,ct_state=+trk+est-new,udp,action=1
8483 table=1,priority=1,action=drop
8486 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
8489 AT_CHECK([ovs-appctl netdev-dummy/receive p2 'in_port(2),eth(src=50:54:00:00:00:0a,dst=50:54:00:00:00:09),eth_type(0x0800),ipv4(src=10.1.1.2,dst=10.1.1.1,proto=17,tos=0,ttl=64,frag=no),udp(src=2,dst=1)'])
8491 dnl OK, now start a new connection from port 1.
8492 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.1.1.1,dst=10.1.1.2,proto=17,tos=0,ttl=64,frag=no),udp(src=1,dst=2)'])
8494 dnl Now try a reply from port 2.
8495 AT_CHECK([ovs-appctl netdev-dummy/receive p2 'in_port(2),eth(src=50:54:00:00:00:0a,dst=50:54:00:00:00:09),eth_type(0x0800),ipv4(src=10.1.1.2,dst=10.1.1.1,proto=17,tos=0,ttl=64,frag=no),udp(src=2,dst=1)'])
8497 dnl OK, now start a second connection from port 1
8498 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.1.1.1,dst=10.1.1.2,proto=17,tos=0,ttl=64,frag=no),udp(src=1,dst=2)'])
8500 dnl Now try a reply from port 2.
8501 AT_CHECK([ovs-appctl netdev-dummy/receive p2 'in_port(2),eth(src=50:54:00:00:00:0a,dst=50:54:00:00:00:09),eth_type(0x0800),ipv4(src=10.1.1.2,dst=10.1.1.1,proto=17,tos=0,ttl=64,frag=no),udp(src=2,dst=1)'])
8504 AT_CHECK([cat ovs-vswitchd.log | strip_ufid | filter_flow_install], [0], [dnl
8505 ct_state(+new-est+trk),recirc_id(0x1),in_port(2),eth_type(0x0800),ipv4(frag=no), actions:drop
8506 ct_state(-new+est+trk),recirc_id(0x1),in_port(2),eth_type(0x0800),ipv4(proto=17,frag=no), actions:1
8507 recirc_id(0),in_port(1),eth_type(0x0800),ipv4(proto=17,frag=no), actions:ct(commit),2
8508 recirc_id(0),in_port(2),eth_type(0x0800),ipv4(proto=17,frag=no), actions:ct,recirc(0x1)
8514 AT_SETUP([ofproto-dpif - conntrack - expiration])
8517 add_of_ports br0 1 2
8519 AT_CHECK([ovs-appctl vlog/set dpif_netdev:dbg vconn:info ofproto_dpif:info])
8521 dnl Allow new connections on p1->p2. Allow only established connections p2->p1
8522 AT_DATA([flows.txt], [dnl
8525 table=0,priority=100,arp,action=normal
8526 table=0,priority=10,in_port=1,udp,action=ct(commit,zone=0)
8527 table=0,priority=10,in_port=2,udp,action=ct(table=1,zone=0)
8528 table=0,priority=1,action=drop
8532 table=1,priority=10,in_port=2,ct_state=+trk+est-new,udp,action=controller
8533 table=1,priority=1,action=drop
8536 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
8538 AT_CAPTURE_FILE([ofctl_monitor.log])
8539 AT_CHECK([ovs-ofctl monitor br0 65534 invalid_ttl -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
8541 AT_CHECK([ovs-appctl time/stop])
8543 dnl Start a new connection from port 1.
8544 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.1.1.1,dst=10.1.1.2,proto=17,tos=0,ttl=64,frag=no),udp(src=1,dst=2)'])
8546 dnl Now try a reply from port 2.
8547 AT_CHECK([ovs-appctl netdev-dummy/receive p2 'in_port(2),eth(src=50:54:00:00:00:0a,dst=50:54:00:00:00:09),eth_type(0x0800),ipv4(src=10.1.1.2,dst=10.1.1.1,proto=17,tos=0,ttl=64,frag=no),udp(src=2,dst=1)'])
8549 ovs-appctl time/warp 100000
8551 dnl Now try another reply from port 2.
8552 AT_CHECK([ovs-appctl netdev-dummy/receive p2 'in_port(2),eth(src=50:54:00:00:00:0a,dst=50:54:00:00:00:09),eth_type(0x0800),ipv4(src=10.1.1.2,dst=10.1.1.1,proto=17,tos=0,ttl=64,frag=no),udp(src=2,dst=1)'])
8554 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 3])
8555 OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
8557 dnl Check this output. Only one reply must be there
8558 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
8559 NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=42 ct_state=est|rpl|trk,in_port=2 (via action) data_len=42 (unbuffered)
8560 udp,vlan_tci=0x0000,dl_src=50:54:00:00:00:0a,dl_dst=50:54:00:00:00:09,nw_src=10.1.1.2,nw_dst=10.1.1.1,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=2,tp_dst=1 udp_csum:e9d6
8562 OFPT_ECHO_REQUEST (xid=0x0): 0 bytes of payload
8568 AT_SETUP([ofproto-dpif - conntrack - untrackable traffic])
8571 add_of_ports br0 1 2
8573 AT_CHECK([ovs-appctl vlog/set dpif_netdev:dbg vconn:info ofproto_dpif:info])
8575 AT_DATA([flows.txt], [dnl
8576 ipv6,ct_state=-trk,action=ct(table=0,zone=0)
8577 ct_state=+trk,action=controller
8580 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
8582 AT_CAPTURE_FILE([ofctl_monitor.log])
8583 AT_CHECK([ovs-ofctl monitor br0 65534 invalid_ttl -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
8585 AT_CHECK([ovs-appctl time/stop])
8587 AT_CHECK([ovs-appctl netdev-dummy/receive p2 '0060970769ea0000860580da86dd6000000000203afffe80000000000000020086fffe0580dafe80000000000000026097fffe0769ea870068bd00000000fe80000000000000026097fffe0769ea01010000860580da'])
8589 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 1])
8590 OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
8592 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
8593 NXT_PACKET_IN (xid=0x0): cookie=0x0 total_len=86 ct_state=inv|trk,in_port=2 (via action) data_len=86 (unbuffered)
8594 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
8600 AT_SETUP([ofproto-dpif - conntrack - zones])
8603 add_of_ports br0 1 2 3 4
8605 AT_CHECK([ovs-appctl vlog/set dpif_netdev:dbg vconn:info ofproto_dpif:info])
8607 dnl Allow new connections on p1->p2 or p3->p4.
8608 dnl Allow only established connections p2->p1 and p4->p3
8609 dnl p1,p2 and p3,p4 are on different zones
8610 AT_DATA([flows.txt], [dnl
8613 table=0,priority=100,arp,action=normal
8614 table=0,priority=10,in_port=1,udp,action=ct(commit,zone=0),controller
8615 table=0,priority=10,in_port=2,udp,action=ct(table=1,zone=0)
8616 table=0,priority=10,in_port=3,udp,action=ct(commit,zone=1),controller
8617 table=0,priority=10,in_port=4,udp,action=ct(table=1,zone=1)
8618 table=0,priority=1,action=drop
8622 table=1,priority=10,in_port=2,ct_state=+trk+est-new,udp,action=controller
8623 table=1,priority=10,in_port=4,ct_state=+trk+est-new,udp,action=controller
8624 table=1,priority=1,action=drop
8627 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
8629 AT_CAPTURE_FILE([ofctl_monitor.log])
8630 AT_CHECK([ovs-ofctl monitor br0 65534 invalid_ttl -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
8632 dnl Basic "only established" test on ports 1,2
8634 AT_CHECK([ovs-appctl netdev-dummy/receive p2 'in_port(2),eth(src=50:54:00:00:00:0a,dst=50:54:00:00:00:09),eth_type(0x0800),ipv4(src=10.1.1.2,dst=10.1.1.1,proto=17,tos=0,ttl=64,frag=no),udp(src=2,dst=1)'])
8635 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.1.1.1,dst=10.1.1.2,proto=17,tos=0,ttl=64,frag=no),udp(src=1,dst=2)'])
8636 AT_CHECK([ovs-appctl netdev-dummy/receive p2 'in_port(2),eth(src=50:54:00:00:00:0a,dst=50:54:00:00:00:09),eth_type(0x0800),ipv4(src=10.1.1.2,dst=10.1.1.1,proto=17,tos=0,ttl=64,frag=no),udp(src=2,dst=1)'])
8638 dnl Now use the same 5-tuples but on ports 3,4
8640 AT_CHECK([ovs-appctl netdev-dummy/receive p4 'in_port(4),eth(src=50:54:00:00:00:0a,dst=50:54:00:00:00:09),eth_type(0x0800),ipv4(src=10.1.1.2,dst=10.1.1.1,proto=17,tos=0,ttl=64,frag=no),udp(src=2,dst=1)'])
8641 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.1.1.1,dst=10.1.1.2,proto=17,tos=0,ttl=64,frag=no),udp(src=1,dst=2)'])
8642 AT_CHECK([ovs-appctl netdev-dummy/receive p4 'in_port(4),eth(src=50:54:00:00:00:0a,dst=50:54:00:00:00:09),eth_type(0x0800),ipv4(src=10.1.1.2,dst=10.1.1.1,proto=17,tos=0,ttl=64,frag=no),udp(src=2,dst=1)'])
8644 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 8])
8645 OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
8647 dnl Check this output. We only see the latter two packets (for each zone), not the first.
8648 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
8649 NXT_PACKET_IN (xid=0x0): cookie=0x0 total_len=42 in_port=1 (via action) data_len=42 (unbuffered)
8650 udp,vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,nw_src=10.1.1.1,nw_dst=10.1.1.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=1,tp_dst=2 udp_csum:e9d6
8652 NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=42 ct_state=est|rpl|trk,in_port=2 (via action) data_len=42 (unbuffered)
8653 udp,vlan_tci=0x0000,dl_src=50:54:00:00:00:0a,dl_dst=50:54:00:00:00:09,nw_src=10.1.1.2,nw_dst=10.1.1.1,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=2,tp_dst=1 udp_csum:e9d6
8655 NXT_PACKET_IN (xid=0x0): cookie=0x0 total_len=42 in_port=3 (via action) data_len=42 (unbuffered)
8656 udp,vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,nw_src=10.1.1.1,nw_dst=10.1.1.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=1,tp_dst=2 udp_csum:e9d6
8658 NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=42 ct_state=est|rpl|trk,ct_zone=1,in_port=4 (via action) data_len=42 (unbuffered)
8659 udp,vlan_tci=0x0000,dl_src=50:54:00:00:00:0a,dl_dst=50:54:00:00:00:09,nw_src=10.1.1.2,nw_dst=10.1.1.1,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=2,tp_dst=1 udp_csum:e9d6
8665 AT_SETUP([ofproto-dpif - conntrack - recirc,commit])
8668 add_of_ports br0 1 2
8670 AT_CHECK([ovs-appctl vlog/set dpif_netdev:dbg vconn:info ofproto_dpif:info])
8672 dnl Allow new connections on p1->p2. Allow only established connections p2->p1
8673 AT_DATA([flows.txt], [dnl
8676 table=0,priority=100,arp,action=normal
8677 table=0,priority=10,udp,action=ct(table=1,zone=0)
8678 table=0,priority=1,action=drop
8682 table=1,priority=10,in_port=1,ct_state=+trk+new,udp,action=ct(commit,zone=0),controller
8683 table=1,priority=10,ct_state=+trk+est,udp,action=controller
8684 table=1,priority=1,action=drop
8687 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
8689 AT_CAPTURE_FILE([ofctl_monitor.log])
8690 AT_CHECK([ovs-ofctl monitor br0 65534 invalid_ttl -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
8692 AT_CHECK([ovs-appctl netdev-dummy/receive p2 'in_port(2),eth(src=50:54:00:00:00:0a,dst=50:54:00:00:00:09),eth_type(0x0800),ipv4(src=10.1.1.2,dst=10.1.1.1,proto=17,tos=0,ttl=64,frag=no),udp(src=2,dst=1)'])
8694 dnl OK, now start a new connection from port 1.
8695 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.1.1.1,dst=10.1.1.2,proto=17,tos=0,ttl=64,frag=no),udp(src=1,dst=2)'])
8697 dnl Now try a reply from port 2.
8698 AT_CHECK([ovs-appctl netdev-dummy/receive p2 'in_port(2),eth(src=50:54:00:00:00:0a,dst=50:54:00:00:00:09),eth_type(0x0800),ipv4(src=10.1.1.2,dst=10.1.1.1,proto=17,tos=0,ttl=64,frag=no),udp(src=2,dst=1)'])
8700 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 4])
8701 OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
8703 dnl Check this output. We only see the latter two packets, not the first.
8704 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
8705 NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=42 ct_state=new|trk,in_port=1 (via action) data_len=42 (unbuffered)
8706 udp,vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,nw_src=10.1.1.1,nw_dst=10.1.1.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=1,tp_dst=2 udp_csum:e9d6
8708 NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=42 ct_state=est|rpl|trk,in_port=2 (via action) data_len=42 (unbuffered)
8709 udp,vlan_tci=0x0000,dl_src=50:54:00:00:00:0a,dl_dst=50:54:00:00:00:09,nw_src=10.1.1.2,nw_dst=10.1.1.1,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=2,tp_dst=1 udp_csum:e9d6
8715 AT_SETUP([ofproto-dpif - conntrack - ICMP related])
8718 add_of_ports br0 1 2
8720 dnl Allow any traffic from ns0->ns1. Only allow nd, return traffic from ns1->ns0.
8721 AT_DATA([flows.txt], [dnl
8724 table=0,priority=100,arp,action=normal
8725 table=0,priority=10,ip,in_port=1,udp,action=ct(commit,table=1)
8726 table=0,priority=10,ip,in_port=2,action=ct(table=1)
8727 table=0,priority=1,action=drop
8731 table=1,priority=10,in_port=1,ct_state=+trk,action=controller
8732 table=1,priority=10,in_port=2,ct_state=+trk-inv-new,action=controller
8733 table=1,priority=1,action=drop
8736 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
8738 AT_CAPTURE_FILE([ofctl_monitor.log])
8739 AT_CHECK([ovs-ofctl monitor br0 65534 invalid_ttl -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
8741 dnl 1. Send an ICMP port unreach reply for port 8738, without any previous request
8742 AT_CHECK([ovs-ofctl -O OpenFlow13 packet-out br0 2 ct\(table=1\) 'f64c473528c9c6f54ecb72db080045c0003d2e8700004001f351ac100004ac1000030303553f0000000045000021317040004011b138ac100003ac10000411112222000da5a06369616f0a'])
8744 dnl 2. Send and UDP packet to port 5555
8745 AT_CHECK([ovs-ofctl -O OpenFlow13 packet-out br0 1 ct\(commit,table=1\) 'c6f94ecb72dbe64c473528c9080045000021317040004011b138ac100001ac100002a28e15b3000d20966369616f0a'])
8747 dnl 3. Send an ICMP port unreach reply for port 5555, related to the first packet
8748 AT_CHECK([ovs-ofctl -O OpenFlow13 packet-out br0 2 ct\(table=1\) 'e64c473528c9c6f94ecb72db080045c0003d2e8700004001f355ac100002ac1000010303553f0000000045000021317040004011b138ac100001ac100002a28e15b3000d20966369616f0a'])
8750 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 4])
8751 OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
8753 dnl Check this output. We only see the first and the last packet
8754 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
8755 NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=47 ct_state=new|trk,in_port=1 (via action) data_len=47 (unbuffered)
8756 udp,vlan_tci=0x0000,dl_src=e6:4c:47:35:28:c9,dl_dst=c6:f9:4e:cb:72:db,nw_src=172.16.0.1,nw_dst=172.16.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=41614,tp_dst=5555 udp_csum:2096
8758 NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=75 ct_state=rel|rpl|trk,in_port=2 (via action) data_len=75 (unbuffered)
8759 icmp,vlan_tci=0x0000,dl_src=c6:f9:4e:cb:72:db,dl_dst=e6:4c:47:35:28:c9,nw_src=172.16.0.2,nw_dst=172.16.0.1,nw_tos=192,nw_ecn=0,nw_ttl=64,icmp_type=3,icmp_code=3 icmp_csum:553f
8765 AT_SETUP([ofproto-dpif - conntrack - ct_mark])
8768 add_of_ports br0 1 2
8770 AT_CHECK([ovs-appctl vlog/set dpif_netdev:dbg vconn:info ofproto_dpif:info])
8772 dnl Allow new connections on p1->p2. Allow only established connections p2->p1
8773 AT_DATA([flows.txt], [dnl
8776 table=0,arp,action=normal
8777 table=0,ip,in_port=1,udp,tp_src=1,action=ct(commit,exec(set_field:1->ct_mark)),controller
8778 table=0,ip,in_port=1,udp,tp_src=3,action=ct(commit,exec(set_field:3->ct_mark)),controller
8779 table=0,ip,in_port=1,udp,tp_src=5,action=ct(commit,exec(set_field:5->ct_mark)),controller
8780 table=0,ip,in_port=2,actions=ct(table=1)
8781 table=0,priority=0,action=drop
8785 table=1,priority=100,ct_state=+trk+rpl,ct_mark=0/4,actions=controller
8786 table=1,priority=1,action=drop
8789 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
8791 AT_CAPTURE_FILE([ofctl_monitor.log])
8792 AT_CHECK([ovs-ofctl monitor br0 65534 invalid_ttl -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
8794 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.1.1.1,dst=10.1.1.2,proto=17,tos=0,ttl=64,frag=no),udp(src=1,dst=2)'])
8795 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.1.1.1,dst=10.1.1.2,proto=17,tos=0,ttl=64,frag=no),udp(src=3,dst=4)'])
8796 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.1.1.1,dst=10.1.1.2,proto=17,tos=0,ttl=64,frag=no),udp(src=5,dst=6)'])
8798 AT_CHECK([ovs-appctl netdev-dummy/receive p2 'in_port(2),eth(src=50:54:00:00:00:0a,dst=50:54:00:00:00:09),eth_type(0x0800),ipv4(src=10.1.1.2,dst=10.1.1.1,proto=17,tos=0,ttl=64,frag=no),udp(src=2,dst=1)'])
8799 AT_CHECK([ovs-appctl netdev-dummy/receive p2 'in_port(2),eth(src=50:54:00:00:00:0a,dst=50:54:00:00:00:09),eth_type(0x0800),ipv4(src=10.1.1.2,dst=10.1.1.1,proto=17,tos=0,ttl=64,frag=no),udp(src=4,dst=3)'])
8800 AT_CHECK([ovs-appctl netdev-dummy/receive p2 'in_port(2),eth(src=50:54:00:00:00:0a,dst=50:54:00:00:00:09),eth_type(0x0800),ipv4(src=10.1.1.2,dst=10.1.1.1,proto=17,tos=0,ttl=64,frag=no),udp(src=6,dst=5)'])
8802 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 10])
8803 OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
8805 dnl Check this output.
8806 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
8807 NXT_PACKET_IN (xid=0x0): cookie=0x0 total_len=42 ct_mark=0x1,in_port=1 (via action) data_len=42 (unbuffered)
8808 udp,vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,nw_src=10.1.1.1,nw_dst=10.1.1.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=1,tp_dst=2 udp_csum:e9d6
8810 NXT_PACKET_IN (xid=0x0): cookie=0x0 total_len=42 ct_mark=0x3,in_port=1 (via action) data_len=42 (unbuffered)
8811 udp,vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,nw_src=10.1.1.1,nw_dst=10.1.1.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=3,tp_dst=4 udp_csum:e9d2
8813 NXT_PACKET_IN (xid=0x0): cookie=0x0 total_len=42 ct_mark=0x5,in_port=1 (via action) data_len=42 (unbuffered)
8814 udp,vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,nw_src=10.1.1.1,nw_dst=10.1.1.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=5,tp_dst=6 udp_csum:e9ce
8816 NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=42 ct_state=est|rpl|trk,ct_mark=0x1,in_port=2 (via action) data_len=42 (unbuffered)
8817 udp,vlan_tci=0x0000,dl_src=50:54:00:00:00:0a,dl_dst=50:54:00:00:00:09,nw_src=10.1.1.2,nw_dst=10.1.1.1,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=2,tp_dst=1 udp_csum:e9d6
8819 NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=42 ct_state=est|rpl|trk,ct_mark=0x3,in_port=2 (via action) data_len=42 (unbuffered)
8820 udp,vlan_tci=0x0000,dl_src=50:54:00:00:00:0a,dl_dst=50:54:00:00:00:09,nw_src=10.1.1.2,nw_dst=10.1.1.1,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=4,tp_dst=3 udp_csum:e9d2
8826 AT_SETUP([ofproto-dpif - conntrack - ct_label])
8829 add_of_ports br0 1 2
8831 AT_CHECK([ovs-appctl vlog/set dpif_netdev:dbg vconn:info ofproto_dpif:info])
8833 dnl Allow new connections on p1->p2. Allow only established connections p2->p1
8834 AT_DATA([flows.txt], [dnl
8837 table=0,arp,action=normal
8838 table=0,ip,in_port=1,udp,tp_src=1,action=ct(commit,exec(set_field:000000000000000001->ct_label))
8839 table=0,ip,in_port=1,udp,tp_src=3,action=ct(commit,exec(set_field:000000000000000002->ct_label))
8840 table=0,ip,in_port=2,actions=ct(table=1)
8844 table=1,priority=10,ct_state=+trk+rpl,actions=controller
8845 table=1,priority=1,action=drop
8848 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
8850 AT_CAPTURE_FILE([ofctl_monitor.log])
8851 AT_CHECK([ovs-ofctl monitor br0 65534 invalid_ttl -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
8853 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.1.1.1,dst=10.1.1.2,proto=17,tos=0,ttl=64,frag=no),udp(src=1,dst=2)'])
8854 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.1.1.1,dst=10.1.1.2,proto=17,tos=0,ttl=64,frag=no),udp(src=3,dst=4)'])
8856 AT_CHECK([ovs-appctl netdev-dummy/receive p2 'in_port(2),eth(src=50:54:00:00:00:0a,dst=50:54:00:00:00:09),eth_type(0x0800),ipv4(src=10.1.1.2,dst=10.1.1.1,proto=17,tos=0,ttl=64,frag=no),udp(src=2,dst=1)'])
8857 AT_CHECK([ovs-appctl netdev-dummy/receive p2 'in_port(2),eth(src=50:54:00:00:00:0a,dst=50:54:00:00:00:09),eth_type(0x0800),ipv4(src=10.1.1.2,dst=10.1.1.1,proto=17,tos=0,ttl=64,frag=no),udp(src=4,dst=3)'])
8859 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 4])
8860 OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
8862 dnl Check this output.
8863 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
8864 NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=42 ct_state=est|rpl|trk,ct_label=0x1,in_port=2 (via action) data_len=42 (unbuffered)
8865 udp,vlan_tci=0x0000,dl_src=50:54:00:00:00:0a,dl_dst=50:54:00:00:00:09,nw_src=10.1.1.2,nw_dst=10.1.1.1,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=2,tp_dst=1 udp_csum:e9d6
8867 NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=42 ct_state=est|rpl|trk,ct_label=0x2,in_port=2 (via action) data_len=42 (unbuffered)
8868 udp,vlan_tci=0x0000,dl_src=50:54:00:00:00:0a,dl_dst=50:54:00:00:00:09,nw_src=10.1.1.2,nw_dst=10.1.1.1,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=4,tp_dst=3 udp_csum:e9d2
8874 AT_SETUP([ofproto-dpif - conntrack - ct_label datapath flow])
8877 add_of_ports br0 1 2
8879 AT_CHECK([ovs-appctl vlog/set dpif_netdev:dbg vconn:info ofproto_dpif:info])
8881 dnl Allow new connections on p1->p2. Allow only established connections p2->p1
8882 AT_DATA([flows.txt], [dnl
8883 dnl The flows are in two separate tables for two reasons:
8884 dnl * To make the pipeline more clear.
8885 dnl * To make megaflows more consistent (we check megaflows below). The
8886 dnl unwildcarding in megaflows depends on the internal ordering of the
8887 dnl subtables, which are sorted using the system qsort(). qsort()
8888 dnl is provided by libc and may or may not be stable, so we can't rely
8889 dnl on that. By having separate tables we have more control over which
8890 dnl subtables are visited, meaning consistent megaflows.
8894 table=0,arp,action=normal
8895 table=0,ip,in_port=1,udp,tp_src=1,action=ct(commit,exec(set_field:1->ct_label)),2
8896 table=0,ip,in_port=2,actions=ct(table=1)
8897 table=0,priority=0,action=drop
8901 table=1,priority=10,ct_state=+trk+rpl,ct_label=0x1,actions=1
8902 table=1,priority=1,action=drop
8905 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
8907 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.1.1.1,dst=10.1.1.2,proto=17,tos=0,ttl=64,frag=no),udp(src=1,dst=2)'])
8908 AT_CHECK([ovs-appctl netdev-dummy/receive p2 'in_port(2),eth(src=50:54:00:00:00:0a,dst=50:54:00:00:00:09),eth_type(0x0800),ipv4(src=10.1.1.2,dst=10.1.1.1,proto=17,tos=0,ttl=64,frag=no),udp(src=2,dst=1)'])
8910 AT_CHECK([cat ovs-vswitchd.log | strip_ufid | filter_flow_install], [0], [dnl
8911 ct_state(+rpl+trk),ct_label(0x1),recirc_id(0x1),in_port(2),eth_type(0x0800),ipv4(frag=no), actions:1
8912 recirc_id(0),in_port(1),eth_type(0x0800),ipv4(proto=17,frag=no),udp(src=1), actions:ct(commit,label=0x1),2
8913 recirc_id(0),in_port(2),eth_type(0x0800),ipv4(frag=no), actions:ct,recirc(0x1)
8919 AT_SETUP([ofproto-dpif - conntrack - no output])
8924 AT_CHECK([ovs-appctl vlog/set dpif_netdev:dbg vconn:info ofproto_dpif:info])
8926 dnl Allow new connections on p1->p2. Allow only established connections p2->p1
8927 AT_DATA([flows.txt], [dnl
8928 in_port=1,udp,action=ct(commit,zone=0)
8931 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
8933 dnl Start a new connection from port 1.
8934 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.1.1.1,dst=10.1.1.2,proto=17,tos=0,ttl=64,frag=no),udp(src=1,dst=2)'])
8936 AT_CHECK([cat ovs-vswitchd.log | strip_ufid | filter_flow_install], [0], [dnl
8937 recirc_id(0),in_port(1),eth_type(0x0800),ipv4(proto=17,frag=no), actions:ct(commit)
8943 AT_SETUP([ofproto-dpif - conntrack - tcp port reuse])
8946 add_of_ports br0 1 2
8948 AT_CHECK([ovs-appctl vlog/set dpif_netdev:dbg vconn:info ofproto_dpif:info])
8950 dnl Allow new connections on p1->p2. Allow only established connections p2->p1
8951 AT_DATA([flows.txt], [dnl
8954 table=0,priority=100,arp,action=normal
8955 table=0,priority=10,in_port=1,ip,action=ct(commit,table=1)
8956 table=0,priority=10,in_port=2,ip,action=ct(table=1)
8957 table=0,priority=1,action=drop
8961 dnl The following two flows are separated to explicitly count the packets
8962 dnl that create a new connection
8963 table=1,priority=100,cookie=0x1,in_port=1,ip,ct_state=+trk+new-inv-rpl,action=2
8964 table=1,priority=100,in_port=1,ip,ct_state=+trk-new-inv-rpl,action=2
8966 table=1,priority=100,in_port=2,ip,ct_state=+trk+est+rpl-new-inv,action=1
8967 table=1,ip,ct_state=+trk+inv,action=drop
8970 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
8972 AT_CHECK([ovs-appctl netdev-dummy/receive p1 '50540000000a50540000000908004500002ca4e5400040067fe20a0101010a0101020001000259b5d93f0000000060027210dd190000020405b4'])
8973 AT_CHECK([ovs-appctl netdev-dummy/receive p2 '50540000000950540000000a08004500002c00004000400624c80a0101020a010101000200017c35468459b5d940601272101a4f0000020405b4'])
8974 AT_CHECK([ovs-appctl netdev-dummy/receive p1 '50540000000a505400000009080045000028a4e6400040067fe50a0101010a0101020001000259b5d9407c35468550107210320c0000'])
8975 AT_CHECK([ovs-appctl netdev-dummy/receive p2 '50540000000950540000000a0800450000303b5f40004006e9640a0101020a010101000200017c35468559b5d9405018721074c200007061796c6f61640a'])
8976 AT_CHECK([ovs-appctl netdev-dummy/receive p1 '50540000000a505400000009080045000028a4e7400040067fe40a0101010a0101020001000259b5d9407c35468d5010721032040000'])
8977 AT_CHECK([ovs-appctl netdev-dummy/receive p2 '50540000000950540000000a0800450000283b6040004006e96b0a0101020a010101000200017c35468d59b5d9405011721032030000'])
8978 AT_CHECK([ovs-appctl netdev-dummy/receive p1 '50540000000a505400000009080045000028a4e8400040067fe30a0101010a0101020001000259b5d9407c35468e5010721032030000'])
8979 AT_CHECK([ovs-appctl netdev-dummy/receive p1 '50540000000a505400000009080045000028a4e9400040067fe20a0101010a0101020001000259b5d9407c35468e5011721032020000'])
8980 AT_CHECK([ovs-appctl netdev-dummy/receive p2 '50540000000950540000000a0800450000283b6140004006e96a0a0101020a010101000200017c35468e59b5d9415010721032020000'])
8982 AT_CHECK([ovs-appctl revalidator/purge])
8983 AT_CHECK([ovs-ofctl dump-flows br0 | grep cookie=0x1 | grep -o "n_packets=[[0-9]]*"], [0], [dnl
8984 dnl Only one new connection
8988 AT_CHECK([ovs-appctl netdev-dummy/receive p1 '50540000000a50540000000908004500002cc0a74000400664200a0101010a010102000100025b7dbf1f0000000060027210f5710000020405b4'])
8989 AT_CHECK([ovs-appctl netdev-dummy/receive p2 '50540000000950540000000a08004500002c00004000400624c80a0101020a010101000200017c36468f5b7dbf2060127210329b0000020405b4'])
8990 AT_CHECK([ovs-appctl netdev-dummy/receive p1 '50540000000a505400000009080045000028c0a84000400664230a0101010a010102000100025b7dbf207c364690501072104a580000'])
8991 AT_CHECK([ovs-appctl netdev-dummy/receive p2 '50540000000950540000000a080045000030392840004006eb9b0a0101020a010101000200017c3646905b7dbf20501872108d0e00007061796c6f61640a'])
8992 AT_CHECK([ovs-appctl netdev-dummy/receive p1 '50540000000a505400000009080045000028c0a94000400664220a0101010a010102000100025b7dbf207c364698501072104a500000'])
8993 AT_CHECK([ovs-appctl netdev-dummy/receive p2 '50540000000950540000000a080045000028392940004006eba20a0101020a010101000200017c3646985b7dbf20501172104a4f0000'])
8994 AT_CHECK([ovs-appctl netdev-dummy/receive p1 '50540000000a505400000009080045000028c0aa4000400664210a0101010a010102000100025b7dbf207c364699501072104a4f0000'])
8995 AT_CHECK([ovs-appctl netdev-dummy/receive p1 '50540000000a505400000009080045000028c0ab4000400664200a0101010a010102000100025b7dbf207c364699501172104a4e0000'])
8996 AT_CHECK([ovs-appctl netdev-dummy/receive p2 '50540000000950540000000a080045000028392a40004006eba10a0101020a010101000200017c3646995b7dbf21501072104a4e0000'])
8998 AT_CHECK([ovs-appctl revalidator/purge])
8999 AT_CHECK([ovs-ofctl dump-flows br0 | grep cookie=0x1 | grep -o "n_packets=[[0-9]]*"], [0], [dnl
9000 dnl Two new connections
9007 AT_SETUP([ofproto-dpif - conntrack - tcp pick up])
9010 add_of_ports br0 1 2
9012 AT_CHECK([ovs-appctl vlog/set dpif_netdev:dbg vconn:info ofproto_dpif:info])
9014 dnl Allow new connections on p1->p2. Allow only established connections p2->p1
9015 AT_DATA([flows.txt], [dnl
9018 table=0,priority=100,arp,action=normal
9019 table=0,priority=10,in_port=1,tcp,action=ct(commit,table=1)
9020 table=0,priority=10,in_port=2,tcp,action=ct(table=1)
9021 table=0,priority=1,action=drop
9025 table=1,priority=10,cookie=0x1,ip,ct_state=+trk+inv,action=controller
9026 table=1,priority=1,action=drop
9029 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
9031 AT_CHECK([ovs-appctl revalidator/purge])
9032 AT_CHECK([ovs-ofctl dump-flows br0 | grep cookie=0x1 | grep -o "n_packets=[[0-9]]*"], [0], [dnl
9033 dnl No dropped packets
9037 AT_CAPTURE_FILE([ofctl_monitor.log])
9038 AT_CHECK([ovs-ofctl monitor br0 65534 invalid_ttl -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
9040 dnl The first two packets (SYN, SYN|ACK) are commented out. We're making
9041 dnl sure that the connection tracker is able to pick up already established
9042 dnl connections that use window scaling.
9044 dnl AT_CHECK([ovs-appctl netdev-dummy/receive p1 '50540000000950540000000a080045000030fc2540004006289e0a0101020a01010100020001396bb359000000007002008080cc0000020405b401030307'])
9045 dnl AT_CHECK([ovs-appctl netdev-dummy/receive p2 '50540000000a50540000000908004500003000004000400624c40a0101010a010102000100028cadbdb3396bb35a70120080365a0000020405b401030307'])
9046 AT_CHECK([ovs-appctl netdev-dummy/receive p1 '50540000000950540000000a080045000028fc264000400628a50a0101020a01010100020001396bb35a8cadbdb45010000a629b0000'])
9047 AT_CHECK([ovs-appctl netdev-dummy/receive p1 '50540000000950540000000a080045000029fc274000400628a30a0101020a01010100020001396bb35a8cadbdb45018000a589200000a'])
9048 AT_CHECK([ovs-appctl netdev-dummy/receive p2 '50540000000a505400000009080045000028f2c84000400632030a0101010a010102000100028cadbdb4396bb35b5010000a629a0000'])
9049 AT_CHECK([ovs-appctl netdev-dummy/receive p1 '50540000000950540000000a08004500022afc284000400626a10a0101020a01010100020001396bb35b8cadbdb45018000a941f0000 dnl
9050 666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666 dnl
9051 666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666 dnl
9052 666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666 dnl
9053 666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666 dnl
9054 666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666 dnl
9055 666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666 dnl
9056 666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666 dnl
9057 666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666 dnl
9058 666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666 dnl
9059 6666666666666666666666666666666666666666666666666666660a'])
9060 AT_CHECK([ovs-appctl netdev-dummy/receive p2 '50540000000a505400000009080045000028f2c94000400632020a0101010a010102000100028cadbdb4396bb55d5010000a60980000'])
9061 AT_CHECK([ovs-appctl netdev-dummy/receive p2 '50540000000a5054000000090800450001fdf2ca40004006302c0a0101010a010102000100028cadbdb4396bb55d5018000aa60c0000 dnl
9062 656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565 dnl
9063 656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565 dnl
9064 656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565 dnl
9065 656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565 dnl
9066 656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565 dnl
9067 656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565 dnl
9068 656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565 dnl
9069 656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565 dnl
9070 6565656565656565656565656565656565656565656565656565656565656565656565650a'])
9071 AT_CHECK([ovs-appctl netdev-dummy/receive p1 '50540000000950540000000a080045000028fc294000400628a20a0101020a01010100020001396bb55d8cadbf895010000a5ec30000'])
9072 AT_CHECK([ovs-appctl netdev-dummy/receive p1 '50540000000950540000000a080045000028fc2a4000400628a10a0101020a01010100020001396bb55d8cadbf895011000a5ec20000'])
9073 AT_CHECK([ovs-appctl netdev-dummy/receive p2 '50540000000a505400000009080045000028f2cb4000400632000a0101010a010102000100028cadbf89396bb55e5010000a5ec20000'])
9074 AT_CHECK([ovs-appctl netdev-dummy/receive p2 '50540000000a505400000009080045000028f2cc4000400631ff0a0101010a010102000100028cadbf89396bb55e5011000a5ec10000'])
9075 AT_CHECK([ovs-appctl netdev-dummy/receive p1 '50540000000950540000000a080045000028258e40004006ff3d0a0101020a01010100020001396bb55e8cadbf8a5010000a5ec10000'])
9077 AT_CHECK([ovs-appctl revalidator/purge])
9079 OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
9081 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
9084 AT_CHECK([ovs-ofctl dump-flows br0 | grep cookie=0x1 | grep -o "n_packets=[[0-9]]*"], [0], [dnl
9085 dnl No dropped packets
9092 AT_SETUP([ofproto - set mtu])
9097 # Check that initial MTU is 1500 for 'br0' and 'p1'.
9098 AT_CHECK([ovs-vsctl get Interface br0 mtu], [0], [dnl
9101 AT_CHECK([ovs-vsctl get Interface p1 mtu], [0], [dnl
9105 # Request new MTU for 'p1'
9106 AT_CHECK([ovs-vsctl set Interface p1 mtu_request=1600])
9108 # Check that the new MTU is applied
9109 AT_CHECK([ovs-vsctl --timeout=10 wait-until Interface p1 mtu=1600])
9110 # The internal port 'br0' should have the same MTU value as p1, becase it's
9111 # the new bridge minimum.
9112 AT_CHECK([ovs-vsctl --timeout=10 wait-until Interface br0 mtu=1600])
9114 AT_CHECK([ovs-vsctl del-port br0 p1])
9116 # When 'p1' is deleted, the internal port should return to the default MTU
9117 AT_CHECK([ovs-vsctl --timeout=10 wait-until Interface br0 mtu=1500])
9119 # New port with 'mtu_request' in the same transaction.
9120 AT_CHECK([ovs-vsctl add-port br0 p2 -- set int p2 type=dummy mtu_request=1600])
9121 AT_CHECK([ovs-vsctl --timeout=10 wait-until Interface p2 mtu=1600])
9122 AT_CHECK([ovs-vsctl --timeout=10 wait-until Interface br0 mtu=1600])
9124 # Explicitly set mtu_request on the internal interface. This should prevent
9125 # the MTU from being overriden.
9126 AT_CHECK([ovs-vsctl set int br0 mtu_request=1700])
9127 AT_CHECK([ovs-vsctl --timeout=10 wait-until Interface br0 mtu=1700])
9129 # The new MTU on p2 should not affect br0.
9130 AT_CHECK([ovs-vsctl set int p2 mtu_request=1400])
9131 AT_CHECK([ovs-vsctl --timeout=10 wait-until Interface p2 mtu=1400])
9132 AT_CHECK([ovs-vsctl --timeout=10 wait-until Interface br0 mtu=1700])
9134 # Remove explicit mtu_request from br0. Now it should track the bridge
9136 AT_CHECK([ovs-vsctl set int br0 mtu_request=[[]]])
9137 AT_CHECK([ovs-vsctl --timeout=10 wait-until Interface br0 mtu=1400])
9142 AT_SETUP([ofproto - fragment prerequisites])
9145 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
9149 AT_DATA([flows.txt], [dnl
9150 priority=10,in_port=1,udp,tp_src=67,tp_dst=68,action=drop
9151 priority=1,in_port=1,udp,action=drop
9154 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
9156 AT_CHECK([ovs-vsctl set Open_vSwitch . other_config:max-idle=10000])
9158 ovs-appctl time/stop
9159 AT_CHECK([ovs-appctl netdev-dummy/receive p1 'recirc_id(0),in_port(1),eth_type(0x0800),ipv4(proto=17,frag=later)'])
9160 ovs-appctl time/warp 5000
9162 AT_CHECK([strip_ufid < ovs-vswitchd.log | filter_flow_install | strip_used], [0], [dnl
9163 recirc_id(0),in_port(1),eth_type(0x0800),ipv4(proto=17,frag=later), actions:drop
9166 dnl Change the flow table. This will trigger revalidation of all the flows.
9167 AT_CHECK([ovs-ofctl add-flow br0 priority=5,in_port=1,action=drop])
9168 AT_CHECK([ovs-appctl revalidator/wait], [0])
9170 dnl We don't want revalidators to delete any flow. If the flow has been
9171 dnl deleted it means that there's some inconsistency with the revalidation.
9172 AT_CHECK([grep flow_del ovs-vswitchd.log], [1])