1 AT_BANNER([ofproto-dpif])
3 m4_divert_push([PREPARE_TESTS])
5 # Helper function to check the spread of dp_hash flows over buckets in the datapath
6 check_dpflow_stats () {
10 if [[ $# -eq 3 ]]; then
11 echo "$dpflows" | grep "actions:hash"
12 n_flows=`echo "$dpflows" | grep -c dp_hash`
13 n_buckets=`echo "$dpflows" | grep dp_hash | grep -o "actions:[[0-9]]*" | sort | uniq -c | wc -l`
15 n_flows=`echo "$dpflows" | wc -l`
16 n_buckets=`echo "$dpflows" | grep -o "actions:[[0-9]]*" | sort | uniq -c | wc -l`
18 if [[ $n_flows -ge $min_flows ]]; then flows=ok; else flows=nok; fi
19 if [[ $n_buckets -ge $min_buckets ]]; then buckets=ok; else buckets=nok; fi
20 echo "n_flows=$flows n_buckets=$buckets"
23 m4_divert_pop([PREPARE_TESTS])
26 AT_SETUP([ofproto-dpif - revalidator/wait])
28 AT_CHECK([ovs-appctl revalidator/wait])
32 AT_SETUP([ofproto-dpif - active-backup bonding])
33 # Create br0 with interfaces p1, p2 and p7, creating bond0 with p1 and p2
34 # and br1 with interfaces p3, p4 and p8.
35 # toggle p1,p2 of bond0 up and down to test bonding in active-backup mode.
37 [add-bond br0 bond0 p1 p2 bond_mode=active-backup --\
38 set interface p1 type=dummy options:pstream=punix:$OVS_RUNDIR/p1.sock ofport_request=1 -- \
39 set interface p2 type=dummy options:pstream=punix:$OVS_RUNDIR/p2.sock ofport_request=2 -- \
40 add-port br0 p7 -- set interface p7 ofport_request=7 type=dummy -- \
42 set bridge br1 other-config:hwaddr=aa:66:aa:66:00:00 -- \
43 set bridge br1 datapath-type=dummy other-config:datapath-id=1234 \
45 add-port br1 p3 -- set interface p3 type=dummy options:stream=unix:$OVS_RUNDIR/p1.sock ofport_request=3 -- \
46 add-port br1 p4 -- set interface p4 type=dummy options:stream=unix:$OVS_RUNDIR/p2.sock ofport_request=4 -- \
47 add-port br1 p8 -- set interface p8 ofport_request=8 type=dummy --])
48 WAIT_FOR_DUMMY_PORTS([p3], [p4])
49 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
51 AT_CHECK([ovs-ofctl add-flow br0 action=normal])
52 AT_CHECK([ovs-ofctl add-flow br1 action=normal])
53 ovs-appctl netdev-dummy/set-admin-state up
54 ovs-appctl time/warp 100
55 ovs-appctl netdev-dummy/set-admin-state p2 down
57 ovs-appctl time/warp 100
58 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)'])
59 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)'])
60 ovs-appctl time/warp 100
61 ovs-appctl netdev-dummy/set-admin-state p2 up
62 ovs-appctl netdev-dummy/set-admin-state p1 down
63 ovs-appctl time/warp 100
64 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)'])
65 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)'])
66 ovs-appctl time/warp 200 100
68 AT_CHECK([grep 'in_port([[348]])' ovs-vswitchd.log | filter_flow_install | strip_xout], [0], [dnl
69 recirc_id(0),in_port(3),packet_type(ns=0,id=0),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(frag=no), actions: <del>
70 recirc_id(0),in_port(3),packet_type(ns=0,id=0),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(frag=no), actions: <del>
71 recirc_id(0),in_port(4),packet_type(ns=0,id=0),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0d),eth_type(0x0800),ipv4(frag=no), actions: <del>
72 recirc_id(0),in_port(4),packet_type(ns=0,id=0),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0e),eth_type(0x0800),ipv4(frag=no), actions: <del>
73 recirc_id(0),in_port(4),packet_type(ns=0,id=0),eth(src=50:54:00:00:00:09,dst=ff:ff:ff:ff:ff:ff),eth_type(0x8035), actions: <del>
74 recirc_id(0),in_port(4),packet_type(ns=0,id=0),eth(src=50:54:00:00:00:0b,dst=ff:ff:ff:ff:ff:ff),eth_type(0x8035), actions: <del>
79 AT_SETUP([ofproto-dpif - balance-slb bonding])
80 # Create br0 with interfaces bond0(p1, p2, p3) and p7,
81 # and br1 with interfaces p4, p5, p6 and p8.
82 # p1 <-> p4, p2 <-> p5, p3 <-> p6
83 # Send some traffic, make sure the traffic are spread based on source mac.
85 [add-bond br0 bond0 p1 p2 p3 bond_mode=balance-slb --\
86 set interface p1 type=dummy options:pstream=punix:$OVS_RUNDIR/p1.sock ofport_request=1 -- \
87 set interface p2 type=dummy options:pstream=punix:$OVS_RUNDIR/p2.sock ofport_request=2 -- \
88 set interface p3 type=dummy options:pstream=punix:$OVS_RUNDIR/p3.sock ofport_request=3 -- \
89 add-port br0 p7 -- set interface p7 ofport_request=7 type=dummy -- \
91 set bridge br1 other-config:hwaddr=aa:66:aa:66:00:00 -- \
92 set bridge br1 datapath-type=dummy other-config:datapath-id=1234 \
94 add-port br1 p4 -- set interface p4 type=dummy options:stream=unix:$OVS_RUNDIR/p1.sock ofport_request=4 -- \
95 add-port br1 p5 -- set interface p5 type=dummy options:stream=unix:$OVS_RUNDIR/p2.sock ofport_request=5 -- \
96 add-port br1 p6 -- set interface p6 type=dummy options:stream=unix:$OVS_RUNDIR/p3.sock ofport_request=6 -- \
97 add-port br1 p8 -- set interface p8 ofport_request=8 type=dummy --])
98 WAIT_FOR_DUMMY_PORTS([p4], [p5], [p6])
99 AT_CHECK([ovs-ofctl add-flow br0 action=normal])
100 AT_CHECK([ovs-ofctl add-flow br1 action=normal])
101 AT_CHECK([ovs-appctl netdev-dummy/set-admin-state up], 0, [OK
104 ovs-appctl time/warp 100
106 for i in `seq 0 100 |xargs printf '%02x\n'`;
108 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)"
109 AT_CHECK([ovs-appctl netdev-dummy/receive p7 $pkt])
112 ovs-appctl time/warp 100
113 AT_CHECK([ovs-appctl dpif/dump-flows br1 > br1_flows.txt])
114 # Make sure there is resonable distribution to all three ports.
115 # We don't want to make this check precise, in case hash function changes.
116 AT_CHECK([test `egrep 'in_port\(4\)' br1_flows.txt |wc -l` -gt 3])
117 AT_CHECK([test `egrep 'in_port\(5\)' br1_flows.txt |wc -l` -gt 3])
118 AT_CHECK([test `egrep 'in_port\(6\)' br1_flows.txt |wc -l` -gt 3])
122 AT_SETUP([ofproto-dpif - balance-tcp bonding])
123 # Create br0 with interfaces bond0(p1, p2, p3) and p7,
124 # and br1 with interfaces bond1(p4, p5, p6) and p8.
126 # Send some traffic, make sure the traffic are spread based on L4 headers.
128 [add-bond br0 bond0 p1 p2 p3 bond_mode=balance-tcp lacp=active \
129 other-config:lacp-time=fast other-config:bond-rebalance-interval=0 --\
130 set interface p1 type=dummy options:pstream=punix:$OVS_RUNDIR/p1.sock ofport_request=1 -- \
131 set interface p2 type=dummy options:pstream=punix:$OVS_RUNDIR/p2.sock ofport_request=2 -- \
132 set interface p3 type=dummy options:pstream=punix:$OVS_RUNDIR/p3.sock ofport_request=3 -- \
133 add-port br0 p7 -- set interface p7 ofport_request=7 type=dummy -- \
135 set bridge br1 other-config:hwaddr=aa:66:aa:66:00:00 -- \
136 set bridge br1 datapath-type=dummy other-config:datapath-id=1234 \
137 fail-mode=secure -- \
138 add-bond br1 bond1 p4 p5 p6 bond_mode=balance-tcp lacp=active \
139 other-config:lacp-time=fast other-config:bond-rebalance-interval=0 --\
140 set interface p4 type=dummy options:stream=unix:$OVS_RUNDIR/p1.sock ofport_request=4 -- \
141 set interface p5 type=dummy options:stream=unix:$OVS_RUNDIR/p2.sock ofport_request=5 -- \
142 set interface p6 type=dummy options:stream=unix:$OVS_RUNDIR/p3.sock ofport_request=6 -- \
143 add-port br1 p8 -- set interface p8 ofport_request=8 type=dummy --])
144 AT_CHECK([ovs-appctl netdev-dummy/set-admin-state up], 0, [OK
146 AT_CHECK([ovs-ofctl add-flow br0 action=normal])
147 AT_CHECK([ovs-ofctl add-flow br1 action=normal])
148 AT_CHECK([ovs-appctl upcall/disable-megaflows], [0], [megaflows disabled
150 OVS_WAIT_WHILE([ovs-appctl bond/show | grep "may_enable: false"])
152 ovs-appctl time/warp 100
153 ovs-appctl lacp/show > lacp.txt
154 ovs-appctl bond/show > bond.txt
156 for i in `seq 0 255` ;
158 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)"
159 AT_CHECK([ovs-appctl netdev-dummy/receive p7 $pkt])
162 ovs-appctl time/warp 300 100
163 AT_CHECK([ovs-appctl dpif/dump-flows br0 |grep tcp > br0_flows.txt])
164 AT_CHECK([ovs-appctl dpif/dump-flows br1 |grep tcp > br1_flows.txt])
165 # Make sure there is resonable distribution to all three ports.
166 # We don't want to make this check precise, in case hash function changes.
167 AT_CHECK([test `grep in_port.4 br1_flows.txt |wc -l` -gt 24])
168 AT_CHECK([test `grep in_port.5 br1_flows.txt |wc -l` -gt 24])
169 AT_CHECK([test `grep in_port.6 br1_flows.txt |wc -l` -gt 24])
174 # Makes sure recirculation does not change the way packet is handled.
175 AT_SETUP([ofproto-dpif - balance-tcp bonding, different recirc flow ])
177 [add-bond br0 bond0 p1 p2 bond_mode=balance-tcp lacp=active \
178 other-config:lacp-time=fast other-config:bond-rebalance-interval=0 -- \
179 set interface p1 type=dummy options:pstream=punix:$OVS_RUNDIR/p1.sock ofport_request=1 -- \
180 set interface p2 type=dummy options:pstream=punix:$OVS_RUNDIR/p2.sock ofport_request=2 -- \
182 set bridge br1 other-config:hwaddr=aa:66:aa:66:00:00 -- \
183 set bridge br1 datapath-type=dummy other-config:datapath-id=1234 \
184 fail-mode=standalone -- \
185 add-bond br1 bond1 p3 p4 bond_mode=balance-tcp lacp=active \
186 other-config:lacp-time=fast other-config:bond-rebalance-interval=0 -- \
187 set interface p3 type=dummy options:stream=unix:$OVS_RUNDIR/p1.sock ofport_request=3 -- \
188 set interface p4 type=dummy options:stream=unix:$OVS_RUNDIR/p2.sock ofport_request=4 -- \
189 add-port br1 br1- -- set interface br1- type=patch options:peer=br1+ ofport_request=100 -- \
191 set bridge br-int other-config:hwaddr=aa:77:aa:77:00:00 -- \
192 set bridge br-int datapath-type=dummy other-config:datapath-id=1235 \
193 fail-mode=secure -- \
194 add-port br-int br1+ -- set interface br1+ type=patch options:peer=br1- ofport_request=101 -- \
195 add-port br-int p5 -- set interface p5 ofport_request=5 type=dummy
197 AT_CHECK([ovs-appctl netdev-dummy/set-admin-state up], 0, [OK
200 # Waits for all ifaces enabled.
201 OVS_WAIT_UNTIL([test `ovs-appctl bond/show | grep -- "may_enable: true" | wc -l` -ge 4])
203 # The dl_vlan flow should not be ever matched,
204 # since recirculation should not change the flow handling.
205 AT_DATA([flows.txt], [dnl
206 table=0 priority=1 in_port=5 actions=mod_vlan_vid:1,output(101)
207 table=0 priority=2 in_port=5 dl_vlan=1 actions=drop
209 AT_CHECK([ovs-ofctl add-flows br-int flows.txt])
211 # Sends a packet to trigger recirculation.
212 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)"])
214 # Collects flow stats.
215 AT_CHECK([ovs-appctl revalidator/purge], [0])
217 # Checks the flow stats in br1, should only be one flow with non-zero
218 # 'n_packets' from internal table.
219 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
220 table_id=254, n_packets=1, n_bytes=38, priority=20,recirc_id=0x0,dp_hash=0x0/0xff,actions=output
223 # Checks the flow stats in br-int, should be only one match.
224 AT_CHECK([ovs-ofctl dump-flows br-int | ofctl_strip | sort], [0], [dnl
225 n_packets=1, n_bytes=34, priority=1,in_port=5 actions=mod_vlan_vid:1,output:101
226 priority=2,in_port=5,dl_vlan=1 actions=drop
233 AT_SETUP([ofproto-dpif - resubmit])
235 add_of_ports br0 1 10 11 12 13 14 15 16 17 18 19 20 21
236 AT_DATA([flows.txt], [dnl
237 table=0 in_port=1 priority=1000 icmp actions=output(10),resubmit(2),output(19),resubmit(3),output(21)
238 table=0 in_port=2 priority=1500 icmp actions=output(11),resubmit(,1),output(16),resubmit(2,1),output(18)
239 table=0 in_port=3 priority=2000 icmp actions=output(20)
240 table=1 in_port=1 priority=1000 icmp actions=output(12),resubmit(4,1),output(13),resubmit(3),output(15)
241 table=1 in_port=2 priority=1500 icmp actions=output(17),resubmit(,2)
242 table=1 in_port=3 priority=1500 icmp actions=output(14),resubmit(,2)
244 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
245 AT_CHECK([ovs-appctl ofproto/trace br0 'in_port=p1,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])
246 AT_CHECK([tail -1 stdout], [0],
247 [Datapath actions: 10,11,12,13,14,15,16,17,18,19,20,21
252 AT_SETUP([ofproto-dpif - goto table])
254 add_of_ports br0 1 10 11
255 echo "table=0 in_port=1 actions=output(10),goto_table(1)" > flows.txt
256 for i in `seq 1 63`; do echo "table=$i actions=goto_table($(($i+1)))"; done >> flows.txt
257 echo "table=64 actions=output(11)" >> flows.txt
258 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flows br0 flows.txt])
259 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])
260 AT_CHECK([tail -1 stdout], [0],
261 [Datapath actions: 10,11
266 AT_SETUP([ofproto-dpif - write actions])
268 add_of_ports br0 1 10 11 12 13
269 AT_DATA([flows.txt], [dnl
270 table=0 in_port=1,ip actions=output(10),write_actions(set_field:192.168.3.90->ip_src,output(12)),goto_table(1)
271 table=1 ip actions=write_actions(output(13)),goto_table(2)
272 table=2 ip actions=set_field:192.168.3.91->ip_src,output(11)
274 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flows br0 flows.txt])
275 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])
276 AT_CHECK([tail -2 stdout], [0],
277 [Megaflow: recirc_id=0,eth,ip,in_port=1,nw_src=192.168.0.1,nw_frag=no
278 Datapath actions: 10,set(ipv4(src=192.168.3.91)),11,set(ipv4(src=192.168.3.90)),13
283 AT_SETUP([ofproto-dpif - modify IPv6 Neighbor Solitication (ND)])
285 add_of_ports br0 1 10 11 12 13
286 AT_DATA([flows.txt], [dnl
287 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)
288 table=1 icmp6 actions=write_actions(output(13)),goto_table(2)
289 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)
291 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flows br0 flows.txt])
292 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])
293 AT_CHECK([tail -4 stdout], [0],
294 [Megaflow: recirc_id=0,eth,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
295 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
296 This flow is handled by the userspace slow path because it:
297 - Uses action(s) not supported by datapath.
302 AT_SETUP([ofproto-dpif - clear actions])
304 add_of_ports br0 1 10 11 12
305 AT_DATA([flows.txt], [dnl
306 table=0 in_port=1,ip actions=output(10),write_actions(set_field:192.168.3.90->ip_src,output(12)),goto_table(1)
307 table=1 tcp actions=set_field:91->tp_src,output(11),clear_actions
309 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flows br0 flows.txt])
310 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])
311 AT_CHECK([tail -2 stdout], [0],
312 [Megaflow: recirc_id=0,eth,tcp,in_port=1,nw_frag=no,tp_src=8
313 Datapath actions: 10,set(tcp(src=91)),11
318 AT_SETUP([ofproto-dpif - group chaining])
320 add_of_ports br0 1 10 11
321 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'])
322 AT_CHECK([ovs-ofctl -O OpenFlow12 add-group br0 'group_id=123,type=all,bucket=output:10'])
323 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 'ip actions=group:1234'])
324 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])
325 AT_CHECK([tail -1 stdout], [0],
326 [Datapath actions: set(ipv4(src=192.168.3.90)),10,set(ipv4(src=192.168.0.1)),11
331 AT_SETUP([ofproto-dpif - all group in action list])
333 add_of_ports br0 1 10 11
334 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'])
335 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 'ip actions=group:1234'])
336 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])
337 # Must match on the source address to be able to restore it's value for
339 AT_CHECK([tail -2 stdout], [0],
340 [Megaflow: recirc_id=0,eth,ip,in_port=1,nw_src=192.168.0.1,nw_frag=no
341 Datapath actions: set(ipv4(src=192.168.3.90)),10,set(ipv4(src=192.168.0.1)),11
346 AT_SETUP([ofproto-dpif - indirect group in action list])
348 add_of_ports br0 1 10
349 AT_CHECK([ovs-ofctl -O OpenFlow12 add-group br0 group_id=1234,type=indirect,bucket=output:10])
350 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 'ip actions=group:1234'])
351 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])
352 AT_CHECK([tail -1 stdout], [0],
353 [Datapath actions: 10
358 AT_SETUP([ofproto-dpif - group actions have no effect afterwards])
360 add_of_ports br0 1 10
361 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'])
362 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 'ip actions=group:1234,output:10'])
365 pkt="in_port(1),eth(src=50:54:00:00:00:07,dst=50:54:00:00:00:1),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.1.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)"
366 AT_CHECK([ovs-appctl netdev-dummy/receive p1 $pkt])
369 AT_CHECK([ovs-appctl dpctl/dump-flows | sed 's/dp_hash(.*\/0xf)/dp_hash(0xXXXX\/0xf)/' | sed 's/packets.*actions:/actions:/' | strip_ufid | strip_used | sort], [0], [dnl
370 flow-dump from non-dpdk interfaces:
371 recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth_type(0x0800),ipv4(frag=no), actions:hash(sym_l4(0)),recirc(0x1)
372 recirc_id(0x1),dp_hash(0xXXXX/0xf),in_port(1),packet_type(ns=0,id=0),eth_type(0x0800),ipv4(src=192.168.0.1,frag=no), actions:set(ipv4(src=192.168.3.90)),10,set(ipv4(src=192.168.0.1)),10
378 AT_SETUP([ofproto-dpif - all group in action set])
380 add_of_ports br0 1 10 11
381 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'])
382 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 'ip actions=write_actions(group:1234)'])
383 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])
384 # Must match on the source address to be able to restore it's value for
386 AT_CHECK([tail -2 stdout], [0],
387 [Megaflow: recirc_id=0,eth,ip,in_port=1,nw_src=192.168.0.1,nw_frag=no
388 Datapath actions: set(ipv4(src=192.168.3.90)),10,set(ipv4(src=192.168.0.1)),11
393 AT_SETUP([ofproto-dpif - indirect group in action set])
395 add_of_ports br0 1 10
396 AT_CHECK([ovs-ofctl -O OpenFlow12 add-group br0 group_id=1234,type=indirect,bucket=output:10])
397 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 'ip actions=write_actions(group:1234)'])
398 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])
399 AT_CHECK([tail -1 stdout], [0],
400 [Datapath actions: 10
405 AT_SETUP([ofproto-dpif - patch port with action set])
406 OVS_VSWITCHD_START([ \
408 set bridge br1 datapath-type=dummy fail-mode=secure -- \
409 add-port br0 patch10 -- \
410 set interface patch10 type=patch options:peer=patch20 ofport_request=10 -- \
411 add-port br1 patch20 -- \
412 set interface patch20 type=patch options:peer=patch10 ofport_request=20
416 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br1 'ip actions=write_actions(pop_vlan,output:2)'])
417 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 'ip actions=output:10'])
418 AT_CHECK([ovs-appctl ofproto/trace br1 'in_port=20,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,dl_vlan=100,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])
419 AT_CHECK([tail -1 stdout], [0],
420 [Datapath actions: pop_vlan,2
422 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_vlan=100,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])
423 AT_CHECK([tail -1 stdout], [0],
424 [Datapath actions: pop_vlan,2
430 AT_SETUP([ofproto-dpif - select group])
433 add_of_ports br0 1 10 11
435 ovs-appctl vlog/set ofproto_dpif:file:dbg
436 AT_CHECK([ovs-ofctl -O OpenFlow12 add-group br0 'group_id=1234,type=select,bucket=output:10,bucket=output:11'])
437 AT_CHECK([grep -A6 "Constructing select group 1234" ovs-vswitchd.log | sed 's/^.*ofproto_dpif/ofproto_dpif/'], [0], [dnl
438 ofproto_dpif|DBG|Constructing select group 1234
439 ofproto_dpif|DBG|No selection method specified. Trying dp_hash.
440 ofproto_dpif|DBG| Minimum weight: 1, total weight: 2
441 ofproto_dpif|DBG| Using 16 hash values:
442 ofproto_dpif|DBG| Bucket 0: weight=1, target=8.00 hits=8
443 ofproto_dpif|DBG| Bucket 1: weight=1, target=8.00 hits=8
444 ofproto_dpif|DBG|Use dp_hash with 16 hash values using algorithm 1.
446 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 'ip actions=write_actions(group:1234)'])
448 # Try a bunch of different flows and make sure that they get distributed
449 # # at least somewhat.
451 for s in 1 2 3 4 ; do
452 pkt="in_port(1),eth(src=50:54:00:00:00:07,dst=50:54:00:00:00:1),eth_type(0x0800),ipv4(src=192.168.0.$s,dst=192.168.1.$d,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)"
453 AT_CHECK([ovs-appctl netdev-dummy/receive p1 $pkt])
457 AT_CHECK([ovs-appctl dpctl/dump-flows | sort | strip_ufid | strip_used | check_dpflow_stats 5 2 dp_hash], [0], [dnl
458 recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth_type(0x0800),ipv4(frag=no), packets:15, bytes:1590, used:0.0s, actions:hash(sym_l4(0)),recirc(0x1)
459 n_flows=ok n_buckets=ok
465 AT_SETUP([ofproto-dpif - select group with watch port])
468 add_of_ports br0 1 10 11
469 AT_CHECK([ovs-ofctl -O OpenFlow12 add-group br0 'group_id=1234,type=select,bucket=watch_port:10,output:10,bucket=output:11'])
470 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 'ip actions=write_actions(group:1234)'])
473 pkt="in_port(1),eth(src=50:54:00:00:00:07,dst=50:54:00:00:00:1),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)"
474 AT_CHECK([ovs-appctl netdev-dummy/receive p1 $pkt])
477 AT_CHECK([ovs-appctl dpctl/dump-flows | sort| sed 's/dp_hash(.*\/0xf)/dp_hash(0xXXXX\/0xf)/' | strip_ufid | strip_used], [0], [dnl
478 flow-dump from non-dpdk interfaces:
479 recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth_type(0x0800),ipv4(frag=no), packets:3, bytes:318, used:0.0s, actions:hash(sym_l4(0)),recirc(0x1)
480 recirc_id(0x1),dp_hash(0xXXXX/0xf),in_port(1),packet_type(ns=0,id=0),eth_type(0x0800),ipv4(frag=no), packets:3, bytes:318, used:0.0s, actions:11
486 AT_SETUP([ofproto-dpif - select group with weights])
488 # Helper function to check the accuracy of distribution of packets over buckets
489 check_group_stats () {
490 buckets=`grep -o 'packet_count=[[0-9]]*' | cut -d'=' -f2 | tail -n +2`
492 for bucket in $buckets; do
495 if [[ $bucket -ge $min ]]; then
496 echo "bucket$i >= $min"
498 echo "bucket$i < $min"
501 if [[ $i -ge 4 ]]; then break; fi
506 add_of_ports br0 1 10 11 12 13 14
508 ovs-appctl vlog/set ofproto_dpif:file:dbg
509 AT_CHECK([ovs-ofctl -O OpenFlow13 add-group br0 'group_id=1234,type=select,bucket=weight:5,output:10,bucket=weight:10,output:11,bucket=weight:25,output:12,bucket=weight:60,output:13,bucket=weight:0,output:14'])
510 AT_CHECK([grep -A9 "Constructing select group 1234" ovs-vswitchd.log | sed 's/^.*ofproto_dpif/ofproto_dpif/'], [0], [dnl
511 ofproto_dpif|DBG|Constructing select group 1234
512 ofproto_dpif|DBG|No selection method specified. Trying dp_hash.
513 ofproto_dpif|DBG| Minimum weight: 5, total weight: 100
514 ofproto_dpif|DBG| Using 32 hash values:
515 ofproto_dpif|DBG| Bucket 0: weight=5, target=1.60 hits=2
516 ofproto_dpif|DBG| Bucket 1: weight=10, target=3.20 hits=3
517 ofproto_dpif|DBG| Bucket 2: weight=25, target=8.00 hits=8
518 ofproto_dpif|DBG| Bucket 3: weight=60, target=19.20 hits=19
519 ofproto_dpif|DBG| Bucket 4: weight=0, target=0.00 hits=0
520 ofproto_dpif|DBG|Use dp_hash with 32 hash values using algorithm 1.
522 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 'ip actions=write_actions(group:1234)'])
524 # Try 1000 different flows and make sure that they get distributed according to weights
525 for d1 in 0 1 2 3 4 5 6 7 8 9 ; do
526 for d2 in 0 1 2 3 4 5 6 7 8 9 ; do
527 for s in 0 1 2 3 4 5 6 7 8 9 ; do
528 pkt="in_port(1),eth(src=50:54:00:00:00:07,dst=50:54:00:00:00:1),eth_type(0x0800),ipv4(src=192.168.1.$s,dst=192.168.$d1.$d2,proto=6,tos=0,ttl=128,frag=no),tcp(src=1000$s,dst=1000)"
529 AT_CHECK([ovs-appctl netdev-dummy/receive p1 $pkt])
534 # Check balanced distribution over 32 dp_hash values
535 AT_CHECK([ovs-appctl dpctl/dump-flows | sort | strip_ufid | strip_used | check_dpflow_stats 32 4 dp_hash], [0], [dnl
536 recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth_type(0x0800),ipv4(frag=no), packets:999, bytes:117882, used:0.0s, actions:hash(sym_l4(0)),recirc(0x1)
537 n_flows=ok n_buckets=ok
540 # Check that actual distribution over the buckets is reasonably accurate:
541 ideal weights dp_hash values
542 # bucket0: 5%*1000 = 50 2/32*1000 = 63
543 # bucket1: 10%*1000 = 100 3/32*1000 = 94
544 # bucket2: 25%*1000 = 250 8/32*1000 = 250
545 # bucket3: 60%*1000 = 600 19/32*1000 = 594
548 ovs-appctl time/warp 1000
549 AT_CHECK([ovs-ofctl -O OpenFlow13 dump-group-stats br0 | sed 's/duration=[[0-9]]\.[[0-9]]*s,//' | check_group_stats 40 80 200 500],
560 AT_SETUP([ofproto-dpif - select group with explicit dp_hash selection method])
563 add_of_ports br0 1 10 11
565 ovs-appctl vlog/set ofproto_dpif:file:dbg
566 AT_CHECK([ovs-ofctl -O OpenFlow15 add-group br0 'group_id=1234,type=select,selection_method=dp_hash,bucket=output:10,bucket=output:11'])
567 AT_CHECK([grep -A6 "Constructing select group 1234" ovs-vswitchd.log | sed 's/^.*ofproto_dpif/ofproto_dpif/'], [0], [dnl
568 ofproto_dpif|DBG|Constructing select group 1234
569 ofproto_dpif|DBG|Selection method specified: dp_hash.
570 ofproto_dpif|DBG| Minimum weight: 1, total weight: 2
571 ofproto_dpif|DBG| Using 16 hash values:
572 ofproto_dpif|DBG| Bucket 0: weight=1, target=8.00 hits=8
573 ofproto_dpif|DBG| Bucket 1: weight=1, target=8.00 hits=8
574 ofproto_dpif|DBG|Use dp_hash with 16 hash values using algorithm 0.
577 # Fall back to legacy hash with zero buckets
578 AT_CHECK([ovs-ofctl -O OpenFlow15 add-group br0 'group_id=1235,type=select,selection_method=dp_hash'])
579 AT_CHECK([grep -A3 "Constructing select group 1235" ovs-vswitchd.log | sed 's/^.*ofproto_dpif/ofproto_dpif/'], [0], [dnl
580 ofproto_dpif|DBG|Constructing select group 1235
581 ofproto_dpif|DBG|Selection method specified: dp_hash.
582 ofproto_dpif|DBG| Don't apply dp_hash method without buckets.
583 ofproto_dpif|DBG|Falling back to default hash method.
586 # Fall back to legacy hash with zero buckets
587 AT_CHECK([ovs-ofctl -O OpenFlow15 add-group br0 'group_id=1236,type=select,selection_method=dp_hash,bucket=weight=1,output:10,bucket=weight=1000,output:11'])
588 AT_CHECK([grep -A4 "Constructing select group 1236" ovs-vswitchd.log | sed 's/^.*ofproto_dpif/ofproto_dpif/'], [0], [dnl
589 ofproto_dpif|DBG|Constructing select group 1236
590 ofproto_dpif|DBG|Selection method specified: dp_hash.
591 ofproto_dpif|DBG| Minimum weight: 1, total weight: 1001
592 ofproto_dpif|DBG| Too many hash values required: 1024
593 ofproto_dpif|DBG|Falling back to default hash method.
599 AT_SETUP([ofproto-dpif - select group with legacy hash selection method])
602 add_of_ports br0 1 10 11
604 ovs-appctl vlog/set ofproto_dpif:file:dbg
605 AT_CHECK([ovs-ofctl -O OpenFlow15 add-group br0 'group_id=1234,type=select,selection_method=hash,bucket=output:10,bucket=output:11'])
606 AT_CHECK([grep -A2 "Constructing select group 1234" ovs-vswitchd.log | sed 's/^.*ofproto_dpif/ofproto_dpif/'], [0], [dnl
607 ofproto_dpif|DBG|Constructing select group 1234
608 ofproto_dpif|DBG|Selection method specified: hash.
609 ofproto_dpif|DBG|No hash fields. Falling back to default hash method.
612 AT_CHECK([ovs-ofctl -O OpenFlow15 add-flow br0 'ip actions=write_actions(group:1234)'])
614 # Try 16 flows with differing default hash values.
616 for s in 1 2 3 4 ; do
617 pkt="in_port(1),eth(src=50:54:00:00:00:07,dst=50:54:00:00:00:1),eth_type(0x0800),ipv4(src=192.168.0.$s,dst=192.168.1.$d,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)"
618 AT_CHECK([ovs-appctl netdev-dummy/receive p1 $pkt])
622 # Check that the packets installed 16 data path flows and each of the two
623 # buckets is hit at least once.
624 AT_CHECK([ovs-appctl dpctl/dump-flows | strip_ufid | strip_used | sort | check_dpflow_stats 16 2], [0], [dnl
625 n_flows=ok n_buckets=ok
631 AT_SETUP([ofproto-dpif - select group with custom hash selection method])
634 add_of_ports br0 1 10 11
636 # Check that parse failures after 'fields' parsing work
637 AT_CHECK([ovs-ofctl -O OpenFlow10 add-group br0 'group_id=1,type=select,fields(eth_dst),bukket=output:10'], [1], ,[dnl
638 ovs-ofctl: unknown keyword bukket
641 # Check that fields are rejected without "selection_method=hash".
642 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
643 ovs-ofctl: fields may only be specified with "selection_method=hash"
646 # Check that selection_method_param without selection_method is rejected.
647 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
648 ovs-ofctl: selection_method_param is only allowed with "selection_method"
651 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'])
652 AT_CHECK([ovs-ofctl -O OpenFlow15 add-flow br0 'ip actions=write_actions(group:1234)'])
654 # Try 16 flows with differing custom hash and check that they give rise to
655 # 16 data path flows and each of the two buckets is hit at least once
656 for d in 0 1 2 3 4 5 6 7 8 9 a b c d e f; do
657 pkt="in_port(1),eth(src=50:54:00:00:00:07,dst=50:54:00:00:00:$d),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)"
658 AT_CHECK([ovs-appctl netdev-dummy/receive p1 $pkt])
661 AT_CHECK([ovs-appctl dpctl/dump-flows | strip_ufid | strip_used | sort | check_dpflow_stats 16 2], [0], [dnl
662 n_flows=ok n_buckets=ok
665 AT_CHECK([ovs-appctl revalidator/purge], [0])
667 # Try 16 flows that differ only in fields that are not part of the custom
668 # hash and check that there is only a single datapath flow
669 for d in 0 1 2 3 4 5 6 7 8 9 a b c d e f; do
670 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)"
671 AT_CHECK([ovs-appctl netdev-dummy/receive p1 $pkt])
674 AT_CHECK([ovs-appctl dpctl/dump-flows | grep -c recirc_id], [0], [dnl
681 AT_SETUP([ofproto-dpif - fast failover group])
683 add_of_ports br0 1 10 11
684 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'])
685 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 'ip actions=write_actions(group:1234)'])
686 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])
687 AT_CHECK([tail -1 stdout], [0],
688 [Datapath actions: 10
693 AT_SETUP([ofproto-dpif - group stats single bucket])
695 add_of_ports br0 1 10 11
696 AT_CHECK([ovs-ofctl -O OpenFlow12 add-group br0 'group_id=1234,type=select,bucket=output:10,weight=2000,bucket=output:11,weight=0'])
697 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 'ip actions=write_actions(group:1234)'])
701 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)"
702 AT_CHECK([ovs-appctl netdev-dummy/receive p1 $pkt])
705 AT_CHECK([ovs-appctl revalidator/purge], [0])
706 AT_CHECK([ovs-ofctl -O OpenFlow12 -vwarn dump-group-stats br0], [0], [stdout])
707 AT_CHECK([strip_xids < stdout | sort], [0], [dnl
708 group_id=1234,ref_count=1,packet_count=3,byte_count=318,bucket0:packet_count=3,byte_count=318,bucket1:packet_count=0,byte_count=0
709 OFPST_GROUP reply (OF1.2):
714 AT_SETUP([ofproto-dpif - group stats all buckets])
716 add_of_ports br0 1 10 11
717 AT_CHECK([ovs-ofctl -O OpenFlow12 add-group br0 'group_id=1234,type=all,bucket=output:10,bucket=output:11'])
718 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 'ip actions=write_actions(group:1234)'])
722 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)"
723 AT_CHECK([ovs-appctl netdev-dummy/receive p1 $pkt])
726 AT_CHECK([ovs-appctl revalidator/purge], [0])
727 AT_CHECK([ovs-ofctl -O OpenFlow12 -vwarn dump-group-stats br0], [0], [stdout])
728 AT_CHECK([strip_xids < stdout | sort], [0], [dnl
729 group_id=1234,ref_count=1,packet_count=3,byte_count=318,bucket0:packet_count=3,byte_count=318,bucket1:packet_count=3,byte_count=318
730 OFPST_GROUP reply (OF1.2):
735 AT_SETUP([ofproto-dpif - registers])
737 add_of_ports br0 20 21 22 33 90
738 AT_DATA([flows.txt], [dnl
739 in_port=90 actions=resubmit:2,resubmit:3,resubmit:4,resubmit:91
740 in_port=91 actions=resubmit:5,resubmit:6,resubmit:7,resubmit:92
741 in_port=92 actions=resubmit:8,resubmit:9,resubmit:10,resubmit:11,resubmit:93
742 in_port=93 actions=resubmit:12,resubmit:13,resubmit:14,resubmit:15
744 in_port=2 actions=load:0x000db000->NXM_NX_REG0[[]]
745 in_port=3 actions=load:0xdea->NXM_NX_REG0[[20..31]]
746 in_port=4 actions=load:0xeef->NXM_NX_REG0[[0..11]]
747 in_port=5 actions=move:NXM_NX_REG0[[]]->NXM_NX_REG1[[]]
748 in_port=6 actions=load:0x22222222->NXM_NX_REG2[[]]
749 in_port=7 actions=move:NXM_NX_REG1[[20..31]]->NXM_NX_REG2[[0..11]]
750 in_port=8 actions=move:NXM_NX_REG1[[0..11]]->NXM_NX_REG2[[20..31]]
751 in_port=9,reg0=0xdeadbeef actions=output:20
752 in_port=10,reg1=0xdeadbeef actions=output:21
753 in_port=11,reg2=0xeef22dea actions=output:22
755 dnl Sanilty check all registers
756 in_port=12 actions=load:0x10->NXM_NX_REG0[[]],load:0x11->NXM_NX_REG1[[]],load:0x12->NXM_NX_REG2[[]]
757 in_port=13 actions=load:0x13->NXM_NX_REG3[[]],load:0x14->NXM_NX_REG4[[]],load:0x15->NXM_NX_REG5[[]]
758 in_port=14 actions=load:0x16->NXM_NX_REG6[[]],load:0x17->NXM_NX_REG7[[]]
759 in_port=15,reg0=0x10,reg1=0x11,reg2=0x12,reg3=0x13,reg4=0x14,reg5=0x15,reg6=0x16,reg7=0x17 actions=output:33
762 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
763 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])
764 AT_CHECK([tail -1 stdout], [0],
765 [Datapath actions: 20,21,22,33
770 dnl Tests that the standardized xregs are mapped onto the legacy OVS registers
771 dnl in the manner documented in ovs-ofctl(8).
772 AT_SETUP([ofproto-dpif - extended registers])
774 add_of_ports br0 1 2 3
775 AT_DATA([flows.txt], [dnl
776 table=0 actions=load:0xfedcba9876543210->OXM_OF_PKT_REG1[[]],resubmit(,1)
777 table=1,reg2=0xfedcba98,reg3=0x76543210 actions=2
779 # These low-priority rules shouldn't match. They're here only to make really
780 # sure that the test fails if either of the above rules fails to match.
781 table=0,priority=0 actions=3
782 table=1,priority=0 actions=3
784 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
785 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])
786 AT_CHECK([tail -1 stdout], [0], [Datapath actions: 2
791 dnl Tests that the standardized xxregs are mapped onto the legacy OVS
792 dnl registers in the manner documented in ovs-ofctl(8).
793 AT_SETUP([ofproto-dpif - extended-extended registers])
795 add_of_ports br0 1 2 3
796 AT_DATA([flows.txt], [dnl
797 table=0 actions=load:0x0123456789abcdeffedcba9876543210->NXM_NX_XXREG1[[]],resubmit(,1)
798 table=1,reg4=0x01234567,reg5=0x89abcdef,reg6=0xfedcba98,reg7=0x76543210 actions=2
800 # These low-priority rules shouldn't match. They're here only to make really
801 # sure that the test fails if either of the above rules fails to match.
802 table=0,priority=0 actions=3
803 table=1,priority=0 actions=3
805 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
806 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])
807 AT_CHECK([tail -1 stdout], [0], [Datapath actions: 2
812 AT_SETUP([ofproto-dpif - load and move order])
814 add_of_ports br0 1 10 11
815 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'])
816 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)'])
817 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])
818 AT_CHECK([tail -2 stdout], [0],
819 [Megaflow: recirc_id=0,eth,ip,in_port=1,nw_src=192.168.0.1,nw_frag=no
820 Datapath actions: set(ipv4(src=255.255.255.255)),10,set(ipv4(src=192.168.0.1)),11
825 dnl Tests that 1.5 copy-field can copy into the standardized xregs.
826 AT_SETUP([ofproto-dpif - copy-field into extended registers])
828 add_of_ports br0 1 2 3
829 AT_DATA([flows.txt], [dnl
830 table=0 actions=move:OXM_OF_ETH_SRC[[0..47]]->OXM_OF_PKT_REG0[[0..47]],goto_table(1)
831 table=1,xreg0=0x0000505400000005 actions=2
833 # These low-priority rules shouldn't match. They're here only to make really
834 # sure that the test fails if either of the above rules fails to match.
835 table=0,priority=0 actions=3
836 table=1,priority=0 actions=3
838 AT_CHECK([ovs-ofctl -O OpenFlow15 add-flows br0 flows.txt])
839 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])
840 AT_CHECK([tail -1 stdout], [0], [Datapath actions: 2
845 dnl Tests that 1.5 set-field with mask in the metadata register.
846 AT_SETUP([ofproto-dpif - masked set-field into metadata])
848 add_of_ports br0 1 2 3
849 AT_DATA([flows.txt], [dnl
850 table=0 actions=set_field:0xfafafafa5a5a5a5a->metadata,goto_table(1)
851 table=1 actions=set_field:0x6b/0xff->metadata,goto_table(2)
852 table=2,metadata=0xfafafafa5a5a5a6b actions=2
854 # These low-priority rules shouldn't match. They're here only to make really
855 # sure that the test fails if either of the above rules fails to match.
856 table=0,priority=0 actions=3
857 table=1,priority=0 actions=3
858 table=2,priority=0 actions=3
860 AT_CHECK([ovs-ofctl -O OpenFlow15 add-flows br0 flows.txt])
861 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])
862 AT_CHECK([tail -1 stdout], [0], [Datapath actions: 2
868 AT_SETUP([ofproto-dpif - actset_output])
870 add_of_ports br0 1 2 3 4 5 6 7 8 9 10 11 12 13
871 AT_DATA([flows.txt], [dnl
872 table=0,actset_output=unset actions=write_actions(output(2)),goto_table(1)
873 table=1 actions=move:ONFOXM_ET_ACTSET_OUTPUT[[0..31]]->OXM_OF_PKT_REG0[[0..31]],goto_table(2)
875 # Verify that actset_output got set.
876 table=2,priority=20,actset_output=2 actions=4,goto_table(3)
877 table=2,priority=10 actions=5,goto_table(3)
879 # Verify that xreg0 got copied properly from actset_output.
880 table=3,priority=20,xreg0=2 actions=6,goto_table(4)
881 table=3,priority=10 actions=7,goto_table(4)
883 # Verify that xxreg0 got copied properly from actset_output.
884 table=3,priority=20,xxreg0=2 actions=6,goto_table(4)
885 table=3,priority=10 actions=7,goto_table(4)
887 # Verify that adding a group action unsets actset_output,
888 # even if output follows group.
889 table=4 actions=write_actions(group(5),output(10)),goto_table(5)
890 table=5,priority=20,actset_output=unset actions=8,goto_table(6)
891 table=5,priority=10 actions=9,goto_table(6)
893 # Verify that adding another output action doesn't change actset_output
894 # (since there's still a group).
895 table=6 actions=write_actions(output(3)),goto_table(7)
896 table=7,priority=20,actset_output=unset actions=10,goto_table(8)
897 table=7,priority=10 actions=11,goto_table(8)
899 # Verify that clearing the action set, then writing an output action,
900 # causes actset_output to be set again.
901 table=8,actions=clear_actions,write_actions(output(3),output(2)),goto_table(9)
902 table=9,priority=20,actset_output=2 actions=12
903 table=9,priority=10 actions=13
905 AT_CHECK([ovs-ofctl -O OpenFlow13 add-group br0 'group_id=5,type=all,bucket=output:1'])
906 AT_CHECK([ovs-ofctl -O OpenFlow13 add-flows br0 flows.txt])
907 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])
908 AT_CHECK([tail -1 stdout], [0], [Datapath actions: 4,6,8,10,12,2
913 AT_SETUP([ofproto-dpif - push-pop])
915 add_of_ports br0 20 21 22 33 90
916 AT_DATA([flows.txt], [dnl
917 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
918 in_port=2 actions=pop:NXM_NX_REG0[[0..7]],output:NXM_NX_REG0[[]]
919 in_port=3 actions=pop:NXM_NX_REG1[[0..7]],output:NXM_NX_REG1[[]]
920 in_port=4 actions=pop:NXM_NX_REG2[[0..15]],output:NXM_NX_REG2[[]]
921 in_port=5 actions=pop:NXM_NX_REG3[[]],output:NXM_NX_REG3[[]]
924 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
925 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])
926 AT_CHECK([tail -1 stdout], [0],
927 [Datapath actions: 33,22,21,20
932 AT_SETUP([ofproto-dpif - output])
934 add_of_ports br0 1 9 10 11 55 66 77 88
935 AT_DATA([flows.txt], [dnl
936 in_port=1 actions=resubmit:2,resubmit:3,resubmit:4,resubmit:5,resubmit:6,resubmit:7,resubmit:8
937 in_port=2 actions=output:9
938 in_port=3 actions=load:55->NXM_NX_REG0[[]],output:NXM_NX_REG0[[]],load:66->NXM_NX_REG1[[]]
939 in_port=4 actions=output:10,output:NXM_NX_REG0[[]],output:NXM_NX_REG1[[]],output:11
940 in_port=5 actions=load:77->NXM_NX_REG0[[0..15]],load:88->NXM_NX_REG0[[16..31]]
941 in_port=6 actions=output:NXM_NX_REG0[[0..15]],output:NXM_NX_REG0[[16..31]]
942 in_port=7 actions=load:0x110000ff->NXM_NX_REG0[[]],output:NXM_NX_REG0[[]]
943 in_port=8 actions=1,9,load:9->NXM_OF_IN_PORT[[]],1,9
945 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
946 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])
947 AT_CHECK([tail -1 stdout], [0],
948 [Datapath actions: 9,55,10,55,66,11,77,88,9,1
953 AT_SETUP([ofproto-dpif - dec_ttl])
955 add_of_ports br0 1 2 3 4
956 AT_DATA([flows.txt], [dnl
957 table=0 in_port=1 action=dec_ttl,output:2,resubmit(1,1),output:4
958 table=1 in_port=1 action=dec_ttl,output:3
960 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
961 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])
962 AT_CHECK([tail -4 stdout], [0], [
963 Final flow: ip,in_port=1,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
964 Megaflow: recirc_id=0,eth,ip,in_port=1,nw_ttl=2,nw_frag=no
965 Datapath actions: set(ipv4(ttl=1)),2,userspace(pid=0,controller(reason=2,dont_send=0,continuation=0,recirc_id=1,rule_cookie=0,controller_id=0,max_len=65535)),4
967 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])
968 AT_CHECK([tail -2 stdout], [0],
969 [Megaflow: recirc_id=0,eth,ip,in_port=1,nw_ttl=3,nw_frag=no
970 Datapath actions: set(ipv4(ttl=2)),2,set(ipv4(ttl=1)),3,4
972 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])
973 AT_CHECK([tail -2 stdout], [0],
974 [Megaflow: recirc_id=0,eth,ipv6,in_port=1,nw_ttl=128,nw_frag=no
975 Datapath actions: set(ipv6(hlimit=127)),2,set(ipv6(hlimit=126)),3,4
978 AT_CAPTURE_FILE([ofctl_monitor.log])
979 AT_CHECK([ovs-ofctl -P nxt_packet_in monitor br0 65534 invalid_ttl --detach --no-chdir --pidfile 2> ofctl_monitor.log])
981 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=111,tos=0,ttl=2,frag=no)'
983 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
984 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
985 NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=34 in_port=1 (via invalid_ttl) data_len=34 (unbuffered)
986 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
991 dnl A dec_ttl action at offset 32 in ofpacts will cause the ofpacts
992 dnl buffer to be resized just before pushing the id of the dec_ttl action.
993 dnl Thus the implementation must account for this by using the
994 dnl reallocated buffer rather than the original buffer.
996 dnl A number of similar rules are added to try and exercise
997 dnl xrealloc sufficiently that it returns a different base pointer
998 AT_SETUP([ofproto-dpif - dec_ttl without arguments at offset 32 in ofpacts])
1001 (for i in `seq 0 255`; do
1002 printf "dl_src=10:11:11:11:11:%02x actions=output:1,output:1,output:1,dec_ttl,controller\n" $i
1004 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
1008 dnl A dec_ttl action at offset 32 in ofpacts will cause the ofpacts
1009 dnl buffer to be resized just before pushing the id of the dec_ttl action.
1010 dnl Thus the implementation must account for this by using the
1011 dnl reallocated buffer rather than the original buffer.
1013 dnl A number of similar rules are added to try and exercise
1014 dnl xrealloc sufficiently that it returns a different base pointer
1015 AT_SETUP([ofproto-dpif - dec_ttl with arguments at offset 32 in ofpacts])
1018 (for i in `seq 0 255`; do
1019 printf "dl_src=10:11:11:11:11:%02x actions=output:1,output:1,output:1,dec_ttl(1),controller\n" $i
1021 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
1025 dnl A note action at offset 24 in ofpacts will cause the ofpacts
1026 dnl buffer to be resized just before pushing the id of the dec_ttl action.
1027 dnl Thus the implementation must account for this by using the
1028 dnl reallocated buffer rather than the original buffer.
1030 dnl A number of similar rules are added to try and exercise
1031 dnl xrealloc sufficiently that it returns a different base pointer
1032 AT_SETUP([ofproto-dpif - note at offset 24 in ofpacts])
1035 (for i in `seq 0 255`; do
1036 printf "dl_src=10:11:11:11:11:%02x actions=output:1,output:1,note:ff,controller\n" $i
1038 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
1042 dnl As of OVS-2.5, a note action after 4 set_field actions are likely to
1043 dnl trigger ofpbuf reallocation during decode (~1KB into ofpacts buffer).
1044 dnl Using `make check-valgrind' here checks for use-after-free in this
1046 AT_SETUP([ofproto-dpif - note action deep inside ofpacts])
1048 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'])
1052 AT_SETUP([ofproto-dpif - output, OFPP_NONE ingress port])
1054 add_of_ports br0 1 2
1056 AT_CHECK([ovs-ofctl add-flow br0 action=normal])
1058 # "in_port" defaults to OFPP_NONE if it's not specified.
1059 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"
1060 AT_CHECK([ovs-appctl ofproto/trace br0 "$flow"], [0], [stdout])
1061 AT_CHECK([tail -1 stdout | sed 's/Datapath actions: //' | tr "," "\n" | sort -n], [0], [dnl
1070 AT_SETUP([ofproto-dpif - DSCP])
1071 OVS_VSWITCHD_START([add-port br0 p1 -- set Interface p1 type=dummy])
1073 AT_DATA([flows.txt], [dnl
1074 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
1076 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
1077 AT_CHECK([ovs-vsctl -- \
1078 set Port p1 qos=@newqos --\
1079 --id=@newqos create QoS type=linux-htb queues=1=@q1,2=@q2 --\
1080 --id=@q1 create Queue dscp=1 --\
1081 --id=@q2 create Queue dscp=2], [0], [ignore])
1082 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])
1083 AT_CHECK([tail -2 stdout], [0],
1084 [Megaflow: recirc_id=0,skb_priority=0,eth,ip,in_port=9,nw_tos=252,nw_frag=no
1085 Datapath actions: dnl
1087 set(ipv4(tos=0x4/0xfc)),set(skb_priority(0x1)),1,dnl
1088 set(ipv4(tos=0x8/0xfc)),set(skb_priority(0x2)),1,dnl
1090 set(ipv4(tos=0x4/0xfc)),set(skb_priority(0x1)),1,dnl
1091 set(ipv4(tos=0xfc/0xfc)),set(skb_priority(0)),1,dnl
1092 set(ipv4(tos=0/0xfc)),1,100
1097 AT_SETUP([ofproto-dpif - output/flood flags])
1099 add_of_ports br0 1 2 3 4 5 6 7
1101 AT_DATA([flows.txt], [dnl
1102 in_port=local actions=local,flood
1103 in_port=1 actions=flood
1104 in_port=2 actions=all
1105 in_port=3 actions=output:LOCAL,output:1,output:2,output:3,output:4,output:5,output:6,output:7
1106 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
1108 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
1109 AT_CHECK([ovs-ofctl mod-port br0 5 noforward])
1110 AT_CHECK([ovs-ofctl mod-port br0 6 noflood])
1112 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])
1113 AT_CHECK([tail -1 stdout \
1114 | sed -e 's/Datapath actions: //' | tr ',' '\n' | sort], [0], [dnl
1122 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])
1123 AT_CHECK([tail -1 stdout \
1124 | sed -e 's/Datapath actions: //' | tr ',' '\n' | sort], [0], [dnl
1132 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])
1133 AT_CHECK([tail -1 stdout \
1134 | sed -e 's/Datapath actions: //' | tr ',' '\n' | sort], [0], [dnl
1143 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])
1144 AT_CHECK([tail -1 stdout], [0],
1145 [Datapath actions: 100,1,2,4,6,7
1148 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])
1149 AT_CHECK([tail -1 stdout], [0],
1150 [Datapath actions: set(skb_priority(0x1)),100,1,2,set(skb_priority(0x2)),3,set(skb_priority(0x1)),6,7
1155 AT_SETUP([ofproto-dpif - Default Table Miss - OF1.0 (OFPTC_TABLE_MISS_CONTROLLER)])
1156 OVS_VSWITCHD_START([dnl
1157 add-port br0 p1 -- set Interface p1 type=dummy
1159 on_exit 'kill `cat ovs-ofctl.pid`'
1161 AT_CAPTURE_FILE([ofctl_monitor.log])
1163 AT_CHECK([ovs-ofctl -P nxt_packet_in monitor br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
1166 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)'
1168 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1169 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
1170 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1171 NXT_PACKET_IN (xid=0x0): cookie=0x0 total_len=54 in_port=1 (via no_match) data_len=54 (unbuffered)
1172 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
1174 NXT_PACKET_IN (xid=0x0): cookie=0x0 total_len=54 in_port=1 (via no_match) data_len=54 (unbuffered)
1175 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
1177 NXT_PACKET_IN (xid=0x0): cookie=0x0 total_len=54 in_port=1 (via no_match) data_len=54 (unbuffered)
1178 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
1181 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
1182 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1189 AT_SETUP([ofproto-dpif - Default Table Miss - OF1.3 (OFPTC_TABLE_MISS_DROP)])
1190 OVS_VSWITCHD_START([dnl
1191 add-port br0 p1 -- set Interface p1 type=dummy
1193 on_exit 'kill `cat ovs-ofctl.pid`'
1195 AT_CAPTURE_FILE([ofctl_monitor.log])
1196 AT_CHECK([ovs-ofctl del-flows br0])
1198 AT_CHECK([ovs-ofctl monitor -OOpenFlow13 -P standard br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
1200 dnl Test that missed packets are dropped
1202 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)'
1204 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
1206 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1209 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
1210 AT_CHECK([ovs-ofctl -OOpenFlow13 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1211 OFPST_FLOW reply (OF1.3):
1217 AT_SETUP([ofproto-dpif - Table Miss - goto table and OFPTC_TABLE_MISS_CONTROLLER])
1218 OVS_VSWITCHD_START([dnl
1219 add-port br0 p1 -- set Interface p1 type=dummy
1221 on_exit 'kill `cat ovs-ofctl.pid`'
1223 AT_CAPTURE_FILE([ofctl_monitor.log])
1224 AT_CHECK([ovs-ofctl -OOpenFlow12 add-flow br0 'table=0 actions=goto_table(1)'])
1226 AT_CHECK([ovs-ofctl monitor -P standard br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
1229 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)'
1231 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1232 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
1233 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1234 OFPT_PACKET_IN (xid=0x0): total_len=54 in_port=1 (via no_match) data_len=54 (unbuffered)
1235 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
1237 OFPT_PACKET_IN (xid=0x0): total_len=54 in_port=1 (via no_match) data_len=54 (unbuffered)
1238 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
1240 OFPT_PACKET_IN (xid=0x0): total_len=54 in_port=1 (via no_match) data_len=54 (unbuffered)
1241 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
1244 AT_CHECK([ovs-appctl revalidator/purge], [0])
1245 AT_CHECK([ovs-ofctl -OOpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1246 n_packets=3, n_bytes=162, actions=goto_table:1
1247 OFPST_FLOW reply (OF1.2):
1253 AT_SETUP([ofproto-dpif - Table Miss - resubmit and OFPTC_TABLE_MISS_CONTROLLER])
1254 OVS_VSWITCHD_START([dnl
1255 add-port br0 p1 -- set Interface p1 type=dummy
1257 on_exit 'kill `cat ovs-ofctl.pid`'
1259 AT_CAPTURE_FILE([ofctl_monitor.log])
1260 AT_CHECK([ovs-ofctl -OOpenFlow12 add-flow br0 'table=0 actions=resubmit(1,1)'])
1262 AT_CHECK([ovs-ofctl monitor -P standard br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
1265 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)'
1268 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
1269 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1272 AT_CHECK([ovs-appctl revalidator/purge], [0])
1273 AT_CHECK([ovs-ofctl -OOpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1274 n_packets=3, n_bytes=354, actions=resubmit(1,1)
1275 OFPST_FLOW reply (OF1.2):
1281 AT_SETUP([ofproto-dpif - Table Miss - OFPTC_TABLE_MISS_CONTINUE])
1282 OVS_VSWITCHD_START([dnl
1283 add-port br0 p1 -- set Interface p1 type=dummy
1285 on_exit 'kill `cat ovs-ofctl.pid`'
1287 AT_CAPTURE_FILE([ofctl_monitor.log])
1288 AT_CHECK([ovs-ofctl add-flow br0 'table=1 dl_src=10:11:11:11:11:11 actions=controller'])
1289 AT_CHECK([ovs-ofctl -OOpenFlow11 mod-table br0 all continue])
1291 dnl Miss table 0, Hit table 1
1292 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
1295 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)'
1297 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1298 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
1300 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1301 NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=118 in_port=1 (via action) data_len=118 (unbuffered)
1302 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:4a2c
1304 NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=118 in_port=1 (via action) data_len=118 (unbuffered)
1305 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:4a2c
1307 NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=118 in_port=1 (via action) data_len=118 (unbuffered)
1308 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:4a2c
1311 dnl Hit table 0, Miss all other tables, sent to controller
1312 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
1315 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)'
1317 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1318 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
1320 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1321 NXT_PACKET_IN (xid=0x0): table_id=253 cookie=0x0 total_len=118 in_port=1 (via no_match) data_len=118 (unbuffered)
1322 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:4a2c
1324 NXT_PACKET_IN (xid=0x0): table_id=253 cookie=0x0 total_len=118 in_port=1 (via no_match) data_len=118 (unbuffered)
1325 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:4a2c
1327 NXT_PACKET_IN (xid=0x0): table_id=253 cookie=0x0 total_len=118 in_port=1 (via no_match) data_len=118 (unbuffered)
1328 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:4a2c
1331 AT_CHECK([ovs-appctl revalidator/purge], [0])
1332 AT_CHECK([ovs-ofctl -OOpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1333 table=1, n_packets=3, n_bytes=354, dl_src=10:11:11:11:11:11 actions=CONTROLLER:65535
1334 OFPST_FLOW reply (OF1.2):
1340 AT_SETUP([ofproto-dpif - Table Miss - goto table and OFPTC_TABLE_MISS_CONTINUE])
1341 OVS_VSWITCHD_START([dnl
1342 add-port br0 p1 -- set Interface p1 type=dummy
1344 on_exit 'kill `cat ovs-ofctl.pid`'
1346 AT_CAPTURE_FILE([ofctl_monitor.log])
1347 AT_DATA([flows.txt], [dnl
1348 table=0 actions=goto_table(1)
1349 table=2 dl_src=10:11:11:11:11:11 actions=controller
1351 AT_CHECK([ovs-ofctl -OOpenFlow12 add-flows br0 flows.txt])
1352 AT_CHECK([ovs-ofctl -OOpenFlow11 mod-table br0 all continue])
1354 dnl Hit table 0, Miss table 1, Hit table 2
1355 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
1358 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)'
1360 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1361 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1363 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1364 NXT_PACKET_IN (xid=0x0): table_id=2 cookie=0x0 total_len=118 in_port=1 (via action) data_len=118 (unbuffered)
1365 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:4a2c
1367 NXT_PACKET_IN (xid=0x0): table_id=2 cookie=0x0 total_len=118 in_port=1 (via action) data_len=118 (unbuffered)
1368 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:4a2c
1370 NXT_PACKET_IN (xid=0x0): table_id=2 cookie=0x0 total_len=118 in_port=1 (via action) data_len=118 (unbuffered)
1371 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:4a2c
1374 dnl Hit table 1, Miss all other tables, sent to controller
1375 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
1378 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)'
1380 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1381 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
1383 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1384 NXT_PACKET_IN (xid=0x0): table_id=253 cookie=0x0 total_len=118 in_port=1 (via no_match) data_len=118 (unbuffered)
1385 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:4a2c
1387 NXT_PACKET_IN (xid=0x0): table_id=253 cookie=0x0 total_len=118 in_port=1 (via no_match) data_len=118 (unbuffered)
1388 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:4a2c
1390 NXT_PACKET_IN (xid=0x0): table_id=253 cookie=0x0 total_len=118 in_port=1 (via no_match) data_len=118 (unbuffered)
1391 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:4a2c
1394 AT_CHECK([ovs-appctl revalidator/purge], [0])
1395 AT_CHECK([ovs-ofctl -OOpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1396 n_packets=6, n_bytes=708, actions=goto_table:1
1397 table=2, n_packets=3, n_bytes=354, dl_src=10:11:11:11:11:11 actions=CONTROLLER:65535
1398 OFPST_FLOW reply (OF1.2):
1404 AT_SETUP([ofproto-dpif - Table Miss - resubmit and OFPTC_TABLE_MISS_CONTINUE])
1405 OVS_VSWITCHD_START([dnl
1406 add-port br0 p1 -- set Interface p1 type=dummy
1408 on_exit 'kill `cat ovs-ofctl.pid`'
1410 AT_CAPTURE_FILE([ofctl_monitor.log])
1411 AT_DATA([flows.txt], [dnl
1412 table=0 actions=resubmit(1,1)
1413 table=2 dl_src=10:11:11:11:11:11 actions=controller
1415 AT_CHECK([ovs-ofctl -OOpenFlow12 add-flows br0 flows.txt])
1416 AT_CHECK([ovs-ofctl -OOpenFlow11 mod-table br0 all continue])
1418 dnl Hit table 0, Miss table 1, Dropped
1419 AT_CHECK([ovs-ofctl monitor br0 65534 -P standard --detach --no-chdir --pidfile 2> ofctl_monitor.log])
1422 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)'
1424 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1426 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1429 dnl Hit table 1, Dropped
1430 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
1433 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)'
1435 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
1437 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1440 AT_CHECK([ovs-appctl revalidator/purge], [0])
1441 AT_CHECK([ovs-ofctl -OOpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1442 n_packets=6, n_bytes=708, actions=resubmit(1,1)
1443 table=2, dl_src=10:11:11:11:11:11 actions=CONTROLLER:65535
1444 OFPST_FLOW reply (OF1.2):
1450 AT_SETUP([ofproto-dpif - Table Miss - OFPTC_TABLE_MISS_DROP])
1451 OVS_VSWITCHD_START([dnl
1452 add-port br0 p1 -- set Interface p1 type=dummy
1454 on_exit 'kill `cat ovs-ofctl.pid`'
1456 AT_CAPTURE_FILE([ofctl_monitor.log])
1457 AT_CHECK([ovs-ofctl -OOpenFlow11 mod-table br0 all drop])
1459 AT_CHECK([ovs-ofctl monitor -P standard br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
1461 dnl Test that missed packets are dropped
1463 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)'
1465 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
1467 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1470 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
1471 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1478 AT_SETUP([ofproto-dpif - Table Miss - goto table and OFPTC_TABLE_MISS_DROP])
1479 OVS_VSWITCHD_START([dnl
1480 add-port br0 p1 -- set Interface p1 type=dummy
1482 on_exit 'kill `cat ovs-ofctl.pid`'
1484 AT_CAPTURE_FILE([ofctl_monitor.log])
1485 AT_CHECK([ovs-ofctl del-flows br0])
1486 AT_CHECK([ovs-ofctl -OOpenFlow12 add-flow br0 'table=0 actions=goto_table(1)'])
1487 AT_CHECK([ovs-ofctl -OOpenFlow11 mod-table br0 all drop])
1489 AT_CHECK([ovs-ofctl monitor -P standard br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
1491 dnl Test that missed packets are dropped
1493 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)'
1495 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
1497 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1500 AT_CHECK([ovs-appctl revalidator/purge], [0])
1501 AT_CHECK([ovs-ofctl -OOpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1502 n_packets=3, n_bytes=354, actions=goto_table:1
1503 OFPST_FLOW reply (OF1.2):
1509 AT_SETUP([ofproto-dpif - Table Miss - resubmit and OFPTC_TABLE_MISS_DROP])
1510 OVS_VSWITCHD_START([dnl
1511 add-port br0 p1 -- set Interface p1 type=dummy
1513 on_exit 'kill `cat ovs-ofctl.pid`'
1515 AT_CAPTURE_FILE([ofctl_monitor.log])
1516 AT_CHECK([ovs-ofctl del-flows br0])
1517 AT_CHECK([ovs-ofctl -OOpenFlow12 add-flow br0 'table=0 actions=resubmit(1,1)'])
1518 AT_CHECK([ovs-ofctl -OOpenFlow11 mod-table br0 all drop])
1520 AT_CHECK([ovs-ofctl monitor -P standard br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
1522 dnl Test that missed packets are dropped
1524 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)'
1526 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
1528 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1531 AT_CHECK([ovs-appctl revalidator/purge], [0])
1532 AT_CHECK([ovs-ofctl -OOpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1533 n_packets=3, n_bytes=354, actions=resubmit(1,1)
1534 OFPST_FLOW reply (OF1.2):
1540 AT_SETUP([ofproto-dpif - controller])
1541 OVS_VSWITCHD_START([dnl
1542 add-port br0 p1 -- set Interface p1 type=dummy
1544 on_exit 'kill `cat ovs-ofctl.pid`'
1546 AT_CAPTURE_FILE([ofctl_monitor.log])
1547 AT_DATA([flows.txt], [dnl
1548 cookie=0x0 dl_src=10:11:11:11:11:11 actions=controller
1549 cookie=0x1 dl_src=20:22:22:22:22:22 actions=controller,resubmit(80,1)
1550 cookie=0x2 dl_src=30:33:33:33:33:33 actions=mod_vlan_vid:15,controller
1552 cookie=0x3 table=1 in_port=80 actions=load:1->NXM_NX_REG0[[]],mod_vlan_vid:80,controller,resubmit(81,2)
1553 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)
1554 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)
1555 cookie=0x6 table=4 in_port=83 actions=load:4->NXM_NX_REG3[[]],mod_nw_src:83.83.83.83,controller,resubmit(84,5)
1556 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)
1557 cookie=0x8 table=6 in_port=85 actions=mod_tp_src:85,controller,resubmit(86,7)
1558 cookie=0x9 table=7 in_port=86 actions=mod_tp_dst:86,controller,controller
1559 cookie=0xa dl_src=40:44:44:44:44:41 actions=mod_vlan_vid:99,mod_vlan_pcp:1,controller
1560 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
1562 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
1565 AT_CHECK([ovs-ofctl monitor -P standard br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
1568 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)'
1570 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1571 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1573 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1574 OFPT_PACKET_IN (xid=0x0): total_len=118 in_port=1 (via no_match) data_len=118 (unbuffered)
1575 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:4a2c
1577 OFPT_PACKET_IN (xid=0x0): total_len=118 in_port=1 (via no_match) data_len=118 (unbuffered)
1578 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:4a2c
1580 OFPT_PACKET_IN (xid=0x0): total_len=118 in_port=1 (via no_match) data_len=118 (unbuffered)
1581 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:4a2c
1584 dnl Singleton controller action.
1585 AT_CHECK([ovs-ofctl monitor -P standard br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
1588 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)'
1590 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1591 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1593 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1594 OFPT_PACKET_IN (xid=0x0): total_len=54 in_port=1 (via action) data_len=54 (unbuffered)
1595 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
1596 OFPT_PACKET_IN (xid=0x0): total_len=54 in_port=1 (via action) data_len=54 (unbuffered)
1597 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
1598 OFPT_PACKET_IN (xid=0x0): total_len=54 in_port=1 (via action) data_len=54 (unbuffered)
1599 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
1602 dnl Modified controller action.
1603 AT_CHECK([ovs-ofctl monitor -P standard br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
1606 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)'
1608 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1609 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1611 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1612 OFPT_PACKET_IN (xid=0x0): total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
1613 tcp,dl_vlan=15,dl_vlan_pcp=0,vlan_tci1=0x0000,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
1615 OFPT_PACKET_IN (xid=0x0): total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
1616 tcp,dl_vlan=15,dl_vlan_pcp=0,vlan_tci1=0x0000,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
1618 OFPT_PACKET_IN (xid=0x0): total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
1619 tcp,dl_vlan=15,dl_vlan_pcp=0,vlan_tci1=0x0000,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
1622 dnl Modified VLAN controller action.
1623 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
1626 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)'
1628 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1629 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1631 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1632 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=38 in_port=1 (via action) data_len=38 (unbuffered)
1633 ip,dl_vlan=99,dl_vlan_pcp=1,vlan_tci1=0x0000,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
1635 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=38 in_port=1 (via action) data_len=38 (unbuffered)
1636 ip,dl_vlan=99,dl_vlan_pcp=1,vlan_tci1=0x0000,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
1638 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=38 in_port=1 (via action) data_len=38 (unbuffered)
1639 ip,dl_vlan=99,dl_vlan_pcp=1,vlan_tci1=0x0000,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
1643 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
1646 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)'
1648 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 18])
1649 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
1651 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1652 NXT_PACKET_IN (xid=0x0): cookie=0x1 total_len=54 in_port=1 (via action) data_len=54 (unbuffered)
1653 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
1655 NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x3 total_len=58 reg0=0x1,in_port=1 (via action) data_len=58 (unbuffered)
1656 tcp,dl_vlan=80,dl_vlan_pcp=0,vlan_tci1=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
1658 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)
1659 tcp,dl_vlan=80,dl_vlan_pcp=0,vlan_tci1=0x0000,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
1661 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)
1662 tcp,dl_vlan=80,dl_vlan_pcp=0,vlan_tci1=0x0000,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
1664 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)
1665 tcp,dl_vlan=80,dl_vlan_pcp=0,vlan_tci1=0x0000,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
1667 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)
1668 tcp,dl_vlan=80,dl_vlan_pcp=0,vlan_tci1=0x0000,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
1670 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)
1671 tcp,dl_vlan=80,dl_vlan_pcp=0,vlan_tci1=0x0000,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
1673 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)
1674 tcp,dl_vlan=80,dl_vlan_pcp=0,vlan_tci1=0x0000,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
1676 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)
1677 tcp,dl_vlan=80,dl_vlan_pcp=0,vlan_tci1=0x0000,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
1681 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
1684 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'
1686 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 18])
1687 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
1689 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1690 NXT_PACKET_IN (xid=0x0): cookie=0x1 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
1691 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
1693 NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x3 total_len=64 reg0=0x1,in_port=1 (via action) data_len=64 (unbuffered)
1694 udp,dl_vlan=80,dl_vlan_pcp=0,vlan_tci1=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
1696 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)
1697 udp,dl_vlan=80,dl_vlan_pcp=0,vlan_tci1=0x0000,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
1699 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)
1700 udp,dl_vlan=80,dl_vlan_pcp=0,vlan_tci1=0x0000,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
1702 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)
1703 udp,dl_vlan=80,dl_vlan_pcp=0,vlan_tci1=0x0000,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
1705 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)
1706 udp,dl_vlan=80,dl_vlan_pcp=0,vlan_tci1=0x0000,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
1708 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)
1709 udp,dl_vlan=80,dl_vlan_pcp=0,vlan_tci1=0x0000,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
1711 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)
1712 udp,dl_vlan=80,dl_vlan_pcp=0,vlan_tci1=0x0000,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
1714 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)
1715 udp,dl_vlan=80,dl_vlan_pcp=0,vlan_tci1=0x0000,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
1718 dnl Modified ARP controller action.
1719 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
1722 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)'
1725 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 18])
1726 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
1727 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1728 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=42 in_port=1 (via action) data_len=42 (unbuffered)
1729 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
1730 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=42 in_port=1 (via action) data_len=42 (unbuffered)
1731 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
1732 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=42 in_port=1 (via action) data_len=42 (unbuffered)
1733 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
1734 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=42 in_port=1 (via action) data_len=42 (unbuffered)
1735 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
1736 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=42 in_port=1 (via action) data_len=42 (unbuffered)
1737 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
1738 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=42 in_port=1 (via action) data_len=42 (unbuffered)
1739 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
1740 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=42 in_port=1 (via action) data_len=42 (unbuffered)
1741 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
1742 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=42 in_port=1 (via action) data_len=42 (unbuffered)
1743 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
1744 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=42 in_port=1 (via action) data_len=42 (unbuffered)
1745 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
1748 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
1751 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
1754 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'
1757 AT_CHECK([ovs-appctl time/warp 1000], [0], [ignore])
1758 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 18])
1759 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
1760 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1761 NXT_PACKET_IN (xid=0x0): cookie=0x1 total_len=98 in_port=1 (via action) data_len=98 (unbuffered)
1762 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
1764 NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x3 total_len=102 reg0=0x1,in_port=1 (via action) data_len=102 (unbuffered)
1765 sctp,dl_vlan=80,dl_vlan_pcp=0,vlan_tci1=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
1767 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)
1768 sctp,dl_vlan=80,dl_vlan_pcp=0,vlan_tci1=0x0000,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
1770 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)
1771 sctp,dl_vlan=80,dl_vlan_pcp=0,vlan_tci1=0x0000,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
1773 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)
1774 sctp,dl_vlan=80,dl_vlan_pcp=0,vlan_tci1=0x0000,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
1776 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)
1777 sctp,dl_vlan=80,dl_vlan_pcp=0,vlan_tci1=0x0000,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
1779 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)
1780 sctp,dl_vlan=80,dl_vlan_pcp=0,vlan_tci1=0x0000,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
1782 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)
1783 sctp,dl_vlan=80,dl_vlan_pcp=0,vlan_tci1=0x0000,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
1785 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)
1786 sctp,dl_vlan=80,dl_vlan_pcp=0,vlan_tci1=0x0000,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
1789 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1790 cookie=0x1, n_packets=3, n_bytes=212, dl_src=20:22:22:22:22:22 actions=CONTROLLER:65535,resubmit(80,1)
1791 cookie=0x2, n_packets=3, n_bytes=162, dl_src=30:33:33:33:33:33 actions=mod_vlan_vid:15,CONTROLLER:65535
1792 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)
1793 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)
1794 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)
1795 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)
1796 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)
1797 cookie=0x8, table=6, n_packets=3, n_bytes=212, in_port=85 actions=mod_tp_src:85,CONTROLLER:65535,resubmit(86,7)
1798 cookie=0x9, table=7, n_packets=3, n_bytes=212, in_port=86 actions=mod_tp_dst:86,CONTROLLER:65535,CONTROLLER:65535
1799 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
1800 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
1801 n_packets=3, n_bytes=162, dl_src=10:11:11:11:11:11 actions=CONTROLLER:65535
1809 AT_SETUP([ofproto-dpif - controller with slow-path action])
1811 add_of_ports br0 1 2
1813 AT_CHECK([ovs-ofctl add-flow br0 "in_port=1,actions=debug_slow,controller"])
1815 AT_CHECK([ovs-ofctl monitor -P standard br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
1818 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)'
1821 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 3])
1822 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1824 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1825 OFPT_PACKET_IN (xid=0x0): total_len=118 in_port=1 (via action) data_len=118 (unbuffered)
1826 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:4a2c
1828 OFPT_PACKET_IN (xid=0x0): total_len=118 in_port=1 (via action) data_len=118 (unbuffered)
1829 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:4a2c
1831 OFPT_PACKET_IN (xid=0x0): total_len=118 in_port=1 (via action) data_len=118 (unbuffered)
1832 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:4a2c
1839 AT_SETUP([ofproto-dpif - controller action without megaflows])
1843 AT_CHECK([ovs-ofctl add-flow br0 in_port=1,action=controller])
1844 AT_CHECK([ovs-appctl upcall/disable-megaflows], [0], [dnl
1848 AT_CAPTURE_FILE([ofctl_monitor.log])
1849 AT_CHECK([ovs-ofctl monitor br0 65534 invalid_ttl -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
1852 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)'])
1855 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 4])
1856 OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
1858 AT_CHECK([ovs-appctl dpctl/dump-flows | sed 's/.*\(packets:\)/\1/' | sed 's/used:[[0-9]].[[0-9]]*s/used:0.001s/'], [0], [dnl
1859 flow-dump from non-dpdk interfaces:
1860 packets:1, bytes:14, used:0.001s, actions:userspace(pid=0,controller(reason=1,dont_send=0,continuation=0,recirc_id=1,rule_cookie=0,controller_id=0,max_len=65535))
1863 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1864 NXT_PACKET_IN (xid=0x0): cookie=0x0 total_len=14 in_port=1 (via action) data_len=14 (unbuffered)
1865 vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,dl_type=0x1234
1866 NXT_PACKET_IN (xid=0x0): cookie=0x0 total_len=14 in_port=1 (via action) data_len=14 (unbuffered)
1867 vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,dl_type=0x1234
1870 AT_CHECK([ovs-appctl revalidator/purge])
1871 AT_CHECK([ovs-ofctl monitor br0 65534 invalid_ttl -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
1873 dnl Add a controller meter.
1874 AT_CHECK([ovs-ofctl -O OpenFlow13 add-meter br0 'meter=controller pktps stats bands=type=drop rate=2'])
1876 dnl Advance time by 1 second.
1877 AT_CHECK([ovs-appctl time/warp 1000], [0], [ignore])
1879 for i in `seq 1 8`; do
1880 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(0x4321)'])
1883 AT_CHECK([ovs-appctl dpctl/dump-flows | sed 's/.*\(packets:\)/\1/' | sed 's/used:[[0-9]].[[0-9]]*s/used:0.001s/'], [0], [dnl
1884 flow-dump from non-dpdk interfaces:
1885 packets:7, bytes:98, used:0.001s, actions:sample(sample=100.0%,actions(meter(0),userspace(pid=0,controller(reason=1,dont_send=0,continuation=0,recirc_id=2,rule_cookie=0,controller_id=0,max_len=65535))))
1888 AT_CHECK([ovs-appctl time/warp 1], [0], [ignore])
1889 OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
1891 dnl Out of 8 packets we sent, two were passed by the rate limiter, and
1892 dnl the rest of packets were blocked.
1893 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1894 NXT_PACKET_IN (xid=0x0): cookie=0x0 total_len=14 in_port=1 (via action) data_len=14 (unbuffered)
1895 vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,dl_type=0x4321
1896 NXT_PACKET_IN (xid=0x0): cookie=0x0 total_len=14 in_port=1 (via action) data_len=14 (unbuffered)
1897 vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,dl_type=0x4321
1899 dnl Check meter stats to make it gives the same picture;
1900 dnl 7 packets hit the meter, but 6 packets are dropped by band0.
1901 AT_CHECK([ovs-ofctl -O OpenFlow13 meter-stats br0 | strip_timers], [0], [dnl
1902 OFPST_METER reply (OF1.3) (xid=0x2):
1903 meter:controller flow_count:0 packet_in_count:8 byte_in_count:112 duration:0.0s bands:
1904 0: packet_count:6 byte_count:84
1910 AT_SETUP([ofproto-dpif - MPLS handling])
1911 OVS_VSWITCHD_START([dnl
1912 add-port br0 p1 -- set Interface p1 type=dummy
1914 on_exit 'kill `cat ovs-ofctl.pid`'
1916 AT_CAPTURE_FILE([ofctl_monitor.log])
1917 AT_DATA([flows.txt], [dnl
1918 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
1919 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
1920 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
1921 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
1922 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
1923 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
1924 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
1925 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
1926 cookie=0xa mpls,dl_src=40:44:44:44:44:49 actions=push_mpls:0x8848,load:10->OXM_OF_MPLS_LABEL[[]],CONTROLLER:65535
1927 cookie=0xb dl_src=50:55:55:55:55:55 dl_type=0x8847 actions=load:1000->OXM_OF_MPLS_LABEL[[]],controller
1928 cookie=0xd dl_src=60:66:66:66:66:66 actions=pop_mpls:0x0800,controller
1929 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
1931 cookie=0xd dl_src=60:66:66:66:00:01 actions=pop_mpls:0x0800,dec_ttl,controller
1932 cookie=0xd dl_src=60:66:66:66:00:02 actions=pop_mpls:0x0800,load:0xa000001->OXM_OF_IPV4_DST[[]],controller
1933 cookie=0xd dl_src=60:66:66:66:00:03 actions=pop_mpls:0x0800,move:OXM_OF_IPV4_DST[[]]->OXM_OF_IPV4_SRC[[]],controller
1934 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
1935 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
1936 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
1937 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
1939 cookie=0xd dl_src=60:66:66:66:00:08 actions=pop_mpls:0x0806,resubmit(1,1)
1940 cookie=0xd table=1 arp actions=controller
1942 cookie=0xdeadbeef table=2 dl_src=60:66:66:66:00:09 actions=pop_mpls:0x0800,mod_nw_tos:48
1943 cookie=0xd dl_src=60:66:66:66:00:09 actions=resubmit(,2),controller
1944 cookie=0xd dl_src=60:66:66:66:00:0a actions=pop_mpls:0x0800,mod_nw_dst:10.0.0.1,controller
1945 cookie=0xd dl_src=60:66:66:66:00:0b actions=pop_mpls:0x0800,mod_nw_src:10.0.0.1,controller
1947 cookie=0xd dl_src=60:66:66:66:01:00 actions=pop_mpls:0x8848,controller
1948 cookie=0xd dl_src=60:66:66:66:01:01 actions=pop_mpls:0x8847,dec_mpls_ttl,controller
1949 cookie=0xd dl_src=60:66:66:66:01:02 actions=pop_mpls:0x8848,load:3->OXM_OF_MPLS_TC[[]],controller
1951 cookie=0xd dl_src=60:66:66:66:02:00 actions=pop_mpls:0x8847,pop_mpls:0x0800,controller
1952 cookie=0xe dl_src=60:66:66:66:02:01 actions=pop_mpls:0x8848,pop_mpls:0x0800,dec_ttl,controller
1953 cookie=0xe dl_src=60:66:66:66:02:10 actions=pop_mpls:0x8847,dec_mpls_ttl,pop_mpls:0x0800,dec_ttl,controller
1955 cookie=0xe dl_src=60:66:66:66:03:00 actions=pop_mpls:0x8848,pop_mpls:0x8848,controller
1956 cookie=0xe dl_src=60:66:66:66:03:01 actions=pop_mpls:0x8847,pop_mpls:0x8847,dec_mpls_ttl,controller
1957 cookie=0xe dl_src=60:66:66:66:03:10 actions=pop_mpls:0x8848,dec_mpls_ttl,pop_mpls:0x8848,dec_mpls_ttl,controller
1959 cookie=0xf dl_src=60:66:66:66:04:00 actions=pop_mpls:0x0800,push_mpls:0x8847,controller
1960 cookie=0xf dl_src=60:66:66:66:04:01 actions=pop_mpls:0x0800,push_mpls:0x8848,dec_mpls_ttl,controller
1961 cookie=0xf dl_src=60:66:66:66:04:10 actions=pop_mpls:0x0800,dec_ttl,push_mpls:0x8848,dec_mpls_ttl,controller
1963 cookie=0x5 dl_src=60:66:66:66:05:00 actions=push_mpls:0x8848,pop_mpls:0x8847,controller
1964 cookie=0x5 dl_src=60:66:66:66:05:01 actions=push_mpls:0x8847,pop_mpls:0x8848,dec_mpls_ttl,controller
1965 cookie=0x5 dl_src=60:66:66:66:05:10 actions=push_mpls:0x8848,dec_mpls_ttl,pop_mpls:0x8847,dec_mpls_ttl,controller
1967 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
1969 dnl Modified MPLS controller action.
1970 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
1973 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)'
1975 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1976 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1978 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1979 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=110 in_port=1 (via action) data_len=110 (unbuffered)
1980 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
1982 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=110 in_port=1 (via action) data_len=110 (unbuffered)
1983 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
1985 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=110 in_port=1 (via action) data_len=110 (unbuffered)
1986 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
1989 dnl Modified MPLS controller action.
1990 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
1993 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)'
1995 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1996 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1998 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1999 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=34 in_port=1 (via action) data_len=34 (unbuffered)
2000 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
2002 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=34 in_port=1 (via action) data_len=34 (unbuffered)
2003 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
2005 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=34 in_port=1 (via action) data_len=34 (unbuffered)
2006 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
2009 dnl Modified MPLS controller action.
2010 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
2012 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)
2015 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)'
2017 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2018 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2020 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
2021 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=22 in_port=1 (via action) data_len=22 (unbuffered)
2022 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
2024 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=22 in_port=1 (via action) data_len=22 (unbuffered)
2025 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
2027 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=22 in_port=1 (via action) data_len=22 (unbuffered)
2028 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
2031 dnl Modified MPLS controller action.
2032 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
2035 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))'
2037 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2038 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2040 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
2041 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=42 in_port=1 (via action) data_len=42 (unbuffered)
2042 mpls,dl_vlan=99,dl_vlan_pcp=7,vlan_tci1=0x0000,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
2044 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=42 in_port=1 (via action) data_len=42 (unbuffered)
2045 mpls,dl_vlan=99,dl_vlan_pcp=7,vlan_tci1=0x0000,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
2047 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=42 in_port=1 (via action) data_len=42 (unbuffered)
2048 mpls,dl_vlan=99,dl_vlan_pcp=7,vlan_tci1=0x0000,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
2051 dnl Modified MPLS controller action.
2052 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
2055 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)'
2057 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2058 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2060 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
2061 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=38 in_port=1 (via action) data_len=38 (unbuffered)
2062 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
2064 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=38 in_port=1 (via action) data_len=38 (unbuffered)
2065 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
2067 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=38 in_port=1 (via action) data_len=38 (unbuffered)
2068 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
2071 dnl Modified MPLS controller action.
2072 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
2075 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)'
2077 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2078 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2080 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
2081 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=38 in_port=1 (via action) data_len=38 (unbuffered)
2082 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
2084 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=38 in_port=1 (via action) data_len=38 (unbuffered)
2085 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
2087 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=38 in_port=1 (via action) data_len=38 (unbuffered)
2088 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
2091 dnl Modified MPLS controller action.
2092 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
2095 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)'
2097 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2098 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2100 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
2101 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=38 in_port=1 (via action) data_len=38 (unbuffered)
2102 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
2104 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=38 in_port=1 (via action) data_len=38 (unbuffered)
2105 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
2107 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=38 in_port=1 (via action) data_len=38 (unbuffered)
2108 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
2111 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2113 dnl Modified MPLS controller action.
2114 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
2117 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)'
2119 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2120 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
2122 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
2123 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=22 in_port=1 (via action) data_len=22 (unbuffered)
2124 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
2126 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=22 in_port=1 (via action) data_len=22 (unbuffered)
2127 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
2129 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=22 in_port=1 (via action) data_len=22 (unbuffered)
2130 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
2133 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2135 dnl Modified MPLS controller action.
2136 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
2139 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)'
2141 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2142 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2144 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
2145 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=38 in_port=1 (via action) data_len=38 (unbuffered)
2146 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
2148 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=38 in_port=1 (via action) data_len=38 (unbuffered)
2149 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
2151 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=38 in_port=1 (via action) data_len=38 (unbuffered)
2152 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
2155 dnl Modified MPLS actions.
2156 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
2159 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)'
2161 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2162 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2164 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
2165 NXT_PACKET_IN (xid=0x0): cookie=0xb total_len=18 in_port=1 (via action) data_len=18 (unbuffered)
2166 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
2168 NXT_PACKET_IN (xid=0x0): cookie=0xb total_len=18 in_port=1 (via action) data_len=18 (unbuffered)
2169 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
2171 NXT_PACKET_IN (xid=0x0): cookie=0xb total_len=18 in_port=1 (via action) data_len=18 (unbuffered)
2172 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
2175 dnl Modified MPLS ipv6 controller action.
2176 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
2179 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)'
2181 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2182 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2184 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
2185 NXT_PACKET_IN (xid=0x0): cookie=0xc total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2186 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
2188 NXT_PACKET_IN (xid=0x0): cookie=0xc total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2189 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
2191 NXT_PACKET_IN (xid=0x0): cookie=0xc total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2192 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
2196 dnl Modified MPLS pop action.
2197 dnl The input is a frame with two MPLS headers which tcpdump -vve shows as:
2198 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)
2199 dnl (tos 0x0, ttl 64, id 0, offset 0, flags [none], proto TCP (6), length 44)
2201 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
2204 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'
2207 # 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)'
2209 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2210 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2212 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
2213 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2214 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
2216 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2217 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
2219 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2220 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
2223 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2225 dnl Modified MPLS pop action.
2226 dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as:
2227 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)
2228 dnl (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44)
2229 dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4
2230 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
2233 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'
2235 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2236 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2238 AT_CHECK([strip_metadata < ofctl_monitor.log], [0], [dnl
2239 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2240 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
2242 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2243 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
2245 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2246 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
2249 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2251 dnl Modified MPLS pop action.
2252 dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as:
2253 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)
2254 dnl (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44)
2255 dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4
2256 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
2259 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'
2261 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2262 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2264 AT_CHECK([strip_metadata < ofctl_monitor.log], [0], [dnl
2265 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2266 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
2268 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2269 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
2271 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2272 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
2275 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2277 dnl Modified MPLS pop action.
2278 dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as:
2279 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)
2280 dnl (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44)
2281 dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4
2282 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
2285 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'
2287 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2288 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2290 AT_CHECK([strip_metadata < ofctl_monitor.log], [0], [dnl
2291 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2292 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
2294 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2295 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
2297 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2298 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
2301 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2303 dnl Modified MPLS pop action.
2304 dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as:
2305 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)
2306 dnl (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44)
2307 dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4
2308 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
2311 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'
2313 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2314 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2316 AT_CHECK([strip_metadata < ofctl_monitor.log], [0], [dnl
2317 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2318 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
2320 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2321 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
2323 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2324 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
2327 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2329 dnl Modified MPLS pop action.
2330 dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as:
2331 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)
2332 dnl (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44)
2333 dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4
2334 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
2337 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'
2339 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2340 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2342 AT_CHECK([strip_metadata < ofctl_monitor.log], [0], [dnl
2343 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2344 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
2346 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2347 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
2349 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2350 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
2353 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2355 dnl Modified MPLS pop action.
2356 dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as:
2357 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)
2358 dnl (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44)
2359 dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4
2360 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
2363 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'
2365 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2366 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2368 AT_CHECK([strip_metadata < ofctl_monitor.log], [0], [dnl
2369 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2370 tcp,vlan_tci=0x0000,dl_src=60:66:66:66:00:06,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
2372 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2373 tcp,vlan_tci=0x0000,dl_src=60:66:66:66:00:06,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
2375 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2376 tcp,vlan_tci=0x0000,dl_src=60:66:66:66:00:06,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
2379 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2381 dnl Modified MPLS pop action.
2382 dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as:
2383 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)
2384 dnl (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44)
2385 dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4
2386 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
2389 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'
2391 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2392 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2394 AT_CHECK([strip_metadata < ofctl_monitor.log], [0], [dnl
2395 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2396 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
2398 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2399 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
2401 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2402 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
2405 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2407 dnl Modified MPLS pop action.
2408 dnl The input is an ARP frame with a single MPLS label stack entry which tcpdump -vve shows as:
2409 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)
2410 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
2413 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'
2415 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2416 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2418 AT_CHECK([strip_metadata < ofctl_monitor.log], [0], [dnl
2419 NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0xd total_len=42 in_port=1 (via action) data_len=42 (unbuffered)
2420 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
2422 NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0xd total_len=42 in_port=1 (via action) data_len=42 (unbuffered)
2423 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
2425 NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0xd total_len=42 in_port=1 (via action) data_len=42 (unbuffered)
2426 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
2429 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2431 dnl Modified MPLS pop action.
2432 dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as:
2433 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)
2434 dnl (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44)
2435 dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4
2436 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
2439 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'
2441 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2442 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2444 AT_CHECK([strip_metadata < ofctl_monitor.log], [0], [dnl
2445 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2446 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
2448 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2449 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
2451 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2452 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
2455 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2457 dnl Modified MPLS pop action.
2458 dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as:
2459 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)
2460 dnl (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44)
2461 dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4
2462 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
2465 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'
2467 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2468 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2470 AT_CHECK([strip_metadata < ofctl_monitor.log], [0], [dnl
2471 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2472 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
2474 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2475 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
2477 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2478 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
2481 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2483 dnl Modified MPLS pop action.
2484 dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as:
2485 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)
2486 dnl (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44)
2487 dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4
2488 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
2491 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'
2493 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2494 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2496 AT_CHECK([strip_metadata < ofctl_monitor.log], [0], [dnl
2497 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2498 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
2500 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2501 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
2503 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2504 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
2507 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2509 dnl Modified MPLS pop action.
2510 dnl The input is a frame with two MPLS label stack entries which tcpdump -vve shows as:
2511 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)
2512 dnl (label 20, exp 0, [S], ttl 31)
2513 dnl (tos 0x0, ttl 254, id 0, offset 0, flags [none], proto TCP (6), length 44)
2514 dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x7744 (correct), seq 42:46, win 10000, length 4
2515 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
2518 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'
2520 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2521 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2523 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
2524 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2525 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
2527 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2528 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
2530 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2531 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
2534 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2536 dnl Modified MPLS pop action.
2537 dnl The input is a frame with two MPLS label stack entries which tcpdump -vve shows as:
2538 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)
2539 dnl (label 20, exp 0, [S], ttl 31)
2540 dnl (tos 0x0, ttl 254, id 0, offset 0, flags [none], proto TCP (6), length 44)
2541 dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x7744 (correct), seq 42:46, win 10000, length 4
2542 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
2545 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'
2547 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2548 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2550 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
2551 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2552 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
2554 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2555 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
2557 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2558 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
2561 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2563 dnl Modified MPLS pop action.
2564 dnl The input is a frame with two MPLS label stack entries which tcpdump -vve shows as:
2565 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)
2566 dnl (label 20, exp 0, [S], ttl 31)
2567 dnl (tos 0x0, ttl 254, id 0, offset 0, flags [none], proto TCP (6), length 44)
2568 dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x7744 (correct), seq 42:46, win 10000, length 4
2569 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
2572 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'
2574 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2575 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2577 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
2578 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2579 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
2581 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2582 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
2584 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2585 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
2588 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2590 dnl Modified MPLS pop action.
2591 dnl The input is a frame with two MPLS label stack entries which tcpdump -vve shows as:
2592 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)
2593 dnl (label 20, exp 0, [S], ttl 31)
2594 dnl (tos 0x0, ttl 254, id 0, offset 0, flags [none], proto TCP (6), length 44)
2595 dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x7744 (correct), seq 42:46, win 10000, length 4
2596 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
2599 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'
2601 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2602 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2604 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
2605 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2606 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
2608 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2609 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
2611 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2612 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
2615 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2617 dnl Modified MPLS pop action.
2618 dnl The input is a frame with two MPLS label stack entries which tcpdump -vve shows as:
2619 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)
2620 dnl (label 20, exp 0, [S], ttl 31)
2621 dnl (tos 0x0, ttl 254, id 0, offset 0, flags [none], proto TCP (6), length 44)
2622 dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x7744 (correct), seq 42:46, win 10000, length 4
2623 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
2626 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'
2629 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2630 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2632 AT_CHECK([strip_metadata < ofctl_monitor.log], [0], [dnl
2633 NXT_PACKET_IN (xid=0x0): cookie=0xe total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2634 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
2636 NXT_PACKET_IN (xid=0x0): cookie=0xe total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2637 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
2639 NXT_PACKET_IN (xid=0x0): cookie=0xe total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2640 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
2643 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2645 dnl Modified MPLS pop action.
2646 dnl The input is a frame with two MPLS label stack entries which tcpdump -vve shows as:
2647 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)
2648 dnl (label 20, exp 0, [S], ttl 31)
2649 dnl (tos 0x0, ttl 254, id 0, offset 0, flags [none], proto TCP (6), length 44)
2650 dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x7744 (correct), seq 42:46, win 10000, length 4
2651 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
2654 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'
2656 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2657 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2659 AT_CHECK([strip_metadata < ofctl_monitor.log], [0], [dnl
2660 NXT_PACKET_IN (xid=0x0): cookie=0xe total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2661 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
2663 NXT_PACKET_IN (xid=0x0): cookie=0xe total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2664 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
2666 NXT_PACKET_IN (xid=0x0): cookie=0xe total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2667 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
2670 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2672 dnl Modified MPLS pop action.
2673 dnl The input is a frame with three MPLS label stack entries which tcpdump -vve shows as:
2674 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)
2675 dnl (label 20, exp 0, ttl 31)
2676 dnl (label 20, exp 0, [S], ttl 30)
2677 dnl (tos 0x0, ttl 254, id 0, offset 0, flags [none], proto TCP (6), length 44)
2678 dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x7744 (correct), seq 42:46, win 10000, length 4
2679 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
2682 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'
2684 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2685 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2687 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
2688 NXT_PACKET_IN (xid=0x0): cookie=0xe total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2689 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
2691 NXT_PACKET_IN (xid=0x0): cookie=0xe total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2692 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
2694 NXT_PACKET_IN (xid=0x0): cookie=0xe total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2695 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
2698 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2700 dnl Modified MPLS pop action.
2701 dnl The input is a frame with three MPLS label stack entries which tcpdump -vve shows as:
2702 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)
2703 dnl (label 20, exp 0, ttl 31)
2704 dnl (label 20, exp 0, [S], ttl 30)
2705 dnl (tos 0x0, ttl 254, id 0, offset 0, flags [none], proto TCP (6), length 44)
2706 dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x7744 (correct), seq 42:46, win 10000, length 4
2707 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
2710 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'
2712 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2713 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2715 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
2716 NXT_PACKET_IN (xid=0x0): cookie=0xe total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2717 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
2719 NXT_PACKET_IN (xid=0x0): cookie=0xe total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2720 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
2722 NXT_PACKET_IN (xid=0x0): cookie=0xe total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2723 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
2726 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2728 dnl Modified MPLS pop action.
2729 dnl The input is a frame with three MPLS label stack entries which tcpdump -vve shows as:
2730 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)
2731 dnl (label 20, exp 0, ttl 31)
2732 dnl (label 20, exp 0, [S], ttl 30)
2733 dnl (tos 0x0, ttl 254, id 0, offset 0, flags [none], proto TCP (6), length 44)
2734 dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x7744 (correct), seq 42:46, win 10000, length 4
2735 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
2738 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'
2740 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2741 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2743 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
2744 NXT_PACKET_IN (xid=0x0): cookie=0xe total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2745 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
2747 NXT_PACKET_IN (xid=0x0): cookie=0xe total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2748 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
2750 NXT_PACKET_IN (xid=0x0): cookie=0xe total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2751 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
2754 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2756 dnl Modified MPLS pop action.
2757 dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as:
2758 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)
2759 dnl (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44)
2760 dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4
2761 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
2764 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'
2766 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2767 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2769 AT_CHECK([strip_metadata < ofctl_monitor.log], [0], [dnl
2770 NXT_PACKET_IN (xid=0x0): cookie=0xf total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2771 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
2773 NXT_PACKET_IN (xid=0x0): cookie=0xf total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2774 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
2776 NXT_PACKET_IN (xid=0x0): cookie=0xf total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2777 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
2780 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2782 dnl Modified MPLS pop action.
2783 dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as:
2784 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)
2785 dnl (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44)
2786 dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4
2787 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
2790 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'
2792 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2793 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2795 AT_CHECK([strip_metadata < ofctl_monitor.log], [0], [dnl
2796 NXT_PACKET_IN (xid=0x0): cookie=0xf total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2797 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
2799 NXT_PACKET_IN (xid=0x0): cookie=0xf total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2800 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
2802 NXT_PACKET_IN (xid=0x0): cookie=0xf total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2803 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
2806 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2808 dnl Modified MPLS pop action.
2809 dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as:
2810 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)
2811 dnl (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44)
2812 dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4
2813 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
2816 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'
2818 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2819 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2821 AT_CHECK([strip_metadata < ofctl_monitor.log], [0], [dnl
2822 NXT_PACKET_IN (xid=0x0): cookie=0xf total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2823 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
2825 NXT_PACKET_IN (xid=0x0): cookie=0xf total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2826 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
2828 NXT_PACKET_IN (xid=0x0): cookie=0xf total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2829 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
2832 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2834 dnl Modified MPLS pop action.
2835 dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as:
2836 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)
2837 dnl (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44)
2838 dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4
2839 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
2842 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'
2845 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2846 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2848 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
2849 NXT_PACKET_IN (xid=0x0): cookie=0x5 total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2850 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
2852 NXT_PACKET_IN (xid=0x0): cookie=0x5 total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2853 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
2855 NXT_PACKET_IN (xid=0x0): cookie=0x5 total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2856 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
2859 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2861 dnl Modified MPLS pop action.
2862 dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as:
2863 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)
2864 dnl (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44)
2865 dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4
2866 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
2869 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'
2871 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2872 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2874 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
2875 NXT_PACKET_IN (xid=0x0): cookie=0x5 total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2876 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
2878 NXT_PACKET_IN (xid=0x0): cookie=0x5 total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2879 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
2881 NXT_PACKET_IN (xid=0x0): cookie=0x5 total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2882 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
2885 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2887 dnl Modified MPLS pop action.
2888 dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as:
2889 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)
2890 dnl (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44)
2891 dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4
2892 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
2895 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'
2898 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2899 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2901 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
2902 NXT_PACKET_IN (xid=0x0): cookie=0x5 total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2903 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
2905 NXT_PACKET_IN (xid=0x0): cookie=0x5 total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2906 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
2908 NXT_PACKET_IN (xid=0x0): cookie=0x5 total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2909 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
2912 AT_CHECK([ovs-appctl revalidator/purge], [0])
2913 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
2914 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
2915 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
2916 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
2917 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
2918 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
2919 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
2920 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
2921 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
2922 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
2923 cookie=0xa, n_packets=3, n_bytes=318, 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
2924 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
2925 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
2926 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
2927 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
2928 cookie=0xd, n_packets=3, n_bytes=138, dl_src=60:66:66:66:00:08 actions=pop_mpls:0x0806,resubmit(1,1)
2929 cookie=0xd, n_packets=3, n_bytes=186, dl_src=60:66:66:66:00:01 actions=pop_mpls:0x0800,dec_ttl,CONTROLLER:65535
2930 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
2931 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
2932 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
2933 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
2934 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
2935 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
2936 cookie=0xd, n_packets=3, n_bytes=186, dl_src=60:66:66:66:00:09 actions=resubmit(,2),CONTROLLER:65535
2937 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
2938 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
2939 cookie=0xd, n_packets=3, n_bytes=186, dl_src=60:66:66:66:66:66 actions=pop_mpls:0x0800,CONTROLLER:65535
2940 cookie=0xd, n_packets=3, n_bytes=198, dl_src=60:66:66:66:01:00 actions=pop_mpls:0x8848,CONTROLLER:65535
2941 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
2942 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
2943 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
2944 cookie=0xd, table=1, n_packets=3, n_bytes=126, arp actions=CONTROLLER:65535
2945 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
2946 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
2947 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
2948 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
2949 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
2950 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
2951 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
2952 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
2953 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
2960 AT_SETUP([ofproto-dpif - MPLS handling with goto_table])
2961 OVS_VSWITCHD_START([dnl
2962 add-port br0 p1 -- set Interface p1 type=dummy
2964 on_exit 'kill `cat ovs-ofctl.pid`'
2966 AT_CAPTURE_FILE([ofctl_monitor.log])
2967 AT_DATA([flows.txt], [dnl
2968 table=0 mplsm actions=pop_mpls:0x800,goto_table(1)
2969 table=1 ip,ip_dscp=8 actions=controller
2971 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flows br0 flows.txt])
2974 dnl Modified MPLS pop action.
2975 dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as:
2976 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)
2977 dnl (tos 0x20, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44)
2978 dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4
2979 AT_CHECK([ovs-ofctl -O OpenFlow12 monitor br0 65534 -P standard --detach --no-chdir --pidfile 2> ofctl_monitor.log])
2982 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'
2984 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2985 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2987 AT_CHECK([strip_metadata < ofctl_monitor.log], [0], [dnl
2988 OFPT_PACKET_IN (OF1.2) (xid=0x0): table_id=1 total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2989 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
2991 OFPT_PACKET_IN (OF1.2) (xid=0x0): table_id=1 total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2992 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
2994 OFPT_PACKET_IN (OF1.2) (xid=0x0): table_id=1 total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2995 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
2998 AT_CHECK([ovs-appctl revalidator/purge], [0])
2999 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
3000 n_packets=3, n_bytes=186, mplsm actions=pop_mpls:0x0800,goto_table:1
3001 table=1, n_packets=3, n_bytes=174, ip,nw_tos=32 actions=CONTROLLER:65535
3002 OFPST_FLOW reply (OF1.2):
3008 AT_SETUP([ofproto-dpif - MPLS handling with write_actions])
3009 OVS_VSWITCHD_START([dnl
3010 add-port br0 p1 -- set Interface p1 type=dummy
3012 on_exit 'kill `cat ovs-ofctl.pid`'
3014 dnl N.B: The first (and only) action that accesses L3 data after the
3015 dnl pop_mpls action is present in write_actions. This exercises recirculation
3016 dnl triggered in write_actions due to a previous action not in write actions.
3017 AT_CAPTURE_FILE([ofctl_monitor.log])
3018 AT_DATA([flows.txt], [dnl
3019 mplsm actions=pop_mpls:0x800,write_actions(dec_ttl,controller)
3021 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flows br0 flows.txt])
3023 dnl Modified MPLS pop action.
3024 dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as:
3025 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)
3026 dnl (tos 0x20, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44)
3027 dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4
3028 AT_CHECK([ovs-ofctl -O OpenFlow12 monitor br0 65534 -P standard --detach --no-chdir --pidfile 2> ofctl_monitor.log])
3031 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'
3033 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
3034 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
3036 AT_CHECK([strip_metadata < ofctl_monitor.log], [0], [dnl
3037 OFPT_PACKET_IN (OF1.2) (xid=0x0): total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
3038 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
3040 OFPT_PACKET_IN (OF1.2) (xid=0x0): total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
3041 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
3043 OFPT_PACKET_IN (OF1.2) (xid=0x0): total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
3044 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
3047 AT_CHECK([ovs-appctl revalidator/purge], [0])
3048 AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
3049 n_packets=3, n_bytes=186, mplsm actions=pop_mpls:0x0800,write_actions(dec_ttl,CONTROLLER:65535)
3050 OFPST_FLOW reply (OF1.2):
3056 AT_SETUP([ofproto-dpif - table-miss flow (OpenFlow 1.0)])
3057 OVS_VSWITCHD_START([dnl
3058 add-port br0 p1 -- set Interface p1 type=dummy
3060 on_exit 'kill `cat ovs-ofctl.pid`'
3062 AT_CAPTURE_FILE([ofctl_monitor.log])
3063 # A table-miss flow has priority 0 and no match
3064 AT_CHECK([ovs-ofctl --protocols=OpenFlow10 add-flow br0 'priority=0 actions=output:CONTROLLER'])
3066 dnl Singleton controller action.
3067 AT_CHECK([ovs-ofctl monitor -P standard --protocols=OpenFlow10 br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
3070 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)'
3072 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
3073 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
3075 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
3076 OFPT_PACKET_IN (xid=0x0): total_len=54 in_port=1 (via action) data_len=54 (unbuffered)
3077 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
3079 OFPT_PACKET_IN (xid=0x0): total_len=54 in_port=1 (via action) data_len=54 (unbuffered)
3080 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
3082 OFPT_PACKET_IN (xid=0x0): total_len=54 in_port=1 (via action) data_len=54 (unbuffered)
3083 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 AT_CHECK([ovs-appctl revalidator/purge], [0])
3087 AT_CHECK([ovs-ofctl --protocols=OpenFlow10 dump-flows br0 | ofctl_strip | sort], [0], [dnl
3088 n_packets=3, n_bytes=162, priority=0 actions=CONTROLLER:65535
3096 AT_SETUP([ofproto-dpif - table-miss flow (OpenFlow 1.3)])
3097 OVS_VSWITCHD_START([dnl
3098 add-port br0 p1 -- set Interface p1 type=dummy
3100 on_exit 'kill `cat ovs-ofctl.pid`'
3102 AT_CAPTURE_FILE([ofctl_monitor.log])
3103 # A table-miss flow has priority 0 and no match
3104 AT_CHECK([ovs-ofctl --protocols=OpenFlow13 add-flow br0 'priority=0 actions=output:CONTROLLER'])
3106 dnl Singleton controller action.
3107 AT_CHECK([ovs-ofctl monitor -P standard --protocols=OpenFlow13 br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
3110 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)'
3112 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
3113 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
3115 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
3117 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
3118 OFPT_PACKET_IN (OF1.3) (xid=0x0): cookie=0x0 total_len=54 in_port=1 (via no_match) data_len=54 (unbuffered)
3119 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
3121 OFPT_PACKET_IN (OF1.3) (xid=0x0): cookie=0x0 total_len=54 in_port=1 (via no_match) data_len=54 (unbuffered)
3122 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
3124 OFPT_PACKET_IN (OF1.3) (xid=0x0): cookie=0x0 total_len=54 in_port=1 (via no_match) data_len=54 (unbuffered)
3125 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
3128 AT_CHECK([ovs-appctl revalidator/purge], [0])
3129 AT_CHECK([ovs-ofctl --protocols=OpenFlow13 dump-flows br0 | ofctl_strip | sort], [0], [dnl
3130 n_packets=3, n_bytes=162, priority=0 actions=CONTROLLER:65535
3131 OFPST_FLOW reply (OF1.3):
3137 AT_SETUP([ofproto-dpif - table-miss flow with async config (OpenFlow 1.3)])
3138 OVS_VSWITCHD_START([dnl
3139 add-port br0 p1 -- set Interface p1 type=dummy
3141 on_exit 'kill `cat ovs-ofctl.pid`'
3143 ovs-appctl time/stop
3145 AT_CAPTURE_FILE([ofctl_monitor.log])
3146 # A table-miss flow has priority 0 and no match
3147 AT_CHECK([ovs-ofctl --protocols=OpenFlow13 add-flow br0 'priority=0 actions=output:CONTROLLER'])
3149 dnl Singleton controller action.
3150 AT_CHECK([ovs-ofctl monitor -P standard --protocols=OpenFlow13 br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
3152 # Become slave (OF 1.3), which should disable everything except port status.
3153 ovs-appctl -t ovs-ofctl ofctl/send 041800180000000200000003000000000000000000000001
3155 # Ensure that ovs-vswitchd gets a chance to reply before sending another command.
3156 ovs-appctl time/warp 500 100
3158 # Use OF 1.3 OFPT_SET_ASYNC to enable OFPR_NO_MATCH for slave only.
3159 ovs-appctl -t ovs-ofctl ofctl/send 041c002000000002000000000000000100000000000000000000000000000000
3161 ovs-appctl time/warp 500 100
3163 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)'
3165 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
3166 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
3168 AT_CHECK([ovs-appctl revalidator/purge], [0])
3169 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
3170 send: OFPT_ROLE_REQUEST (OF1.3) (xid=0x2): role=slave generation_id=1
3171 OFPT_ROLE_REPLY (OF1.3) (xid=0x2): role=slave generation_id=1
3173 send: OFPT_SET_ASYNC (OF1.3) (xid=0x2):
3180 REQUESTFORWARD: (off)
3188 REQUESTFORWARD: (off)
3190 OFPT_PACKET_IN (OF1.3) (xid=0x0): cookie=0x0 total_len=54 in_port=1 (via no_match) data_len=54 (unbuffered)
3191 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
3193 OFPT_PACKET_IN (OF1.3) (xid=0x0): cookie=0x0 total_len=54 in_port=1 (via no_match) data_len=54 (unbuffered)
3194 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
3196 OFPT_PACKET_IN (OF1.3) (xid=0x0): cookie=0x0 total_len=54 in_port=1 (via no_match) data_len=54 (unbuffered)
3197 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
3200 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
3202 AT_CHECK([ovs-ofctl --protocols=OpenFlow13 dump-flows br0 | ofctl_strip | sort], [0], [dnl
3203 n_packets=3, n_bytes=162, priority=0 actions=CONTROLLER:65535
3204 OFPST_FLOW reply (OF1.3):
3211 AT_SETUP([ofproto-dpif - table-miss flow (OpenFlow 1.4)])
3212 OVS_VSWITCHD_START([dnl
3213 add-port br0 p1 -- set Interface p1 type=dummy
3215 on_exit 'kill `cat ovs-ofctl.pid`'
3217 AT_CAPTURE_FILE([ofctl_monitor.log])
3218 # A table-miss flow has priority 0 and no match
3219 AT_CHECK([ovs-ofctl --protocols=OpenFlow14 add-flow br0 'priority=0 actions=output:CONTROLLER'])
3221 dnl Singleton controller action.
3222 AT_CHECK([ovs-ofctl monitor -P standard --protocols=OpenFlow14 br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
3225 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)'
3227 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
3228 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
3230 AT_CHECK([ovs-appctl revalidator/purge], [0])
3231 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
3232 OFPT_PACKET_IN (OF1.4) (xid=0x0): cookie=0x0 total_len=54 in_port=1 (via no_match) data_len=54 (unbuffered)
3233 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
3235 OFPT_PACKET_IN (OF1.4) (xid=0x0): cookie=0x0 total_len=54 in_port=1 (via no_match) data_len=54 (unbuffered)
3236 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
3238 OFPT_PACKET_IN (OF1.4) (xid=0x0): cookie=0x0 total_len=54 in_port=1 (via no_match) data_len=54 (unbuffered)
3239 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
3242 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
3244 AT_CHECK([ovs-ofctl --protocols=OpenFlow14 dump-flows br0 | ofctl_strip | sort], [0], [dnl
3245 n_packets=3, n_bytes=162, priority=0 actions=CONTROLLER:65535
3246 OFPST_FLOW reply (OF1.4):
3253 AT_SETUP([ofproto-dpif - packet-in reasons (Openflow 1.3)])
3254 OVS_VSWITCHD_START([dnl
3255 add-port br0 p1 -- set Interface p1 type=dummy
3257 on_exit 'kill `cat ovs-ofctl.pid`'
3259 AT_CAPTURE_FILE([ofctl_monitor.log])
3260 AT_DATA([flows.txt], [dnl
3261 table=0 in_port=1 actions=write_actions(output(CONTROLLER)),goto_table(1)
3262 table=1 actions=output(CONTROLLER),goto_table(2)
3263 table=2 actions=group:1234
3265 AT_CHECK([ovs-ofctl --protocols=OpenFlow13 add-group br0 'group_id=1234,type=all,bucket=output:10,bucket=output:CONTROLLER'])
3266 AT_CHECK([ovs-ofctl --protocols=OpenFlow13 add-flows br0 flows.txt])
3268 dnl Singleton controller action.
3269 AT_CHECK([ovs-ofctl monitor -P standard --protocols=OpenFlow13 br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
3272 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)'
3274 AT_CHECK([ovs-ofctl packet-out br0 'in_port=NONE, packet=505400000007101111111111080045000028000000004006f97cc0a80001c0a800020008000a0000000000000000500200002e7d0000, actions=controller'])
3275 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 7])
3276 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
3278 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
3280 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
3281 OFPT_PACKET_IN (OF1.3) (xid=0x0): table_id=1 cookie=0x0 total_len=54 in_port=1 (via action) data_len=54 (unbuffered)
3282 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
3284 OFPT_PACKET_IN (OF1.3) (xid=0x0): table_id=2 cookie=0x0 total_len=54 in_port=1 (via action) data_len=54 (unbuffered)
3285 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
3287 OFPT_PACKET_IN (OF1.3) (xid=0x0): cookie=0x0 total_len=54 in_port=1 (via action) data_len=54 (unbuffered)
3288 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
3290 OFPT_PACKET_IN (OF1.3) (xid=0x0): table_id=1 cookie=0x0 total_len=54 in_port=1 (via action) data_len=54 (unbuffered)
3291 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
3293 OFPT_PACKET_IN (OF1.3) (xid=0x0): table_id=2 cookie=0x0 total_len=54 in_port=1 (via action) data_len=54 (unbuffered)
3294 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
3296 OFPT_PACKET_IN (OF1.3) (xid=0x0): cookie=0x0 total_len=54 in_port=1 (via action) data_len=54 (unbuffered)
3297 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
3299 OFPT_PACKET_IN (OF1.3) (xid=0x0): table_id=1 cookie=0x0 total_len=54 in_port=1 (via action) data_len=54 (unbuffered)
3300 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
3302 OFPT_PACKET_IN (OF1.3) (xid=0x0): table_id=2 cookie=0x0 total_len=54 in_port=1 (via action) data_len=54 (unbuffered)
3303 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
3305 OFPT_PACKET_IN (OF1.3) (xid=0x0): cookie=0x0 total_len=54 in_port=1 (via action) data_len=54 (unbuffered)
3306 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
3308 OFPT_PACKET_IN (OF1.3) (xid=0x0): total_len=54 in_port=ANY (via action) data_len=54 (unbuffered)
3309 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
3312 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
3314 AT_CHECK([ovs-ofctl --protocols=OpenFlow13 dump-flows br0 | ofctl_strip | sort], [0], [dnl
3315 n_packets=3, n_bytes=162, in_port=1 actions=write_actions(CONTROLLER:65535),goto_table:1
3316 table=1, n_packets=3, n_bytes=162, actions=CONTROLLER:65535,goto_table:2
3317 table=2, n_packets=3, n_bytes=162, actions=group:1234
3318 OFPST_FLOW reply (OF1.3):
3325 AT_SETUP([ofproto-dpif - packet-in reasons (Openflow 1.4)])
3326 OVS_VSWITCHD_START([dnl
3327 add-port br0 p1 -- set Interface p1 type=dummy
3329 on_exit 'kill `cat ovs-ofctl.pid`'
3331 AT_CAPTURE_FILE([ofctl_monitor.log])
3332 AT_DATA([flows.txt], [dnl
3333 table=0 in_port=1 actions=write_actions(output(CONTROLLER)),goto_table(1)
3334 table=1 actions=output(CONTROLLER),goto_table(2)
3335 table=2 actions=group:1234
3337 AT_CHECK([ovs-ofctl --protocols=OpenFlow14 add-group br0 'group_id=1234,type=all,bucket=output:10,bucket=output:CONTROLLER'])
3338 AT_CHECK([ovs-ofctl --protocols=OpenFlow14 add-flows br0 flows.txt])
3340 dnl Singleton controller action.
3341 AT_CHECK([ovs-ofctl monitor -P standard --protocols=OpenFlow14 br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
3344 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)'
3346 AT_CHECK([ovs-ofctl packet-out br0 'in_port=NONE, packet=505400000007101111111111080045000028000000004006f97cc0a80001c0a800020008000a0000000000000000500200002e7d0000, actions=controller'])
3347 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 7])
3348 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
3350 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
3352 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
3353 OFPT_PACKET_IN (OF1.4) (xid=0x0): table_id=1 cookie=0x0 total_len=54 in_port=1 (via action) data_len=54 (unbuffered)
3354 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
3356 OFPT_PACKET_IN (OF1.4) (xid=0x0): table_id=2 cookie=0x0 total_len=54 in_port=1 (via group) data_len=54 (unbuffered)
3357 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
3359 OFPT_PACKET_IN (OF1.4) (xid=0x0): cookie=0x0 total_len=54 in_port=1 (via action_set) data_len=54 (unbuffered)
3360 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
3362 OFPT_PACKET_IN (OF1.4) (xid=0x0): table_id=1 cookie=0x0 total_len=54 in_port=1 (via action) data_len=54 (unbuffered)
3363 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
3365 OFPT_PACKET_IN (OF1.4) (xid=0x0): table_id=2 cookie=0x0 total_len=54 in_port=1 (via group) data_len=54 (unbuffered)
3366 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
3368 OFPT_PACKET_IN (OF1.4) (xid=0x0): cookie=0x0 total_len=54 in_port=1 (via action_set) data_len=54 (unbuffered)
3369 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
3371 OFPT_PACKET_IN (OF1.4) (xid=0x0): table_id=1 cookie=0x0 total_len=54 in_port=1 (via action) data_len=54 (unbuffered)
3372 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
3374 OFPT_PACKET_IN (OF1.4) (xid=0x0): table_id=2 cookie=0x0 total_len=54 in_port=1 (via group) data_len=54 (unbuffered)
3375 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
3377 OFPT_PACKET_IN (OF1.4) (xid=0x0): cookie=0x0 total_len=54 in_port=1 (via action_set) data_len=54 (unbuffered)
3378 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
3380 OFPT_PACKET_IN (OF1.4) (xid=0x0): total_len=54 in_port=ANY (via packet_out) data_len=54 (unbuffered)
3381 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
3384 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
3386 AT_CHECK([ovs-ofctl --protocols=OpenFlow14 dump-flows br0 | ofctl_strip | sort], [0], [dnl
3387 n_packets=3, n_bytes=162, in_port=1 actions=write_actions(CONTROLLER:65535),goto_table:1
3388 table=1, n_packets=3, n_bytes=162, actions=CONTROLLER:65535,goto_table:2
3389 table=2, n_packets=3, n_bytes=162, actions=group:1234
3390 OFPST_FLOW reply (OF1.4):
3396 AT_SETUP([ofproto-dpif - packet-in reasons (Openflow 1.3)])
3398 OVS_VSWITCHD_START([dnl
3399 set bridge br0 datapath_type=dummy \
3400 protocols=OpenFlow10,OpenFlow13,OpenFlow14,OpenFlow15 -- \
3401 add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1])
3404 ovs-ofctl -OOpenFlow13 del-flows br0
3405 ovs-ofctl -OOpenFlow13 add-group br0 "group_id=6000,type=all,bucket=actions=controller,bucket=actions=resubmit(,48),bucket=actions=resubmit(,81)"
3406 ovs-ofctl -OOpenFlow13 add-flow br0 "table=0, in_port=1, vlan_tci=0x0000/0x1fff actions=write_metadata:0x67870000000000/0xffffff0000000001,goto_table:17"
3407 ovs-ofctl -OOpenFlow13 add-flow br0 "table=17, priority=10,metadata=0x67870000000000/0xffffff0000000000 actions=write_metadata:0xe067870000000000/0xfffffffffffffffe,goto_table:60"
3408 ovs-ofctl -OOpenFlow13 add-flow br0 "table=60, priority=0 actions=resubmit(,17)"
3409 ovs-ofctl -OOpenFlow13 add-flow br0 "table=17, priority=10,metadata=0xe067870000000000/0xffffff0000000000 actions=write_metadata:0x67871d4d000000/0xfffffffffffffffe,goto_table:43"
3410 ovs-ofctl -OOpenFlow13 add-flow br0 "table=43, priority=100,icmp actions=group:6000"
3411 ovs-ofctl -OOpenFlow13 add-flow br0 "table=48, priority=0 actions=resubmit(,49),resubmit(,50)"
3412 ovs-ofctl -OOpenFlow13 add-flow br0 "table=50, priority=0 actions=controller"
3415 AT_CHECK([ovs-ofctl monitor -OOpenFlow13 -P standard br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
3418 ovs-appctl netdev-dummy/receive p1 1e2ce92a669e3a6dd2099cab0800450000548a53400040011addc0a80a0ac0a80a1e08006f200a4d0001fc509a58000000002715020000000000101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f3031323334353637
3421 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 1])
3422 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
3424 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
3425 OFPT_PACKET_IN (OF1.3) (xid=0x0): table_id=43 cookie=0x0 total_len=98 metadata=0x67871d4d000000,in_port=1 (via action) data_len=98 (unbuffered)
3426 icmp,vlan_tci=0x0000,dl_src=3a:6d:d2:09:9c:ab,dl_dst=1e:2c:e9:2a:66:9e,nw_src=192.168.10.10,nw_dst=192.168.10.30,nw_tos=0,nw_ecn=0,nw_ttl=64,icmp_type=8,icmp_code=0 icmp_csum:6f20
3428 OFPT_PACKET_IN (OF1.3) (xid=0x0): table_id=50 cookie=0x0 total_len=98 metadata=0x67871d4d000000,in_port=1 (via no_match) data_len=98 (unbuffered)
3429 icmp,vlan_tci=0x0000,dl_src=3a:6d:d2:09:9c:ab,dl_dst=1e:2c:e9:2a:66:9e,nw_src=192.168.10.10,nw_dst=192.168.10.30,nw_tos=0,nw_ecn=0,nw_ttl=64,icmp_type=8,icmp_code=0 icmp_csum:6f20
3435 AT_SETUP([ofproto-dpif - ARP modification slow-path])
3437 add_of_ports br0 1 2
3439 ovs-vsctl -- set Interface p2 type=dummy options:pcap=p2.pcap
3440 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'
3442 # Input some packets that should follow the arp modification slow-path.
3444 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)'
3446 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
3448 # Check the packets that were output.
3449 AT_CHECK([ovs-ofctl parse-pcap p2.pcap], [0], [dnl
3450 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
3451 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
3452 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
3453 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
3454 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
3455 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
3456 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
3457 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
3458 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
3464 AT_SETUP([ofproto-dpif - VLAN handling])
3466 [set Bridge br0 fail-mode=standalone -- \
3467 add-port br0 p1 trunks=10,12 -- \
3468 add-port br0 p2 tag=10 -- \
3469 add-port br0 p3 tag=12 \
3470 other-config:priority-tags=true -- \
3471 add-port br0 p4 tag=12 -- \
3472 add-port br0 p5 vlan_mode=native-tagged tag=10 -- \
3473 add-port br0 p6 vlan_mode=native-tagged tag=10 trunks=10,12 -- \
3474 add-port br0 p7 vlan_mode=native-untagged tag=12 -- \
3475 add-port br0 p8 vlan_mode=native-untagged tag=12 trunks=10,12 \
3476 other-config:priority-tags=true -- \
3477 add-port br0 p9 vlan_mode=dot1q-tunnel tag=10 other-config:qinq-ethtype=802.1q -- \
3478 add-port br0 p10 vlan_mode=dot1q-tunnel tag=10 cvlans=10,12 other-config:qinq-ethtype=802.1q -- \
3479 add-port br0 p11 vlan_mode=dot1q-tunnel tag=12 other-config:qinq-ethtype=802.1q -- \
3480 add-port br0 p12 vlan_mode=dot1q-tunnel tag=12 other-config:qinq-ethtype=802.1q \
3481 other-config:priority-tags=true -- \
3482 set Interface p1 type=dummy -- \
3483 set Interface p2 type=dummy -- \
3484 set Interface p3 type=dummy -- \
3485 set Interface p4 type=dummy -- \
3486 set Interface p5 type=dummy -- \
3487 set Interface p6 type=dummy -- \
3488 set Interface p7 type=dummy -- \
3489 set Interface p8 type=dummy -- \
3490 set Interface p9 type=dummy -- \
3491 set Interface p10 type=dummy -- \
3492 set Interface p11 type=dummy -- \
3493 set Interface p12 type=dummy --])
3495 dnl Each of these specifies an in_port by number, a VLAN VID (or "none"),
3496 dnl a VLAN PCP (used if the VID isn't "none") and the expected set of datapath
3502 "100 10 0 1,5,6,7,8,pop_vlan,2,9" \
3503 "100 10 1 1,5,6,7,8,pop_vlan,2,9" \
3506 "100 12 0 1,5,6,pop_vlan,3,4,7,8,11,12" \
3507 "100 12 1 1,5,6,pop_vlan,4,7,11,push_vlan(vid=0,pcp=1),3,8,12" \
3511 "1 10 0 5,6,7,8,100,pop_vlan,2,9" \
3512 "1 10 1 5,6,7,8,100,pop_vlan,2,9" \
3515 "1 12 0 5,6,100,pop_vlan,3,4,7,8,11,12" \
3516 "1 12 1 5,6,100,pop_vlan,4,7,11,push_vlan(vid=0,pcp=1),3,8,12" \
3517 "2 none 0 9,push_vlan(vid=10,pcp=0),1,5,6,7,8,100" \
3518 "2 0 0 pop_vlan,9,push_vlan(vid=10,pcp=0),1,5,6,7,8,100" \
3519 "2 0 1 pop_vlan,9,push_vlan(vid=10,pcp=1),1,5,6,7,8,100" \
3526 "3 none 0 4,7,8,11,12,push_vlan(vid=12,pcp=0),1,5,6,100" \
3527 "3 0 0 pop_vlan,4,7,8,11,12,push_vlan(vid=12,pcp=0),1,5,6,100" \
3528 "3 0 1 8,12,pop_vlan,4,7,11,push_vlan(vid=12,pcp=1),1,5,6,100" \
3535 "4 none 0 3,7,8,11,12,push_vlan(vid=12,pcp=0),1,5,6,100" \
3536 "4 0 0 pop_vlan,3,7,8,11,12,push_vlan(vid=12,pcp=0),1,5,6,100" \
3537 "4 0 1 3,8,12,pop_vlan,7,11,push_vlan(vid=12,pcp=1),1,5,6,100" \
3544 "5 none 0 2,9,push_vlan(vid=10,pcp=0),1,6,7,8,100" \
3545 "5 0 0 pop_vlan,2,9,push_vlan(vid=10,pcp=0),1,6,7,8,100" \
3546 "5 0 1 pop_vlan,2,9,push_vlan(vid=10,pcp=1),1,6,7,8,100" \
3547 "5 10 0 1,6,7,8,100,pop_vlan,2,9" \
3548 "5 10 1 1,6,7,8,100,pop_vlan,2,9" \
3551 "5 12 0 1,6,100,pop_vlan,3,4,7,8,11,12" \
3552 "5 12 1 1,6,100,pop_vlan,4,7,11,push_vlan(vid=0,pcp=1),3,8,12" \
3553 "6 none 0 2,9,push_vlan(vid=10,pcp=0),1,5,7,8,100" \
3554 "6 0 0 pop_vlan,2,9,push_vlan(vid=10,pcp=0),1,5,7,8,100" \
3555 "6 0 1 pop_vlan,2,9,push_vlan(vid=10,pcp=1),1,5,7,8,100" \
3556 "6 10 0 1,5,7,8,100,pop_vlan,2,9" \
3557 "6 10 1 1,5,7,8,100,pop_vlan,2,9" \
3560 "6 12 0 1,5,100,pop_vlan,3,4,7,8,11,12" \
3561 "6 12 1 1,5,100,pop_vlan,4,7,11,push_vlan(vid=0,pcp=1),3,8,12" \
3562 "7 none 0 3,4,8,11,12,push_vlan(vid=12,pcp=0),1,5,6,100" \
3563 "7 0 0 pop_vlan,3,4,8,11,12,push_vlan(vid=12,pcp=0),1,5,6,100" \
3564 "7 0 1 3,8,12,pop_vlan,4,11,push_vlan(vid=12,pcp=1),1,5,6,100" \
3565 "7 10 0 1,5,6,8,100,pop_vlan,2,9" \
3566 "7 10 1 1,5,6,8,100,pop_vlan,2,9" \
3569 "7 12 0 1,5,6,100,pop_vlan,3,4,8,11,12" \
3570 "7 12 1 1,5,6,100,pop_vlan,4,11,push_vlan(vid=0,pcp=1),3,8,12" \
3571 "8 none 0 3,4,7,11,12,push_vlan(vid=12,pcp=0),1,5,6,100" \
3572 "8 0 0 pop_vlan,3,4,7,11,12,push_vlan(vid=12,pcp=0),1,5,6,100" \
3573 "8 0 1 3,12,pop_vlan,4,7,11,push_vlan(vid=12,pcp=1),1,5,6,100" \
3574 "8 10 0 1,5,6,7,100,pop_vlan,2,9" \
3575 "8 10 1 1,5,6,7,100,pop_vlan,2,9" \
3578 "8 12 0 1,5,6,100,pop_vlan,3,4,7,11,12" \
3579 "8 12 1 1,5,6,100,pop_vlan,4,7,11,push_vlan(vid=0,pcp=1),3,12" \
3580 "9 none 0 2,push_vlan(vid=10,pcp=0),1,5,6,7,8,100" \
3581 "9 10 0 10,push_vlan(vid=10,pcp=0),1,5,6,7,8,100" \
3582 "9 11 0 push_vlan(vid=10,pcp=0),1,5,6,7,8,100" \
3586 "10 12 0 9,push_vlan(vid=10,pcp=0),1,5,6,7,8,100" \
3587 "11 10 0 7,8,12,push_vlan(vid=12,pcp=0),1,5,6,100" \
3588 "11 10 1 7,8,12,push_vlan(vid=12,pcp=0),1,5,6,100"
3596 if test $vlan = none; then
3597 flow="in_port($in_port),eth(src=50:54:00:00:00:01,dst=ff:ff:ff:ff:ff:ff),eth_type(0xabcd)"
3599 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))"
3602 echo "----------------------------------------------------------------------"
3603 echo "in_port=$in_port vlan=$vlan pcp=$pcp"
3605 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
3606 actual=`tail -1 stdout | sed 's/Datapath actions: //'`
3608 AT_CHECK([ovs-dpctl normalize-actions "$flow" "$expected"], [0], [stdout])
3610 AT_CHECK([ovs-dpctl normalize-actions "$flow" "$actual"], [0], [expout])
3616 AT_SETUP([ofproto-dpif - VLAN depth limit])
3617 OVS_VSWITCHD_START([dnl
3618 add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1 -- \
3619 add-port br0 p2 -- set Interface p2 type=dummy ofport_request=2 -- \
3620 add-port br0 p3 -- set Interface p3 type=dummy ofport_request=3
3623 AT_DATA([flows.txt], [dnl
3624 table=0 in_port=1,eth_type=0x8100,vlan_tci=0x0010/0x01ff actions=output:2
3625 table=0 in_port=1,eth_type=0xabcd,vlan_tci=0x0010/0x01ff actions=output:3
3627 AT_CHECK([ovs-ofctl -O OpenFlow13 add-flows br0 flows.txt])
3628 flow="in_port(1),eth(src=00:11:22:33:44:55,dst=00:22:44:66:88:00),eth_type(0x8100),vlan(vid=16,pcp=0), \
3629 encap(eth_type(0x8100),vlan(vid=17,pcp=0),encap(eth_type(0xabcd)))"
3631 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
3632 AT_CHECK([tail -1 stdout], [0],
3633 [Datapath actions: 2
3636 AT_CHECK([ovs-vsctl set Open_vswitch `ovs-vsctl show | head -n1` other_config:vlan-limit=0])
3637 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
3638 AT_CHECK([tail -1 stdout], [0],
3639 [Datapath actions: 3
3645 AT_SETUP([ofproto-dpif - Multi-VLAN actions])
3646 OVS_VSWITCHD_START([dnl
3647 add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1 -- \
3648 add-port br0 p2 -- set Interface p2 type=dummy ofport_request=2
3650 AT_CHECK([ovs-vsctl set Open_vswitch `ovs-vsctl show | head -n1` other_config:vlan-limit=0])
3652 AT_DATA([flows.txt], [dnl
3653 table=0 in_port=1,vlan_tci=0x1100/0x1fff actions=pop_vlan,output:2
3654 table=0 in_port=1,vlan_tci=0x1101/0x1fff actions=push_vlan:0x8100,set_field:0x1201/0x1fff->vlan_tci,output:2
3655 table=0 in_port=1,vlan_tci=0x1102/0x1fff actions=push_vlan:0x88a8,set_field:0x1202/0x1fff->vlan_tci,output:2
3656 table=0 in_port=1,vlan_tci=0x1103/0x1fff actions=set_field:0x1203/0x1fff->vlan_tci,output:2
3657 table=0 in_port=1,vlan_tci=0x1104/0x1fff actions=pop_vlan,goto_table:1
3658 table=1 vlan_tci=0 actions=output:2
3659 table=1 vlan_tci=0x1300/0x1fff actions=pop_vlan,output:2
3660 table=1 vlan_tci=0x1301/0x1fff actions=push_vlan:0x88a8,set_field:0x1401/0x1fff->vlan_tci,output:2
3661 table=1 vlan_tci=0x1302/0x1fff actions=set_field:0x1402/0x1fff->vlan_tci,output:2
3664 AT_CHECK([ovs-ofctl -O OpenFlow13 add-flows br0 flows.txt])
3667 psd_hdr="in_port(1),eth(src=00:11:22:33:44:55,dst=00:22:44:66:88:00),"
3668 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$psd_hdr$1"], [0], [stdout])
3669 AT_CHECK_UNQUOTED([tail -1 stdout], [0], [Datapath actions: $2
3673 check_act "eth_type(0x8100),vlan(vid=0x0100,pcp=0),encap(eth_type(0xabcd))" \
3676 check_act "eth_type(0x8100),vlan(vid=0x0101,pcp=0),encap(eth_type(0xabcd))" \
3677 "push_vlan(vid=513,pcp=0),2"
3679 check_act "eth_type(0x8100),vlan(vid=0x0102,pcp=0),encap(eth_type(0xabcd))" \
3680 "push_vlan(tpid=0x88a8,vid=514,pcp=0),2"
3682 check_act "eth_type(0x8100),vlan(vid=0x0103,pcp=0),encap(eth_type(0xabcd))" \
3683 "pop_vlan,push_vlan(vid=515,pcp=0),2"
3685 check_act "eth_type(0x8100),vlan(vid=0x0104,pcp=0),encap(eth_type(0xabcd))" \
3688 check_act "eth_type(0x88a8),vlan(vid=0x0104,pcp=0),encap(eth_type(0x8100),\
3689 vlan(vid=0x0300,pcp=0),encap(eth_type(0xabcd)))" "pop_vlan,pop_vlan,2"
3691 check_act "eth_type(0x88a8),vlan(vid=0x0104,pcp=0),encap(eth_type(0x8100),\
3692 vlan(vid=0x0301,pcp=0),encap(eth_type(0xabcd)))" \
3693 "pop_vlan,push_vlan(tpid=0x88a8,vid=1025,pcp=0),2"
3695 check_act "eth_type(0x88a8),vlan(vid=0x0104,pcp=0),encap(eth_type(0x8100),\
3696 vlan(vid=0x0302,pcp=0),encap(eth_type(0xabcd)))" \
3697 "pop_vlan,pop_vlan,push_vlan(vid=1026,pcp=0),2"
3702 AT_SETUP([ofproto-dpif - MPLS handling])
3703 OVS_VSWITCHD_START([dnl
3704 add-port br0 p1 -- set Interface p1 type=dummy
3706 on_exit 'kill `cat ovs-ofctl.pid`'
3708 AT_CAPTURE_FILE([ofctl_monitor.log])
3709 AT_DATA([flows.txt], [dnl
3710 dl_src=40:44:44:44:00:00 actions=push_mpls:0x8847,controller
3711 dl_src=40:44:44:44:00:01,mpls actions=push_mpls:0x8847,controller
3712 dl_src=40:44:44:44:00:02,mpls actions=push_mpls:0x8848,controller
3714 AT_CHECK([ovs-ofctl --protocols=OpenFlow12 add-flows br0 flows.txt])
3716 dnl In this test, we push an MPLS tag to an ethernet packet.
3717 AT_CHECK([ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P standard --detach --no-chdir --pidfile 2> ofctl_monitor.log])
3720 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)'
3722 OVS_WAIT_UNTIL([test `grep OFPT_PACKET_IN ofctl_monitor.log | wc -l` -ge 3])
3723 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
3725 AT_CHECK([ofctl_strip < ofctl_monitor.log], [0], [dnl
3726 OFPT_PACKET_IN (OF1.2): total_len=122 in_port=1 (via action) data_len=122 (unbuffered)
3727 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
3728 00000000 50 54 00 00 00 07 40 44-44 44 00 00 88 47 00 00
3729 00000010 01 40 45 00 00 68 00 00-00 00 40 06 f9 3c c0 a8
3730 00000020 00 01 c0 a8 00 02 00 00-00 00 00 00 00 00 00 00
3731 00000030 00 00 50 00 00 00 4a 4d-00 00 00 01 02 03 04 05
3732 00000040 06 07 08 09 0a 0b 0c 0d-0e 0f 10 11 12 13 14 15
3733 00000050 16 17 18 19 1a 1b 1c 1d-1e 1f 20 21 22 23 24 25
3734 00000060 26 27 28 29 2a 2b 2c 2d-2e 2f 30 31 32 33 34 35
3735 00000070 36 37 38 39 3a 3b 3c 3d-3e 3f
3736 OFPT_PACKET_IN (OF1.2): total_len=122 in_port=1 (via action) data_len=122 (unbuffered)
3737 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
3738 00000000 50 54 00 00 00 07 40 44-44 44 00 00 88 47 00 00
3739 00000010 01 40 45 00 00 68 00 00-00 00 40 06 f9 3c c0 a8
3740 00000020 00 01 c0 a8 00 02 00 00-00 00 00 00 00 00 00 00
3741 00000030 00 00 50 00 00 00 4a 4d-00 00 00 01 02 03 04 05
3742 00000040 06 07 08 09 0a 0b 0c 0d-0e 0f 10 11 12 13 14 15
3743 00000050 16 17 18 19 1a 1b 1c 1d-1e 1f 20 21 22 23 24 25
3744 00000060 26 27 28 29 2a 2b 2c 2d-2e 2f 30 31 32 33 34 35
3745 00000070 36 37 38 39 3a 3b 3c 3d-3e 3f
3746 OFPT_PACKET_IN (OF1.2): total_len=122 in_port=1 (via action) data_len=122 (unbuffered)
3747 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
3748 00000000 50 54 00 00 00 07 40 44-44 44 00 00 88 47 00 00
3749 00000010 01 40 45 00 00 68 00 00-00 00 40 06 f9 3c c0 a8
3750 00000020 00 01 c0 a8 00 02 00 00-00 00 00 00 00 00 00 00
3751 00000030 00 00 50 00 00 00 4a 4d-00 00 00 01 02 03 04 05
3752 00000040 06 07 08 09 0a 0b 0c 0d-0e 0f 10 11 12 13 14 15
3753 00000050 16 17 18 19 1a 1b 1c 1d-1e 1f 20 21 22 23 24 25
3754 00000060 26 27 28 29 2a 2b 2c 2d-2e 2f 30 31 32 33 34 35
3755 00000070 36 37 38 39 3a 3b 3c 3d-3e 3f
3758 dnl In this test, we push an MPLS tag to an MPLS packet. The LSE should be
3759 dnl copied exactly, except for the BOS bit.
3760 AT_CHECK([ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P standard --detach --no-chdir --pidfile 2> ofctl_monitor.log])
3763 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)'
3765 OVS_WAIT_UNTIL([test `grep OFPT_PACKET_IN ofctl_monitor.log | wc -l` -ge 3])
3766 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
3768 AT_CHECK([ofctl_strip < ofctl_monitor.log], [0], [dnl
3769 OFPT_PACKET_IN (OF1.2): total_len=22 in_port=1 (via action) data_len=22 (unbuffered)
3770 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
3771 00000000 50 54 00 00 00 07 40 44-44 44 00 01 88 47 00 00
3772 00000010 a0 40 00 00 a1 40
3774 OFPT_PACKET_IN (OF1.2): total_len=22 in_port=1 (via action) data_len=22 (unbuffered)
3775 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
3776 00000000 50 54 00 00 00 07 40 44-44 44 00 01 88 47 00 00
3777 00000010 a0 40 00 00 a1 40
3779 OFPT_PACKET_IN (OF1.2): total_len=22 in_port=1 (via action) data_len=22 (unbuffered)
3780 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
3781 00000000 50 54 00 00 00 07 40 44-44 44 00 01 88 47 00 00
3782 00000010 a0 40 00 00 a1 40
3785 dnl In this test, we push an MPLS tag to an MPLS packet. The LSE should be
3786 dnl copied exactly, except for the BOS bit. The ethertype should be updated
3787 dnl to the MPLS ethertype of the MPLS push action which differs to that
3788 dnl of the input packet.
3789 AT_CHECK([ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P standard --detach --no-chdir --pidfile 2> ofctl_monitor.log])
3792 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)'
3794 OVS_WAIT_UNTIL([test `grep OFPT_PACKET_IN ofctl_monitor.log | wc -l` -ge 3])
3795 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
3797 AT_CHECK([ofctl_strip < ofctl_monitor.log], [0], [dnl
3798 OFPT_PACKET_IN (OF1.2): total_len=22 in_port=1 (via action) data_len=22 (unbuffered)
3799 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
3800 00000000 50 54 00 00 00 07 40 44-44 44 00 02 88 48 00 00
3801 00000010 a0 40 00 00 a1 40
3803 OFPT_PACKET_IN (OF1.2): total_len=22 in_port=1 (via action) data_len=22 (unbuffered)
3804 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
3805 00000000 50 54 00 00 00 07 40 44-44 44 00 02 88 48 00 00
3806 00000010 a0 40 00 00 a1 40
3808 OFPT_PACKET_IN (OF1.2): total_len=22 in_port=1 (via action) data_len=22 (unbuffered)
3809 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
3810 00000000 50 54 00 00 00 07 40 44-44 44 00 02 88 48 00 00
3811 00000010 a0 40 00 00 a1 40
3817 AT_SETUP([ofproto-dpif - VLAN+MPLS handling])
3818 OVS_VSWITCHD_START([dnl
3819 add-port br0 p1 -- set Interface p1 type=dummy
3821 on_exit 'kill `cat ovs-ofctl.pid`'
3823 AT_CAPTURE_FILE([ofctl_monitor.log])
3824 AT_DATA([flows.txt], [dnl
3825 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
3826 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
3827 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
3828 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
3829 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
3830 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
3831 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
3832 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
3833 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
3834 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
3836 AT_CHECK([ovs-ofctl --protocols=OpenFlow12 add-flows br0 flows.txt])
3838 dnl Modified MPLS controller action.
3839 dnl In this test, we push the MPLS tag before pushing a VLAN tag, so we see
3840 dnl both of these in the final flow
3841 AT_CHECK([ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P standard --detach --no-chdir --pidfile 2> ofctl_monitor.log])
3844 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)'
3846 OVS_WAIT_UNTIL([test `grep OFPT_PACKET_IN ofctl_monitor.log | wc -l` -ge 3])
3847 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
3849 AT_CHECK([ofctl_strip < ofctl_monitor.log], [0], [dnl
3850 OFPT_PACKET_IN (OF1.2): total_len=126 in_port=1 (via action) data_len=126 (unbuffered)
3851 mpls,dl_vlan=99,dl_vlan_pcp=1,vlan_tci1=0x0000,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
3852 00000000 50 54 00 00 00 07 40 44-44 44 54 50 81 00 20 63
3853 00000010 88 47 00 00 a1 40 45 00-00 68 00 00 00 00 40 06
3854 00000020 f9 3c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
3855 00000030 00 00 00 00 00 00 50 00-00 00 4a 4d 00 00 00 01
3856 00000040 02 03 04 05 06 07 08 09-0a 0b 0c 0d 0e 0f 10 11
3857 00000050 12 13 14 15 16 17 18 19-1a 1b 1c 1d 1e 1f 20 21
3858 00000060 22 23 24 25 26 27 28 29-2a 2b 2c 2d 2e 2f 30 31
3859 00000070 32 33 34 35 36 37 38 39-3a 3b 3c 3d 3e 3f
3860 OFPT_PACKET_IN (OF1.2): total_len=126 in_port=1 (via action) data_len=126 (unbuffered)
3861 mpls,dl_vlan=99,dl_vlan_pcp=1,vlan_tci1=0x0000,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
3862 00000000 50 54 00 00 00 07 40 44-44 44 54 50 81 00 20 63
3863 00000010 88 47 00 00 a1 40 45 00-00 68 00 00 00 00 40 06
3864 00000020 f9 3c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
3865 00000030 00 00 00 00 00 00 50 00-00 00 4a 4d 00 00 00 01
3866 00000040 02 03 04 05 06 07 08 09-0a 0b 0c 0d 0e 0f 10 11
3867 00000050 12 13 14 15 16 17 18 19-1a 1b 1c 1d 1e 1f 20 21
3868 00000060 22 23 24 25 26 27 28 29-2a 2b 2c 2d 2e 2f 30 31
3869 00000070 32 33 34 35 36 37 38 39-3a 3b 3c 3d 3e 3f
3870 OFPT_PACKET_IN (OF1.2): total_len=126 in_port=1 (via action) data_len=126 (unbuffered)
3871 mpls,dl_vlan=99,dl_vlan_pcp=1,vlan_tci1=0x0000,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
3872 00000000 50 54 00 00 00 07 40 44-44 44 54 50 81 00 20 63
3873 00000010 88 47 00 00 a1 40 45 00-00 68 00 00 00 00 40 06
3874 00000020 f9 3c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
3875 00000030 00 00 00 00 00 00 50 00-00 00 4a 4d 00 00 00 01
3876 00000040 02 03 04 05 06 07 08 09-0a 0b 0c 0d 0e 0f 10 11
3877 00000050 12 13 14 15 16 17 18 19-1a 1b 1c 1d 1e 1f 20 21
3878 00000060 22 23 24 25 26 27 28 29-2a 2b 2c 2d 2e 2f 30 31
3879 00000070 32 33 34 35 36 37 38 39-3a 3b 3c 3d 3e 3f
3882 dnl Modified MPLS controller action.
3883 dnl In this test, the input packet is vlan-tagged, which should be kept as
3885 AT_CHECK([ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P standard --detach --no-chdir --pidfile 2> ofctl_monitor.log])
3888 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))'
3890 OVS_WAIT_UNTIL([test `grep OFPT_PACKET_IN ofctl_monitor.log | wc -l` -ge 3])
3891 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
3893 AT_CHECK([ofctl_strip < ofctl_monitor.log], [0], [dnl
3894 OFPT_PACKET_IN (OF1.2): total_len=130 in_port=1 (via action) data_len=130 (unbuffered)
3895 mpls,dl_vlan=99,dl_vlan_pcp=1,dl_vlan1=88,dl_vlan_pcp1=7,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
3896 00000000 50 54 00 00 00 07 40 44-44 44 54 51 81 00 20 63
3897 00000010 81 00 e0 58 88 47 00 00-a1 40 45 00 00 68 00 00
3898 00000020 00 00 40 06 f9 3c c0 a8-00 01 c0 a8 00 02 00 00
3899 00000030 00 00 00 00 00 00 00 00-00 00 50 00 00 00 4a 4d
3900 00000040 00 00 00 01 02 03 04 05-06 07 08 09 0a 0b 0c 0d
3901 00000050 0e 0f 10 11 12 13 14 15-16 17 18 19 1a 1b 1c 1d
3902 00000060 1e 1f 20 21 22 23 24 25-26 27 28 29 2a 2b 2c 2d
3903 00000070 2e 2f 30 31 32 33 34 35-36 37 38 39 3a 3b 3c 3d
3905 OFPT_PACKET_IN (OF1.2): total_len=130 in_port=1 (via action) data_len=130 (unbuffered)
3906 mpls,dl_vlan=99,dl_vlan_pcp=1,dl_vlan1=88,dl_vlan_pcp1=7,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
3907 00000000 50 54 00 00 00 07 40 44-44 44 54 51 81 00 20 63
3908 00000010 81 00 e0 58 88 47 00 00-a1 40 45 00 00 68 00 00
3909 00000020 00 00 40 06 f9 3c c0 a8-00 01 c0 a8 00 02 00 00
3910 00000030 00 00 00 00 00 00 00 00-00 00 50 00 00 00 4a 4d
3911 00000040 00 00 00 01 02 03 04 05-06 07 08 09 0a 0b 0c 0d
3912 00000050 0e 0f 10 11 12 13 14 15-16 17 18 19 1a 1b 1c 1d
3913 00000060 1e 1f 20 21 22 23 24 25-26 27 28 29 2a 2b 2c 2d
3914 00000070 2e 2f 30 31 32 33 34 35-36 37 38 39 3a 3b 3c 3d
3916 OFPT_PACKET_IN (OF1.2): total_len=130 in_port=1 (via action) data_len=130 (unbuffered)
3917 mpls,dl_vlan=99,dl_vlan_pcp=1,dl_vlan1=88,dl_vlan_pcp1=7,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
3918 00000000 50 54 00 00 00 07 40 44-44 44 54 51 81 00 20 63
3919 00000010 81 00 e0 58 88 47 00 00-a1 40 45 00 00 68 00 00
3920 00000020 00 00 40 06 f9 3c c0 a8-00 01 c0 a8 00 02 00 00
3921 00000030 00 00 00 00 00 00 00 00-00 00 50 00 00 00 4a 4d
3922 00000040 00 00 00 01 02 03 04 05-06 07 08 09 0a 0b 0c 0d
3923 00000050 0e 0f 10 11 12 13 14 15-16 17 18 19 1a 1b 1c 1d
3924 00000060 1e 1f 20 21 22 23 24 25-26 27 28 29 2a 2b 2c 2d
3925 00000070 2e 2f 30 31 32 33 34 35-36 37 38 39 3a 3b 3c 3d
3929 dnl Modified MPLS controller action.
3930 dnl In this test, we push the MPLS tag before pushing a VLAN tag, so we see
3931 dnl both of these in the final flow
3932 AT_CHECK([ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P standard --detach --no-chdir --pidfile 2> ofctl_monitor.log])
3935 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)'
3937 OVS_WAIT_UNTIL([test `grep OFPT_PACKET_IN ofctl_monitor.log | wc -l` -ge 3])
3938 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
3940 AT_CHECK([ofctl_strip < ofctl_monitor.log], [0], [dnl
3941 OFPT_PACKET_IN (OF1.2): total_len=126 in_port=1 (via action) data_len=126 (unbuffered)
3942 mpls,dl_vlan=99,dl_vlan_pcp=1,vlan_tci1=0x0000,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
3943 00000000 52 54 00 00 00 07 40 44-44 44 54 52 81 00 20 63
3944 00000010 88 47 00 00 a1 40 45 00-00 68 00 00 00 00 40 06
3945 00000020 f9 3c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
3946 00000030 00 00 00 00 00 00 50 00-00 00 4a 4d 00 00 00 01
3947 00000040 02 03 04 05 06 07 08 09-0a 0b 0c 0d 0e 0f 10 11
3948 00000050 12 13 14 15 16 17 18 19-1a 1b 1c 1d 1e 1f 20 21
3949 00000060 22 23 24 25 26 27 28 29-2a 2b 2c 2d 2e 2f 30 31
3950 00000070 32 33 34 35 36 37 38 39-3a 3b 3c 3d 3e 3f
3951 OFPT_PACKET_IN (OF1.2): total_len=126 in_port=1 (via action) data_len=126 (unbuffered)
3952 mpls,dl_vlan=99,dl_vlan_pcp=1,vlan_tci1=0x0000,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
3953 00000000 52 54 00 00 00 07 40 44-44 44 54 52 81 00 20 63
3954 00000010 88 47 00 00 a1 40 45 00-00 68 00 00 00 00 40 06
3955 00000020 f9 3c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
3956 00000030 00 00 00 00 00 00 50 00-00 00 4a 4d 00 00 00 01
3957 00000040 02 03 04 05 06 07 08 09-0a 0b 0c 0d 0e 0f 10 11
3958 00000050 12 13 14 15 16 17 18 19-1a 1b 1c 1d 1e 1f 20 21
3959 00000060 22 23 24 25 26 27 28 29-2a 2b 2c 2d 2e 2f 30 31
3960 00000070 32 33 34 35 36 37 38 39-3a 3b 3c 3d 3e 3f
3961 OFPT_PACKET_IN (OF1.2): total_len=126 in_port=1 (via action) data_len=126 (unbuffered)
3962 mpls,dl_vlan=99,dl_vlan_pcp=1,vlan_tci1=0x0000,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
3963 00000000 52 54 00 00 00 07 40 44-44 44 54 52 81 00 20 63
3964 00000010 88 47 00 00 a1 40 45 00-00 68 00 00 00 00 40 06
3965 00000020 f9 3c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
3966 00000030 00 00 00 00 00 00 50 00-00 00 4a 4d 00 00 00 01
3967 00000040 02 03 04 05 06 07 08 09-0a 0b 0c 0d 0e 0f 10 11
3968 00000050 12 13 14 15 16 17 18 19-1a 1b 1c 1d 1e 1f 20 21
3969 00000060 22 23 24 25 26 27 28 29-2a 2b 2c 2d 2e 2f 30 31
3970 00000070 32 33 34 35 36 37 38 39-3a 3b 3c 3d 3e 3f
3973 dnl Modified MPLS controller action.
3974 dnl In this test, the input packet is vlan-tagged, which should be kept as
3976 AT_CHECK([ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P standard --detach --no-chdir --pidfile 2> ofctl_monitor.log])
3979 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))'
3981 OVS_WAIT_UNTIL([test `grep OFPT_PACKET_IN ofctl_monitor.log | wc -l` -ge 3])
3982 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
3984 AT_CHECK([ofctl_strip < ofctl_monitor.log], [0], [dnl
3985 OFPT_PACKET_IN (OF1.2): total_len=130 in_port=1 (via action) data_len=130 (unbuffered)
3986 mpls,dl_vlan=99,dl_vlan_pcp=1,dl_vlan1=88,dl_vlan_pcp1=7,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
3987 00000000 50 54 00 00 00 07 40 44-44 44 54 53 81 00 20 63
3988 00000010 81 00 e0 58 88 47 00 00-a1 40 45 00 00 68 00 00
3989 00000020 00 00 40 06 f9 3c c0 a8-00 01 c0 a8 00 02 00 00
3990 00000030 00 00 00 00 00 00 00 00-00 00 50 00 00 00 4a 4d
3991 00000040 00 00 00 01 02 03 04 05-06 07 08 09 0a 0b 0c 0d
3992 00000050 0e 0f 10 11 12 13 14 15-16 17 18 19 1a 1b 1c 1d
3993 00000060 1e 1f 20 21 22 23 24 25-26 27 28 29 2a 2b 2c 2d
3994 00000070 2e 2f 30 31 32 33 34 35-36 37 38 39 3a 3b 3c 3d
3996 OFPT_PACKET_IN (OF1.2): total_len=130 in_port=1 (via action) data_len=130 (unbuffered)
3997 mpls,dl_vlan=99,dl_vlan_pcp=1,dl_vlan1=88,dl_vlan_pcp1=7,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
3998 00000000 50 54 00 00 00 07 40 44-44 44 54 53 81 00 20 63
3999 00000010 81 00 e0 58 88 47 00 00-a1 40 45 00 00 68 00 00
4000 00000020 00 00 40 06 f9 3c c0 a8-00 01 c0 a8 00 02 00 00
4001 00000030 00 00 00 00 00 00 00 00-00 00 50 00 00 00 4a 4d
4002 00000040 00 00 00 01 02 03 04 05-06 07 08 09 0a 0b 0c 0d
4003 00000050 0e 0f 10 11 12 13 14 15-16 17 18 19 1a 1b 1c 1d
4004 00000060 1e 1f 20 21 22 23 24 25-26 27 28 29 2a 2b 2c 2d
4005 00000070 2e 2f 30 31 32 33 34 35-36 37 38 39 3a 3b 3c 3d
4007 OFPT_PACKET_IN (OF1.2): total_len=130 in_port=1 (via action) data_len=130 (unbuffered)
4008 mpls,dl_vlan=99,dl_vlan_pcp=1,dl_vlan1=88,dl_vlan_pcp1=7,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
4009 00000000 50 54 00 00 00 07 40 44-44 44 54 53 81 00 20 63
4010 00000010 81 00 e0 58 88 47 00 00-a1 40 45 00 00 68 00 00
4011 00000020 00 00 40 06 f9 3c c0 a8-00 01 c0 a8 00 02 00 00
4012 00000030 00 00 00 00 00 00 00 00-00 00 50 00 00 00 4a 4d
4013 00000040 00 00 00 01 02 03 04 05-06 07 08 09 0a 0b 0c 0d
4014 00000050 0e 0f 10 11 12 13 14 15-16 17 18 19 1a 1b 1c 1d
4015 00000060 1e 1f 20 21 22 23 24 25-26 27 28 29 2a 2b 2c 2d
4016 00000070 2e 2f 30 31 32 33 34 35-36 37 38 39 3a 3b 3c 3d
4020 dnl Modified MPLS controller action.
4021 dnl In this test, we push the VLAN tag before pushing a MPLS tag, but these
4022 dnl actions are reordered, so we see both of these in the final flow.
4023 AT_CHECK([ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P standard --detach --no-chdir --pidfile 2> ofctl_monitor.log])
4026 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)'
4028 OVS_WAIT_UNTIL([test `grep OFPT_PACKET_IN ofctl_monitor.log | wc -l` -ge 3])
4029 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
4031 AT_CHECK([ofctl_strip < ofctl_monitor.log], [0], [dnl
4032 OFPT_PACKET_IN (OF1.2): total_len=126 in_port=1 (via action) data_len=126 (unbuffered)
4033 mpls,dl_vlan=99,dl_vlan_pcp=1,vlan_tci1=0x0000,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
4034 00000000 50 54 00 00 00 07 40 44-44 44 54 54 81 00 20 63
4035 00000010 88 47 00 00 a1 40 45 00-00 68 00 00 00 00 40 06
4036 00000020 f9 3c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
4037 00000030 00 00 00 00 00 00 50 00-00 00 4a 4d 00 00 00 01
4038 00000040 02 03 04 05 06 07 08 09-0a 0b 0c 0d 0e 0f 10 11
4039 00000050 12 13 14 15 16 17 18 19-1a 1b 1c 1d 1e 1f 20 21
4040 00000060 22 23 24 25 26 27 28 29-2a 2b 2c 2d 2e 2f 30 31
4041 00000070 32 33 34 35 36 37 38 39-3a 3b 3c 3d 3e 3f
4042 OFPT_PACKET_IN (OF1.2): total_len=126 in_port=1 (via action) data_len=126 (unbuffered)
4043 mpls,dl_vlan=99,dl_vlan_pcp=1,vlan_tci1=0x0000,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
4044 00000000 50 54 00 00 00 07 40 44-44 44 54 54 81 00 20 63
4045 00000010 88 47 00 00 a1 40 45 00-00 68 00 00 00 00 40 06
4046 00000020 f9 3c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
4047 00000030 00 00 00 00 00 00 50 00-00 00 4a 4d 00 00 00 01
4048 00000040 02 03 04 05 06 07 08 09-0a 0b 0c 0d 0e 0f 10 11
4049 00000050 12 13 14 15 16 17 18 19-1a 1b 1c 1d 1e 1f 20 21
4050 00000060 22 23 24 25 26 27 28 29-2a 2b 2c 2d 2e 2f 30 31
4051 00000070 32 33 34 35 36 37 38 39-3a 3b 3c 3d 3e 3f
4052 OFPT_PACKET_IN (OF1.2): total_len=126 in_port=1 (via action) data_len=126 (unbuffered)
4053 mpls,dl_vlan=99,dl_vlan_pcp=1,vlan_tci1=0x0000,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
4054 00000000 50 54 00 00 00 07 40 44-44 44 54 54 81 00 20 63
4055 00000010 88 47 00 00 a1 40 45 00-00 68 00 00 00 00 40 06
4056 00000020 f9 3c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
4057 00000030 00 00 00 00 00 00 50 00-00 00 4a 4d 00 00 00 01
4058 00000040 02 03 04 05 06 07 08 09-0a 0b 0c 0d 0e 0f 10 11
4059 00000050 12 13 14 15 16 17 18 19-1a 1b 1c 1d 1e 1f 20 21
4060 00000060 22 23 24 25 26 27 28 29-2a 2b 2c 2d 2e 2f 30 31
4061 00000070 32 33 34 35 36 37 38 39-3a 3b 3c 3d 3e 3f
4064 dnl Modified MPLS controller action.
4065 dnl In this test, the input packet is vlan-tagged, which should be kept as
4067 AT_CHECK([ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P standard --detach --no-chdir --pidfile 2> ofctl_monitor.log])
4070 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))'
4072 OVS_WAIT_UNTIL([test `grep OFPT_PACKET_IN ofctl_monitor.log | wc -l` -ge 3])
4073 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
4075 AT_CHECK([ofctl_strip < ofctl_monitor.log], [0], [dnl
4076 OFPT_PACKET_IN (OF1.2): total_len=130 in_port=1 (via action) data_len=130 (unbuffered)
4077 mpls,dl_vlan=99,dl_vlan_pcp=1,dl_vlan1=88,dl_vlan_pcp1=7,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
4078 00000000 50 54 00 00 00 07 40 44-44 44 54 55 81 00 20 63
4079 00000010 81 00 e0 58 88 47 00 00-a1 40 45 00 00 68 00 00
4080 00000020 00 00 40 06 f9 3c c0 a8-00 01 c0 a8 00 02 00 00
4081 00000030 00 00 00 00 00 00 00 00-00 00 50 00 00 00 4a 4d
4082 00000040 00 00 00 01 02 03 04 05-06 07 08 09 0a 0b 0c 0d
4083 00000050 0e 0f 10 11 12 13 14 15-16 17 18 19 1a 1b 1c 1d
4084 00000060 1e 1f 20 21 22 23 24 25-26 27 28 29 2a 2b 2c 2d
4085 00000070 2e 2f 30 31 32 33 34 35-36 37 38 39 3a 3b 3c 3d
4087 OFPT_PACKET_IN (OF1.2): total_len=130 in_port=1 (via action) data_len=130 (unbuffered)
4088 mpls,dl_vlan=99,dl_vlan_pcp=1,dl_vlan1=88,dl_vlan_pcp1=7,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
4089 00000000 50 54 00 00 00 07 40 44-44 44 54 55 81 00 20 63
4090 00000010 81 00 e0 58 88 47 00 00-a1 40 45 00 00 68 00 00
4091 00000020 00 00 40 06 f9 3c c0 a8-00 01 c0 a8 00 02 00 00
4092 00000030 00 00 00 00 00 00 00 00-00 00 50 00 00 00 4a 4d
4093 00000040 00 00 00 01 02 03 04 05-06 07 08 09 0a 0b 0c 0d
4094 00000050 0e 0f 10 11 12 13 14 15-16 17 18 19 1a 1b 1c 1d
4095 00000060 1e 1f 20 21 22 23 24 25-26 27 28 29 2a 2b 2c 2d
4096 00000070 2e 2f 30 31 32 33 34 35-36 37 38 39 3a 3b 3c 3d
4098 OFPT_PACKET_IN (OF1.2): total_len=130 in_port=1 (via action) data_len=130 (unbuffered)
4099 mpls,dl_vlan=99,dl_vlan_pcp=1,dl_vlan1=88,dl_vlan_pcp1=7,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
4100 00000000 50 54 00 00 00 07 40 44-44 44 54 55 81 00 20 63
4101 00000010 81 00 e0 58 88 47 00 00-a1 40 45 00 00 68 00 00
4102 00000020 00 00 40 06 f9 3c c0 a8-00 01 c0 a8 00 02 00 00
4103 00000030 00 00 00 00 00 00 00 00-00 00 50 00 00 00 4a 4d
4104 00000040 00 00 00 01 02 03 04 05-06 07 08 09 0a 0b 0c 0d
4105 00000050 0e 0f 10 11 12 13 14 15-16 17 18 19 1a 1b 1c 1d
4106 00000060 1e 1f 20 21 22 23 24 25-26 27 28 29 2a 2b 2c 2d
4107 00000070 2e 2f 30 31 32 33 34 35-36 37 38 39 3a 3b 3c 3d
4111 dnl Modified MPLS controller action.
4112 dnl In this test, we push the VLAN tag before pushing a MPLS tag, but these
4113 dnl actions are reordered, so we see both of these in the final flow.
4114 AT_CHECK([ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P standard --detach --no-chdir --pidfile 2> ofctl_monitor.log])
4117 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)'
4119 OVS_WAIT_UNTIL([test `grep OFPT_PACKET_IN ofctl_monitor.log | wc -l` -ge 3])
4120 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
4122 AT_CHECK([ofctl_strip < ofctl_monitor.log], [0], [dnl
4123 OFPT_PACKET_IN (OF1.2): total_len=126 in_port=1 (via action) data_len=126 (unbuffered)
4124 mpls,dl_vlan=99,dl_vlan_pcp=1,vlan_tci1=0x0000,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
4125 00000000 50 54 00 00 00 07 40 44-44 44 54 56 81 00 20 63
4126 00000010 88 47 00 00 a1 40 45 00-00 68 00 00 00 00 40 06
4127 00000020 f9 3c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
4128 00000030 00 00 00 00 00 00 50 00-00 00 4a 4d 00 00 00 01
4129 00000040 02 03 04 05 06 07 08 09-0a 0b 0c 0d 0e 0f 10 11
4130 00000050 12 13 14 15 16 17 18 19-1a 1b 1c 1d 1e 1f 20 21
4131 00000060 22 23 24 25 26 27 28 29-2a 2b 2c 2d 2e 2f 30 31
4132 00000070 32 33 34 35 36 37 38 39-3a 3b 3c 3d 3e 3f
4133 OFPT_PACKET_IN (OF1.2): total_len=126 in_port=1 (via action) data_len=126 (unbuffered)
4134 mpls,dl_vlan=99,dl_vlan_pcp=1,vlan_tci1=0x0000,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
4135 00000000 50 54 00 00 00 07 40 44-44 44 54 56 81 00 20 63
4136 00000010 88 47 00 00 a1 40 45 00-00 68 00 00 00 00 40 06
4137 00000020 f9 3c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
4138 00000030 00 00 00 00 00 00 50 00-00 00 4a 4d 00 00 00 01
4139 00000040 02 03 04 05 06 07 08 09-0a 0b 0c 0d 0e 0f 10 11
4140 00000050 12 13 14 15 16 17 18 19-1a 1b 1c 1d 1e 1f 20 21
4141 00000060 22 23 24 25 26 27 28 29-2a 2b 2c 2d 2e 2f 30 31
4142 00000070 32 33 34 35 36 37 38 39-3a 3b 3c 3d 3e 3f
4143 OFPT_PACKET_IN (OF1.2): total_len=126 in_port=1 (via action) data_len=126 (unbuffered)
4144 mpls,dl_vlan=99,dl_vlan_pcp=1,vlan_tci1=0x0000,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
4145 00000000 50 54 00 00 00 07 40 44-44 44 54 56 81 00 20 63
4146 00000010 88 47 00 00 a1 40 45 00-00 68 00 00 00 00 40 06
4147 00000020 f9 3c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
4148 00000030 00 00 00 00 00 00 50 00-00 00 4a 4d 00 00 00 01
4149 00000040 02 03 04 05 06 07 08 09-0a 0b 0c 0d 0e 0f 10 11
4150 00000050 12 13 14 15 16 17 18 19-1a 1b 1c 1d 1e 1f 20 21
4151 00000060 22 23 24 25 26 27 28 29-2a 2b 2c 2d 2e 2f 30 31
4152 00000070 32 33 34 35 36 37 38 39-3a 3b 3c 3d 3e 3f
4155 dnl Modified MPLS controller action.
4156 dnl In this test, the input packet is vlan-tagged, which should be kept as
4158 AT_CHECK([ovs-ofctl --protocols=OpenFlow12 monitor br0 -m 65534 -P standard --detach --no-chdir --pidfile 2> ofctl_monitor.log])
4161 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))'
4163 OVS_WAIT_UNTIL([test `grep OFPT_PACKET_IN ofctl_monitor.log | wc -l` -ge 3])
4164 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
4166 AT_CHECK([ofctl_strip < ofctl_monitor.log], [0], [dnl
4167 OFPT_PACKET_IN (OF1.2): total_len=130 in_port=1 (via action) data_len=130 (unbuffered)
4168 mpls,dl_vlan=99,dl_vlan_pcp=1,dl_vlan1=88,dl_vlan_pcp1=7,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
4169 00000000 50 54 00 00 00 07 40 44-44 44 54 57 81 00 20 63
4170 00000010 81 00 e0 58 88 47 00 00-a1 40 45 00 00 68 00 00
4171 00000020 00 00 40 06 f9 3c c0 a8-00 01 c0 a8 00 02 00 00
4172 00000030 00 00 00 00 00 00 00 00-00 00 50 00 00 00 4a 4d
4173 00000040 00 00 00 01 02 03 04 05-06 07 08 09 0a 0b 0c 0d
4174 00000050 0e 0f 10 11 12 13 14 15-16 17 18 19 1a 1b 1c 1d
4175 00000060 1e 1f 20 21 22 23 24 25-26 27 28 29 2a 2b 2c 2d
4176 00000070 2e 2f 30 31 32 33 34 35-36 37 38 39 3a 3b 3c 3d
4178 OFPT_PACKET_IN (OF1.2): total_len=130 in_port=1 (via action) data_len=130 (unbuffered)
4179 mpls,dl_vlan=99,dl_vlan_pcp=1,dl_vlan1=88,dl_vlan_pcp1=7,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
4180 00000000 50 54 00 00 00 07 40 44-44 44 54 57 81 00 20 63
4181 00000010 81 00 e0 58 88 47 00 00-a1 40 45 00 00 68 00 00
4182 00000020 00 00 40 06 f9 3c c0 a8-00 01 c0 a8 00 02 00 00
4183 00000030 00 00 00 00 00 00 00 00-00 00 50 00 00 00 4a 4d
4184 00000040 00 00 00 01 02 03 04 05-06 07 08 09 0a 0b 0c 0d
4185 00000050 0e 0f 10 11 12 13 14 15-16 17 18 19 1a 1b 1c 1d
4186 00000060 1e 1f 20 21 22 23 24 25-26 27 28 29 2a 2b 2c 2d
4187 00000070 2e 2f 30 31 32 33 34 35-36 37 38 39 3a 3b 3c 3d
4189 OFPT_PACKET_IN (OF1.2): total_len=130 in_port=1 (via action) data_len=130 (unbuffered)
4190 mpls,dl_vlan=99,dl_vlan_pcp=1,dl_vlan1=88,dl_vlan_pcp1=7,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
4191 00000000 50 54 00 00 00 07 40 44-44 44 54 57 81 00 20 63
4192 00000010 81 00 e0 58 88 47 00 00-a1 40 45 00 00 68 00 00
4193 00000020 00 00 40 06 f9 3c c0 a8-00 01 c0 a8 00 02 00 00
4194 00000030 00 00 00 00 00 00 00 00-00 00 50 00 00 00 4a 4d
4195 00000040 00 00 00 01 02 03 04 05-06 07 08 09 0a 0b 0c 0d
4196 00000050 0e 0f 10 11 12 13 14 15-16 17 18 19 1a 1b 1c 1d
4197 00000060 1e 1f 20 21 22 23 24 25-26 27 28 29 2a 2b 2c 2d
4198 00000070 2e 2f 30 31 32 33 34 35-36 37 38 39 3a 3b 3c 3d
4202 dnl Modified MPLS controller action.
4203 dnl In this test, the input packet is vlan-tagged, which should be kept as
4205 AT_CHECK([ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P standard --detach --no-chdir --pidfile 2> ofctl_monitor.log])
4208 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))'
4210 OVS_WAIT_UNTIL([test `grep OFPT_PACKET_IN ofctl_monitor.log | wc -l` -ge 3])
4211 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
4213 AT_CHECK([ofctl_strip < ofctl_monitor.log], [0], [dnl
4214 OFPT_PACKET_IN (OF1.2): total_len=126 in_port=1 (via action) data_len=126 (unbuffered)
4215 mpls,dl_vlan=99,dl_vlan_pcp=1,vlan_tci1=0x0000,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
4216 00000000 50 54 00 00 00 07 40 44-44 44 54 58 81 00 20 63
4217 00000010 88 47 00 00 a1 40 45 00-00 68 00 00 00 00 40 06
4218 00000020 f9 3c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
4219 00000030 00 00 00 00 00 00 50 00-00 00 4a 4d 00 00 00 01
4220 00000040 02 03 04 05 06 07 08 09-0a 0b 0c 0d 0e 0f 10 11
4221 00000050 12 13 14 15 16 17 18 19-1a 1b 1c 1d 1e 1f 20 21
4222 00000060 22 23 24 25 26 27 28 29-2a 2b 2c 2d 2e 2f 30 31
4223 00000070 32 33 34 35 36 37 38 39-3a 3b 3c 3d 3e 3f
4224 OFPT_PACKET_IN (OF1.2): total_len=126 in_port=1 (via action) data_len=126 (unbuffered)
4225 mpls,dl_vlan=99,dl_vlan_pcp=1,vlan_tci1=0x0000,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
4226 00000000 50 54 00 00 00 07 40 44-44 44 54 58 81 00 20 63
4227 00000010 88 47 00 00 a1 40 45 00-00 68 00 00 00 00 40 06
4228 00000020 f9 3c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
4229 00000030 00 00 00 00 00 00 50 00-00 00 4a 4d 00 00 00 01
4230 00000040 02 03 04 05 06 07 08 09-0a 0b 0c 0d 0e 0f 10 11
4231 00000050 12 13 14 15 16 17 18 19-1a 1b 1c 1d 1e 1f 20 21
4232 00000060 22 23 24 25 26 27 28 29-2a 2b 2c 2d 2e 2f 30 31
4233 00000070 32 33 34 35 36 37 38 39-3a 3b 3c 3d 3e 3f
4234 OFPT_PACKET_IN (OF1.2): total_len=126 in_port=1 (via action) data_len=126 (unbuffered)
4235 mpls,dl_vlan=99,dl_vlan_pcp=1,vlan_tci1=0x0000,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
4236 00000000 50 54 00 00 00 07 40 44-44 44 54 58 81 00 20 63
4237 00000010 88 47 00 00 a1 40 45 00-00 68 00 00 00 00 40 06
4238 00000020 f9 3c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
4239 00000030 00 00 00 00 00 00 50 00-00 00 4a 4d 00 00 00 01
4240 00000040 02 03 04 05 06 07 08 09-0a 0b 0c 0d 0e 0f 10 11
4241 00000050 12 13 14 15 16 17 18 19-1a 1b 1c 1d 1e 1f 20 21
4242 00000060 22 23 24 25 26 27 28 29-2a 2b 2c 2d 2e 2f 30 31
4243 00000070 32 33 34 35 36 37 38 39-3a 3b 3c 3d 3e 3f
4246 dnl Modified MPLS controller action.
4247 dnl In this test, the input packet is vlan-tagged, which should be modified
4248 dnl before we push MPLS and VLAN tags.
4249 AT_CHECK([ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P standard --detach --no-chdir --pidfile 2> ofctl_monitor.log])
4252 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))'
4254 OVS_WAIT_UNTIL([test `grep OFPT_PACKET_IN ofctl_monitor.log | wc -l` -ge 3])
4255 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
4257 AT_CHECK([ofctl_strip < ofctl_monitor.log], [0], [dnl
4258 OFPT_PACKET_IN (OF1.2): total_len=126 in_port=1 (via action) data_len=126 (unbuffered)
4259 mpls,dl_vlan=99,dl_vlan_pcp=1,vlan_tci1=0x0000,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
4260 00000000 50 54 00 00 00 07 40 44-44 44 54 59 81 00 20 63
4261 00000010 88 47 00 00 a1 40 45 00-00 68 00 00 00 00 40 06
4262 00000020 f9 3c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
4263 00000030 00 00 00 00 00 00 50 00-00 00 4a 4d 00 00 00 01
4264 00000040 02 03 04 05 06 07 08 09-0a 0b 0c 0d 0e 0f 10 11
4265 00000050 12 13 14 15 16 17 18 19-1a 1b 1c 1d 1e 1f 20 21
4266 00000060 22 23 24 25 26 27 28 29-2a 2b 2c 2d 2e 2f 30 31
4267 00000070 32 33 34 35 36 37 38 39-3a 3b 3c 3d 3e 3f
4268 OFPT_PACKET_IN (OF1.2): total_len=126 in_port=1 (via action) data_len=126 (unbuffered)
4269 mpls,dl_vlan=99,dl_vlan_pcp=1,vlan_tci1=0x0000,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
4270 00000000 50 54 00 00 00 07 40 44-44 44 54 59 81 00 20 63
4271 00000010 88 47 00 00 a1 40 45 00-00 68 00 00 00 00 40 06
4272 00000020 f9 3c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
4273 00000030 00 00 00 00 00 00 50 00-00 00 4a 4d 00 00 00 01
4274 00000040 02 03 04 05 06 07 08 09-0a 0b 0c 0d 0e 0f 10 11
4275 00000050 12 13 14 15 16 17 18 19-1a 1b 1c 1d 1e 1f 20 21
4276 00000060 22 23 24 25 26 27 28 29-2a 2b 2c 2d 2e 2f 30 31
4277 00000070 32 33 34 35 36 37 38 39-3a 3b 3c 3d 3e 3f
4278 OFPT_PACKET_IN (OF1.2): total_len=126 in_port=1 (via action) data_len=126 (unbuffered)
4279 mpls,dl_vlan=99,dl_vlan_pcp=1,vlan_tci1=0x0000,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
4280 00000000 50 54 00 00 00 07 40 44-44 44 54 59 81 00 20 63
4281 00000010 88 47 00 00 a1 40 45 00-00 68 00 00 00 00 40 06
4282 00000020 f9 3c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
4283 00000030 00 00 00 00 00 00 50 00-00 00 4a 4d 00 00 00 01
4284 00000040 02 03 04 05 06 07 08 09-0a 0b 0c 0d 0e 0f 10 11
4285 00000050 12 13 14 15 16 17 18 19-1a 1b 1c 1d 1e 1f 20 21
4286 00000060 22 23 24 25 26 27 28 29-2a 2b 2c 2d 2e 2f 30 31
4287 00000070 32 33 34 35 36 37 38 39-3a 3b 3c 3d 3e 3f
4290 AT_CHECK([ovs-appctl revalidator/purge], [0])
4291 AT_CHECK([ovs-ofctl --protocols=OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
4292 cookie=0xa, n_packets=3, n_bytes=354, 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
4293 cookie=0xa, n_packets=3, n_bytes=354, 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
4294 cookie=0xa, n_packets=3, n_bytes=354, 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
4295 cookie=0xa, n_packets=3, n_bytes=354, 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
4296 cookie=0xa, n_packets=3, n_bytes=366, 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
4297 cookie=0xa, n_packets=3, n_bytes=366, 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
4298 cookie=0xa, n_packets=3, n_bytes=366, 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
4299 cookie=0xa, n_packets=3, n_bytes=366, 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
4300 cookie=0xa, n_packets=3, n_bytes=366, 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
4301 cookie=0xa, n_packets=3, n_bytes=366, 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
4302 OFPST_FLOW reply (OF1.2):
4308 AT_SETUP([ofproto-dpif - fragment handling - trace])
4310 add_of_ports br0 1 2 3 4 5 6 90
4311 AT_DATA([flows.txt], [dnl
4312 priority=75 tcp nw_frag=no tp_dst=80 actions=move:OXM_OF_TCP_DST[[]]->OXM_OF_TCP_SRC[[]],output:1
4313 priority=75 tcp nw_frag=first tp_dst=80 actions=move:OXM_OF_TCP_DST[[]]->OXM_OF_TCP_SRC[[]],output:2
4314 priority=50 tcp nw_frag=no actions=move:OXM_OF_TCP_DST[[]]->OXM_OF_TCP_SRC[[]],output:4
4315 priority=50 tcp nw_frag=first actions=move:OXM_OF_TCP_DST[[]]->OXM_OF_TCP_SRC[[]],output:5
4316 priority=50 tcp nw_frag=later actions=output:6
4318 AT_CHECK([ovs-ofctl replace-flows br0 flows.txt])
4320 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"
4321 no_flow="$base_flow,frag=no),tcp(src=12345,dst=80)"
4322 first_flow="$base_flow,frag=first),tcp(src=12345,dst=80)"
4323 later_flow="$base_flow,frag=later)"
4325 # mode no first later
4328 'drop 1 drop drop' \
4337 AT_CHECK([ovs-ofctl set-frags br0 $mode])
4338 for type in no first later; do
4339 eval flow=\$${type}_flow exp_output=\$$type
4340 printf "\n%s\n" "----$mode $type-----"
4341 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
4343 if test $mode = drop && test $type != no; then
4344 echo ' 0. Packets are IP fragments and the fragment handling mode is "drop".' >> expout
4345 echo "Datapath actions: $exp_output" >> expout
4346 elif test $type = later; then
4347 echo "Datapath actions: $exp_output" >> expout
4349 echo "Datapath actions: set(tcp(src=80,dst=80)),$exp_output" >> expout
4351 AT_CHECK([grep 'IP fragments' stdout; tail -1 stdout], [0], [expout])
4357 AT_SETUP([ofproto-dpif - fragment handling - upcall])
4359 add_of_ports br0 1 2 3 4 5 6 90
4360 AT_DATA([flows.txt], [dnl
4361 priority=75 tcp ip_frag=no tp_dst=80 actions=set_field:81->tcp_dst,output:1
4362 priority=75 tcp ip_frag=first tp_dst=80 actions=set_field:81->tcp_dst,output:2
4363 priority=50 tcp ip_frag=no actions=set_field:81->tcp_dst,output:4
4364 priority=50 tcp ip_frag=first actions=set_field:81->tcp_dst,output:5
4365 priority=50 tcp ip_frag=later actions=output:6
4367 AT_CHECK([ovs-ofctl replace-flows br0 flows.txt])
4369 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"
4370 no_flow="$base_flow,frag=no),tcp(src=12345,dst=80)"
4371 first_flow="$base_flow,frag=first),tcp(src=12345,dst=80)"
4372 later_flow="$base_flow,frag=later)"
4374 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
4378 AT_CHECK([ovs-ofctl set-frags br0 $mode])
4379 for type in no first later; do
4380 eval flow=\$${type}_flow
4381 printf "\n%s\n" "----$mode $type-----"
4383 AT_CHECK([ovs-appctl netdev-dummy/receive p90 "$flow"], [0], [stdout])
4386 AT_CHECK([ovs-appctl dpctl/dump-flows], [0], [dnl
4387 flow-dump from non-dpdk interfaces:
4388 recirc_id(0),in_port(90),packet_type(ns=0,id=0),eth_type(0x0800),ipv4(proto=6,frag=no),tcp(dst=80), packets:0, bytes:0, used:never, actions:set(tcp(dst=81)),1
4389 recirc_id(0),in_port(90),packet_type(ns=0,id=0),eth_type(0x0800),ipv4(proto=6,frag=first),tcp(dst=80), packets:0, bytes:0, used:never, actions:set(tcp(dst=81)),5
4390 recirc_id(0),in_port(90),packet_type(ns=0,id=0),eth_type(0x0800),ipv4(proto=6,frag=later), packets:0, bytes:0, used:never, actions:6
4395 AT_CHECK([ovs-appctl revalidator/purge], [0])
4396 AT_CHECK([ovs-ofctl set-frags br0 $mode])
4397 for type in no first later; do
4398 eval flow=\$${type}_flow
4399 printf "\n%s\n" "----$mode $type-----"
4401 AT_CHECK([ovs-appctl netdev-dummy/receive p90 "$flow"], [0], [stdout])
4404 AT_CHECK([ovs-appctl dpctl/dump-flows], [0], [dnl
4405 flow-dump from non-dpdk interfaces:
4406 recirc_id(0),in_port(90),packet_type(ns=0,id=0),eth_type(0x0800),ipv4(proto=6,frag=no),tcp(dst=80), packets:0, bytes:0, used:never, actions:set(tcp(dst=81)),1
4407 recirc_id(0),in_port(90),packet_type(ns=0,id=0),eth_type(0x0800),ipv4(frag=first), packets:0, bytes:0, used:never, actions:drop
4408 recirc_id(0),in_port(90),packet_type(ns=0,id=0),eth_type(0x0800),ipv4(frag=later), packets:0, bytes:0, used:never, actions:drop
4413 AT_CHECK([ovs-appctl revalidator/purge], [0])
4414 AT_CHECK([ovs-ofctl set-frags br0 $mode])
4415 for type in no first later; do
4416 eval flow=\$${type}_flow
4417 printf "\n%s\n" "----$mode $type-----"
4419 AT_CHECK([ovs-appctl netdev-dummy/receive p90 "$flow"], [0], [stdout])
4422 AT_CHECK([ovs-appctl dpctl/dump-flows], [0], [dnl
4423 flow-dump from non-dpdk interfaces:
4424 recirc_id(0),in_port(90),packet_type(ns=0,id=0),eth_type(0x0800),ipv4(proto=6,frag=no),tcp(dst=80), packets:0, bytes:0, used:never, actions:set(tcp(dst=81)),1
4425 recirc_id(0),in_port(90),packet_type(ns=0,id=0),eth_type(0x0800),ipv4(proto=6,frag=first),tcp(dst=80), packets:0, bytes:0, used:never, actions:set(tcp(dst=81)),2
4426 recirc_id(0),in_port(90),packet_type(ns=0,id=0),eth_type(0x0800),ipv4(proto=6,frag=later), packets:0, bytes:0, used:never, actions:6
4432 AT_SETUP([ofproto-dpif - fragment handling - actions])
4434 add_of_ports br0 1 2 3 4 5 6 90
4436 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])
4437 AT_CHECK([tail -2 stderr | sed 's/^.*|WARN|//'], [0], [dnl
4438 source field tcp_dst lacks correct prerequisites
4439 ovs-ofctl: actions are invalid with specified match (OFPBAC_MATCH_INCONSISTENT)
4442 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])
4443 AT_CHECK([tail -2 stderr | sed 's/^.*|WARN|//'], [0], [dnl
4444 destination field tcp_src lacks correct prerequisites
4445 ovs-ofctl: actions are invalid with specified match (OFPBAC_MATCH_INCONSISTENT)
4448 AT_CHECK([ovs-ofctl add-flow br0 "udp,ip_frag=later actions=set_field:8888->udp_src,output:1"], [1], [], [stderr])
4449 AT_CHECK([tail -2 stderr | sed 's/^.*|WARN|//'], [0], [dnl
4450 set_field udp_src lacks correct prerequisites
4451 ovs-ofctl: actions are invalid with specified match (OFPBAC_MATCH_INCONSISTENT)
4454 AT_CHECK([ovs-ofctl add-flow br0 "udp,ip_frag=later actions=load:8888->NXM_OF_UDP_DST[[]],output:1"], [1], [], [stderr])
4455 AT_CHECK([tail -2 stderr | sed 's/^.*|WARN|//'], [0], [dnl
4456 set_field udp_dst lacks correct prerequisites
4457 ovs-ofctl: actions are invalid with specified match (OFPBAC_MATCH_INCONSISTENT)
4460 AT_CHECK([ovs-ofctl add-flow br0 "sctp,ip_frag=later actions=set_field:8888->sctp_src,output:1"], [1], [], [stderr])
4461 AT_CHECK([tail -2 stderr | sed 's/^.*|WARN|//'], [0], [dnl
4462 set_field sctp_src lacks correct prerequisites
4463 ovs-ofctl: actions are invalid with specified match (OFPBAC_MATCH_INCONSISTENT)
4466 AT_CHECK([ovs-ofctl add-flow br0 "sctp,ip_frag=later actions=set_field:8888->sctp_dst,output:1"], [1], [], [stderr])
4467 AT_CHECK([tail -2 stderr | sed 's/^.*|WARN|//'], [0], [dnl
4468 set_field sctp_dst lacks correct prerequisites
4469 ovs-ofctl: actions are invalid with specified match (OFPBAC_MATCH_INCONSISTENT)
4472 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])
4473 AT_CHECK([tail -2 stderr | sed 's/^.*|WARN|//'], [0], [dnl
4474 source field tcp_dst lacks correct prerequisites
4475 ovs-ofctl: actions are invalid with specified match (OFPBAC_MATCH_INCONSISTENT)
4478 AT_DATA([flows.txt], [dnl
4479 priority=75 tcp actions=load:42->OXM_OF_TCP_SRC[[0..7]],output:1
4481 AT_CHECK([ovs-ofctl -O OpenFlow12 replace-flows br0 flows.txt])
4483 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
4487 AT_CHECK([ovs-ofctl set-frags br0 $mode])
4488 for frag in 4000 6000 6008 4010; do
4489 printf "\n%s\n" "----$mode $frag-----"
4491 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"])
4494 dnl The set_field action only modifies 8 bits of the tcp_src, so both the flow
4495 dnl wildcard and the set_field action have a mask of 0xFF. Up to (including)
4496 dnl OVS-2.5, the wildcards and set_field mask are shared internally.
4497 AT_CHECK([ovs-appctl dpctl/dump-flows | sed 's/used:[[0-9]].[[0-9]]*s/used:0.001s/'], [0], [dnl
4498 flow-dump from non-dpdk interfaces:
4499 recirc_id(0),in_port(90),packet_type(ns=0,id=0),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
4500 recirc_id(0),in_port(90),packet_type(ns=0,id=0),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
4501 recirc_id(0),in_port(90),packet_type(ns=0,id=0),eth_type(0x0800),ipv4(proto=6,frag=later), packets:1, bytes:74, used:0.001s, actions:1
4504 AT_CHECK([ovs-appctl revalidator/purge], [0])
4505 AT_CHECK([ovs-ofctl set-frags br0 $mode])
4506 for frag in 4000 6000 6008 4010; do
4507 printf "\n%s\n" "----$mode $frag truncated transport header -----"
4509 AT_CHECK([ovs-appctl netdev-dummy/receive p90 "0021853763af 0026b98cb0f9 0800 4500 0018 2e24 $frag 40 06 465d ac11370d ac11370b 828b 0016"])
4512 AT_CHECK([ovs-appctl dpctl/dump-flows | sed 's/used:[[0-9]].[[0-9]]*s/used:0.001s/'], [0], [dnl
4513 flow-dump from non-dpdk interfaces:
4514 recirc_id(0),in_port(90),packet_type(ns=0,id=0),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
4515 recirc_id(0),in_port(90),packet_type(ns=0,id=0),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
4516 recirc_id(0),in_port(90),packet_type(ns=0,id=0),eth_type(0x0800),ipv4(proto=6,frag=later), packets:1, bytes:38, used:0.001s, actions:1
4519 AT_CHECK([ovs-appctl revalidator/purge], [0])
4520 AT_CHECK([ovs-ofctl set-frags br0 $mode])
4521 for frag in 4000 6000 6001 4002; do
4522 printf "\n%s\n" "----$mode $frag missing transport header-----"
4524 AT_CHECK([ovs-appctl netdev-dummy/receive p90 "0021853763af 0026b98cb0f9 0800 4500 0014 2e24 $frag 40 06 465d ac11370d ac11370b"])
4527 AT_CHECK([ovs-appctl dpctl/dump-flows | sed 's/used:[[0-9]].[[0-9]]*s/used:0.001s/'], [0], [dnl
4528 flow-dump from non-dpdk interfaces:
4529 recirc_id(0),in_port(90),packet_type(ns=0,id=0),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
4530 recirc_id(0),in_port(90),packet_type(ns=0,id=0),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
4531 recirc_id(0),in_port(90),packet_type(ns=0,id=0),eth_type(0x0800),ipv4(proto=6,frag=later), packets:1, bytes:34, used:0.001s, actions:1
4537 AT_SETUP([ofproto-dpif - exit])
4539 add_of_ports br0 1 2 3 10 11 12 13 14
4540 AT_DATA([flows.txt], [dnl
4541 in_port=1 actions=output:10,exit,output:11
4542 in_port=2 actions=output:12,resubmit:1,output:12
4543 in_port=3 actions=output:13,resubmit:2,output:14
4545 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
4546 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])
4547 AT_CHECK([tail -1 stdout], [0],
4548 [Datapath actions: 10
4550 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])
4551 AT_CHECK([tail -1 stdout], [0],
4552 [Datapath actions: 12,10
4554 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])
4555 AT_CHECK([tail -1 stdout], [0],
4556 [Datapath actions: 13,12,10
4562 AT_SETUP([ofproto-dpif - mirroring, select_all])
4563 AT_KEYWORDS([mirror mirrors mirroring])
4565 add_of_ports br0 1 2 3
4567 set Bridge br0 mirrors=@m --\
4568 --id=@p3 get Port p3 --\
4569 --id=@m create Mirror name=mymirror select_all=true output_port=@p3
4571 AT_DATA([flows.txt], [dnl
4572 in_port=1 actions=output:2
4573 in_port=2 actions=output:1
4575 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
4577 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)"
4578 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
4579 AT_CHECK_UNQUOTED([tail -1 stdout], [0],
4580 [Datapath actions: 3,2
4583 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)"
4584 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
4585 AT_CHECK_UNQUOTED([tail -1 stdout], [0],
4586 [Datapath actions: 3,1
4593 AT_SETUP([ofproto-dpif - mirroring, select_src])
4594 AT_KEYWORDS([mirror mirrors mirroring])
4596 add_of_ports br0 1 2 3
4598 set Bridge br0 mirrors=@m --\
4599 --id=@p1 get Port p1 -- --id=@p3 get Port p3 --\
4600 --id=@m create Mirror name=mymirror select_src_port=@p1 output_port=@p3
4602 AT_DATA([flows.txt], [dnl
4603 in_port=1 actions=output:2
4604 in_port=2 actions=output:1
4606 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
4608 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)"
4609 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
4610 AT_CHECK_UNQUOTED([tail -1 stdout], [0],
4611 [Datapath actions: 3,2
4614 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)"
4615 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
4616 AT_CHECK_UNQUOTED([tail -1 stdout], [0],
4617 [Datapath actions: 1
4622 AT_SETUP([ofproto-dpif - mirroring, OFPP_NONE ingress port])
4623 AT_KEYWORDS([mirror mirrors mirroring])
4625 add_of_ports br0 1 2
4627 set Bridge br0 mirrors=@m --\
4628 --id=@p2 get Port p2 --\
4629 --id=@m create Mirror name=mymirror select_all=true output_port=@p2
4631 AT_CHECK([ovs-ofctl add-flow br0 action=output:1])
4633 # "in_port" defaults to OFPP_NONE if it's not specified.
4634 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"
4635 AT_CHECK([ovs-appctl ofproto/trace br0 "$flow"], [0], [stdout])
4636 AT_CHECK_UNQUOTED([tail -1 stdout], [0],
4637 [Datapath actions: 1,2
4644 AT_SETUP([ofproto-dpif - mirroring, select_dst])
4645 AT_KEYWORDS([mirror mirrors mirroring])
4647 add_of_ports br0 1 2 3
4649 set Bridge br0 mirrors=@m --\
4650 --id=@p2 get Port p2 -- --id=@p3 get Port p3 --\
4651 --id=@m create Mirror name=mymirror select_dst_port=@p2 output_port=@p3
4653 AT_DATA([flows.txt], [dnl
4654 in_port=1 actions=output:2
4655 in_port=2 actions=output:1
4657 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
4659 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)"
4660 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
4661 AT_CHECK_UNQUOTED([tail -1 stdout], [0],
4662 [Datapath actions: 2,3
4665 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)"
4666 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
4667 AT_CHECK_UNQUOTED([tail -1 stdout], [0],
4668 [Datapath actions: 1
4675 AT_SETUP([ofproto-dpif - mirroring, select_vlan])
4676 AT_KEYWORDS([mirror mirrors mirroring])
4678 add_of_ports br0 1 2 3
4680 set Bridge br0 mirrors=@m --\
4681 --id=@p2 get Port p2 -- --id=@p3 get Port p3 --\
4682 --id=@m create Mirror name=mymirror select_all=true select_vlan=11 output_port=@p3
4684 AT_DATA([flows.txt], [dnl
4685 in_port=1, actions=output:2
4687 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
4689 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)"
4690 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
4691 AT_CHECK_UNQUOTED([tail -1 stdout], [0],
4692 [Datapath actions: 2
4695 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))"
4696 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
4697 AT_CHECK_UNQUOTED([tail -1 stdout], [0],
4698 [Datapath actions: 2
4701 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))"
4702 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
4703 AT_CHECK_UNQUOTED([tail -1 stdout], [0],
4704 [Datapath actions: 3,2
4711 AT_SETUP([ofproto-dpif - mirroring, output_port])
4712 AT_KEYWORDS([mirror mirrors mirroring])
4714 add_of_ports br0 1 2 3
4716 set Bridge br0 mirrors=@m --\
4717 --id=@p3 get Port p3 --\
4718 --id=@m create Mirror name=mymirror select_all=true output_port=@p3
4720 AT_DATA([flows.txt], [dnl
4721 in_port=1 actions=mod_vlan_vid:17,output:2
4722 in_port=2 actions=output:1
4724 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
4726 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)"
4727 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
4728 AT_CHECK_UNQUOTED([tail -1 stdout], [0],
4729 [Datapath actions: 3,push_vlan(vid=17,pcp=0),2
4732 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)"
4733 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
4734 AT_CHECK_UNQUOTED([tail -1 stdout], [0],
4735 [Datapath actions: 3,1
4741 AT_SETUP([ofproto-dpif - mirroring, output_vlan])
4742 AT_KEYWORDS([mirror mirrors mirroring])
4744 add_of_ports br0 1 2
4746 set Bridge br0 mirrors=@m --\
4747 --id=@m create Mirror name=mymirror select_all=true output_vlan=12
4749 AT_DATA([flows.txt], [dnl
4750 in_port=1 actions=output:2
4751 in_port=2 actions=mod_vlan_vid:17,output:1
4753 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
4755 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)"
4756 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
4757 actual=`tail -1 stdout | sed 's/Datapath actions: //'`
4759 expected="2,push_vlan(vid=12,pcp=0),1,2,100"
4760 AT_CHECK([ovs-dpctl normalize-actions "$flow" "$expected"], [0], [stdout])
4762 AT_CHECK([ovs-dpctl normalize-actions "$flow" "$actual"], [0], [expout])
4764 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)"
4765 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
4766 actual=`tail -1 stdout | sed 's/Datapath actions: //'`
4768 expected="push_vlan(vid=17,pcp=0),1,pop_vlan,push_vlan(vid=12,pcp=0),1,2,100"
4769 AT_CHECK([ovs-dpctl normalize-actions "$flow" "$expected"], [0], [stdout])
4771 AT_CHECK([ovs-dpctl normalize-actions "$flow" "$actual"], [0], [expout])
4776 # This verifies that we don't get duplicate mirroring when mirror_packet()
4777 # might be invoked recursively, as a check against regression.
4778 AT_SETUP([ofproto-dpif - multiple VLAN output mirrors])
4779 AT_KEYWORDS([mirror mirrors mirroring])
4781 add_of_ports br0 1 2 3
4783 -- set Bridge br0 fail-mode=standalone mirrors=@m1,@m2 \
4784 -- --id=@m1 create Mirror name=m1 select_all=true output_vlan=500 \
4785 -- --id=@m2 create Mirror name=m2 select_all=true output_vlan=501 \
4786 -- set Port br0 tag=0 \
4787 -- set Port p1 tag=0 \
4788 -- set Port p2 tag=500 \
4789 -- set Port p3 tag=501
4792 AT_CHECK([ovs-appctl ofproto/trace br0 "$flow"], [0], [stdout])
4793 AT_CHECK([tail -1 stdout | sed 's/Datapath actions: //
4795 /g' | sort], [0], [100
4803 # This test verifies that mirror state is preserved across recirculation.
4805 # Otherwise, post-recirculation the ingress and the output to port 4
4806 # would cause the packet to be mirrored to port 3 a second time.
4807 AT_SETUP([ofproto-dpif - mirroring with recirculation])
4808 AT_KEYWORDS([mirror mirrors mirroring])
4810 add_of_ports br0 1 2 3 4
4812 set Bridge br0 mirrors=@m --\
4813 --id=@p3 get Port p3 --\
4814 --id=@m create Mirror name=mymirror select_all=true output_port=@p3
4816 AT_DATA([flows.txt], [dnl
4817 in_port=1 actions=2,debug_recirc,4
4819 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
4821 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)"
4822 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow" -generate], [0], [stdout])
4823 AT_CHECK_UNQUOTED([tail -1 stdout], [0], [Datapath actions: 3,2,recirc(0x1)
4825 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow,recirc_id(1)" -generate], [0], [stdout])
4826 AT_CHECK_UNQUOTED([tail -1 stdout], [0], [Datapath actions: 4
4832 # Tests below verify the snaplen support for mirroring
4833 AT_SETUP([ofproto-dpif - mirroring, select_all with snaplen])
4834 AT_KEYWORDS([mirror mirrors mirroring])
4836 add_of_ports br0 1 2 3
4838 set Bridge br0 mirrors=@m --\
4839 --id=@p3 get Port p3 --\
4840 --id=@m create Mirror name=mymirror select_all=true output_port=@p3 snaplen=100
4842 AT_DATA([flows.txt], [dnl
4843 in_port=1 actions=output:2
4844 in_port=2 actions=output:1
4846 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
4848 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)"
4849 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
4850 AT_CHECK_UNQUOTED([tail -1 stdout], [0],
4851 [Datapath actions: trunc(100),3,2
4854 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)"
4855 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
4856 AT_CHECK_UNQUOTED([tail -1 stdout], [0],
4857 [Datapath actions: trunc(100),3,1
4863 AT_SETUP([ofproto-dpif - mirroring, select_all with snaplen and reset snaplen])
4864 AT_KEYWORDS([mirror mirrors mirroring])
4866 add_of_ports br0 1 2 3
4868 set Bridge br0 mirrors=@m --\
4869 --id=@p3 get Port p3 --\
4870 --id=@m create Mirror name=mymirror select_all=true output_port=@p3 snaplen=100
4872 AT_DATA([flows.txt], [dnl
4873 in_port=1 actions=output:2
4874 in_port=2 actions=output:1
4876 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
4878 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)"
4879 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
4880 AT_CHECK_UNQUOTED([tail -1 stdout], [0],
4881 [Datapath actions: trunc(100),3,2
4884 ovs-vsctl set mirror mymirror snaplen=77
4886 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)"
4887 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
4888 AT_CHECK_UNQUOTED([tail -1 stdout], [0],
4889 [Datapath actions: trunc(77),3,1
4892 ovs-vsctl set mirror mymirror snaplen=65535
4894 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)"
4895 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
4896 AT_CHECK_UNQUOTED([tail -1 stdout], [0],
4897 [Datapath actions: 3,1
4903 AT_SETUP([ofproto-dpif - mirroring, select_src with snaplen])
4904 AT_KEYWORDS([mirror mirrors mirroring])
4906 add_of_ports br0 1 2 3
4908 set Bridge br0 mirrors=@m --\
4909 --id=@p1 get Port p1 -- --id=@p3 get Port p3 --\
4910 --id=@m create Mirror name=mymirror select_src_port=@p1 output_port=@p3 snaplen=100
4912 AT_DATA([flows.txt], [dnl
4913 in_port=1 actions=output:2
4914 in_port=2 actions=output:1
4916 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
4918 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)"
4919 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
4920 AT_CHECK_UNQUOTED([tail -1 stdout], [0],
4921 [Datapath actions: trunc(100),3,2
4924 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)"
4925 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
4926 AT_CHECK_UNQUOTED([tail -1 stdout], [0],
4927 [Datapath actions: 1
4932 AT_SETUP([ofproto-dpif - mirroring, OFPP_NONE ingress port with snaplen])
4933 AT_KEYWORDS([mirror mirrors mirroring])
4935 add_of_ports br0 1 2
4937 set Bridge br0 mirrors=@m --\
4938 --id=@p2 get Port p2 --\
4939 --id=@m create Mirror name=mymirror select_all=true output_port=@p2 snaplen=100
4941 AT_CHECK([ovs-ofctl add-flow br0 action=output:1])
4943 # "in_port" defaults to OFPP_NONE if it's not specified.
4944 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"
4945 AT_CHECK([ovs-appctl ofproto/trace br0 "$flow"], [0], [stdout])
4946 AT_CHECK_UNQUOTED([tail -1 stdout], [0],
4947 [Datapath actions: 1,trunc(100),2
4953 AT_SETUP([ofproto-dpif - mirroring, select_dst with snaplen])
4954 AT_KEYWORDS([mirror mirrors mirroring])
4956 add_of_ports br0 1 2 3
4958 set Bridge br0 mirrors=@m --\
4959 --id=@p2 get Port p2 -- --id=@p3 get Port p3 --\
4960 --id=@m create Mirror name=mymirror select_dst_port=@p2 output_port=@p3 snaplen=100
4962 AT_DATA([flows.txt], [dnl
4963 in_port=1 actions=output:2
4964 in_port=2 actions=output:1
4966 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
4968 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)"
4969 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
4970 AT_CHECK_UNQUOTED([tail -1 stdout], [0],
4971 [Datapath actions: 2,trunc(100),3
4974 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)"
4975 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
4976 AT_CHECK_UNQUOTED([tail -1 stdout], [0],
4977 [Datapath actions: 1
4983 AT_SETUP([ofproto-dpif - mirroring, select_vlan with snaplen])
4984 AT_KEYWORDS([mirror mirrors mirroring])
4986 add_of_ports br0 1 2 3
4988 set Bridge br0 mirrors=@m --\
4989 --id=@p2 get Port p2 -- --id=@p3 get Port p3 --\
4990 --id=@m create Mirror name=mymirror select_all=true select_vlan=11 output_port=@p3 snaplen=100
4992 AT_DATA([flows.txt], [dnl
4993 in_port=1, actions=output:2
4995 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
4997 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)"
4998 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
4999 AT_CHECK_UNQUOTED([tail -1 stdout], [0],
5000 [Datapath actions: 2
5003 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))"
5004 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
5005 AT_CHECK_UNQUOTED([tail -1 stdout], [0],
5006 [Datapath actions: 2
5009 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))"
5010 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
5011 AT_CHECK_UNQUOTED([tail -1 stdout], [0],
5012 [Datapath actions: trunc(100),3,2
5018 AT_SETUP([ofproto-dpif - mirroring, output_port with snaplen])
5019 AT_KEYWORDS([mirror mirrors mirroring])
5021 add_of_ports br0 1 2 3
5023 set Bridge br0 mirrors=@m --\
5024 --id=@p3 get Port p3 --\
5025 --id=@m create Mirror name=mymirror select_all=true output_port=@p3 snaplen=100
5027 AT_DATA([flows.txt], [dnl
5028 in_port=1 actions=mod_vlan_vid:17,output:2
5029 in_port=2 actions=output:1
5031 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
5033 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)"
5034 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
5035 AT_CHECK_UNQUOTED([tail -1 stdout], [0],
5036 [Datapath actions: trunc(100),3,push_vlan(vid=17,pcp=0),2
5039 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)"
5040 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
5041 AT_CHECK_UNQUOTED([tail -1 stdout], [0],
5042 [Datapath actions: trunc(100),3,1
5048 AT_SETUP([ofproto-dpif - mirroring, output_vlan with snaplen])
5049 AT_KEYWORDS([mirror mirrors mirroring])
5051 add_of_ports br0 1 2
5053 set Bridge br0 mirrors=@m --\
5054 --id=@m create Mirror name=mymirror select_all=true output_vlan=12 snaplen=100
5056 AT_DATA([flows.txt], [dnl
5057 in_port=1 actions=output:2
5058 in_port=2 actions=mod_vlan_vid:17,output:1
5060 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
5062 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)"
5063 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
5064 actual=`tail -1 stdout | sed 's/Datapath actions: //'`
5065 dnl Expect: "trunc(100),100,trunc(100),2,trunc(100),1", with different order
5066 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])
5068 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)"
5069 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
5070 actual=`tail -1 stdout | sed 's/Datapath actions: //'`
5071 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])
5076 AT_SETUP([ofproto-dpif - multiple VLAN output mirrors with snaplen])
5077 AT_KEYWORDS([mirror mirrors mirroring])
5079 add_of_ports br0 1 2 3
5081 -- set Bridge br0 fail-mode=standalone mirrors=@m1,@m2 \
5082 -- --id=@m1 create Mirror name=m1 select_all=true output_vlan=500 snaplen=200 \
5083 -- --id=@m2 create Mirror name=m2 select_all=true output_vlan=501 snaplen=300 \
5084 -- set Port br0 tag=0 \
5085 -- set Port p1 tag=0 \
5086 -- set Port p2 tag=500 \
5087 -- set Port p3 tag=501
5090 AT_CHECK([ovs-appctl ofproto/trace br0 "$flow"], [0], [stdout])
5091 AT_CHECK([tail -1 stdout | egrep "trunc\(200\),2,trunc\(300\),3,100|trunc\(300\),3,trunc\(200\),2,100"], [0], [stdout])
5096 # This test verifies that the table ID is preserved across recirculation
5097 # when a resubmit action requires it (because the action is relative to
5098 # the current table rather than specifying a table).
5099 AT_SETUP([ofproto-dpif - resubmit with recirculation])
5101 add_of_ports br0 1 2 3
5103 AT_DATA([flows.txt], [dnl
5104 table=0 in_port=1 actions=2,resubmit(,1)
5105 table=1 in_port=1 actions=debug_recirc,resubmit:55
5106 table=1 in_port=55 actions=3
5108 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
5110 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)"
5111 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow" -generate], [0], [stdout])
5112 AT_CHECK_UNQUOTED([tail -1 stdout], [0], [Datapath actions: 2,recirc(0x1)
5114 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow,recirc_id(1)" -generate], [0], [stdout])
5115 AT_CHECK_UNQUOTED([tail -1 stdout], [0], [Datapath actions: 3
5122 # This test verifies that tunnel metadata is preserved across
5123 # recirculation. At the time of recirculation, fields such as "tun_id"
5124 # may be set before the tunnel is "valid" (ie, has a destination
5125 # address), but the field should still be available after recirculation.
5126 AT_SETUP([ofproto-dpif - resubmit with tun_id])
5128 add_of_ports br0 1 2 3
5130 AT_DATA([flows.txt], [dnl
5131 table=0 in_port=1 actions=2,load:6->NXM_NX_TUN_ID[[]],resubmit(,1)
5132 table=1 in_port=1 actions=debug_recirc,resubmit:55
5133 table=1 in_port=55 actions=3
5135 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
5137 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)"
5138 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow" -generate], [0], [stdout])
5139 AT_CHECK([grep "Final flow:" stdout], [0], [Final flow: icmp,tun_id=0x6,in_port=1,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=128,icmp_type=8,icmp_code=0
5142 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow,recirc_id(1)" -generate], [0], [stdout])
5143 AT_CHECK([grep "Final flow:" stdout], [0], [Final flow: recirc_id=0x1,eth,icmp,tun_id=0x6,in_port=1,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=128,icmp_type=8,icmp_code=0
5150 # This test verifies that "resubmit", when it triggers recirculation
5151 # indirectly through the flow that it recursively invokes, is not
5152 # re-executed when execution continues later post-recirculation.
5153 AT_SETUP([ofproto-dpif - recirculation after resubmit])
5155 add_of_ports br0 1 2
5157 AT_DATA([flows.txt], [dnl
5158 table=0 in_port=1 actions=resubmit(,1),2
5159 table=1 in_port=1 actions=debug_recirc
5161 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
5163 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)"
5164 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow" -generate], [0], [stdout])
5165 AT_CHECK_UNQUOTED([tail -1 stdout], [0], [Datapath actions: recirc(0x1)
5167 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow,recirc_id(1)" -generate], [0], [stdout])
5168 AT_CHECK_UNQUOTED([tail -1 stdout], [0], [Datapath actions: 2
5175 AT_SETUP([ofproto-dpif - debug_slow action])
5177 add_of_ports br0 1 2 3
5179 AT_CHECK([ovs-ofctl add-flow br0 "in_port=1,actions=debug_slow,2"])
5181 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)"
5183 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow" -generate], [0], [stdout])
5184 AT_CHECK_UNQUOTED([tail -3 stdout], [0], [Datapath actions: 2
5185 This flow is handled by the userspace slow path because it:
5186 - Uses action(s) not supported by datapath.
5193 dnl CHECK_CONTINUATION(TITLE, N_PORTS0, N_PORTS1, ACTIONS0, ACTIONS1, [EXTRA_SETUP])
5195 dnl Checks the implementation of the continuation mechanism that allows the
5196 dnl packet processing pipeline to be paused and resumed. Starts by creating
5197 dnl bridge br0 with N_PORTS0 ports numbered 1 through N_PORTS0, and adds the
5198 dnl flows listed in ACTIONS0 to that bridge. Then, injects a packet at port 1
5199 dnl in the bridge, resuming each time the pipeline pauses, and expects a single
5200 dnl packet to be output at each port 2 through N_PORTS0. Then, as long as
5201 dnl ACTIONS0 still contains at least one "pause" action, removes one of them
5202 dnl and repeats the process.
5204 dnl If N_PORTS1 is nonzero, also creates a bridge br1 and adds ports numbered
5205 dnl N_PORTS0 + 1 to N_PORTS0 + N_PORTS1 to it, as well as flows ACTIONS1.
5206 dnl ACTIONS1 may also contain "pause" actions. Packets are only ever injected
5207 dnl into port 1 on br0, so br1 only comes into action if a patch port (added
5208 dnl by EXTRA_SETUP) jumps from one bridge to another.
5210 dnl EXTRA_SETUP is an optional list of extra commands to run after setting up
5211 dnl both bridges, e.g. to configure mirrors or patch ports.
5212 m4_define([CHECK_CONTINUATION], [dnl
5213 AT_SETUP([ofproto-dpif - continuation - $1])
5214 AT_KEYWORDS([continuations pause resume])
5217 # count_matches STRING
5219 # Prints on stdout the number of occurrences of STRING in stdin.
5226 add_of_ports --pcap br0 `seq 1 $2`
5227 m4_if([$3], [0], [],
5229 add_of_ports --pcap br1 `seq m4_eval([$2 + 1]) m4_eval([$2 + $3])`])
5231 AT_CAPTURE_FILE([ofctl_monitor0.log])
5232 AT_CHECK([ovs-ofctl monitor br0 resume --detach --no-chdir --pidfile=ovs-ofctl0.pid 2> ofctl_monitor0.log])
5233 m4_if([$3], [0], [],
5234 [AT_CAPTURE_FILE([ofctl_monitor1.log])
5235 AT_CHECK([ovs-ofctl monitor br1 resume --detach --no-chdir --pidfile=ovs-ofctl1.pid 2> ofctl_monitor1.log])])
5240 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)"
5244 printf "\n\nactions for br0:\n%s\n" "$actions0"
5245 m4_if([$3], [0], [], [printf "actions for br1:\n%s\n" "$actions1"])
5248 AT_CHECK([echo "$actions0" | sed 's/pause/controller(pause)/g' | ovs-ofctl -O OpenFlow13 add-flows br0 -])
5249 m4_if([$3], [0], [],
5250 [AT_CHECK([echo "$actions1" | sed 's/pause/controller(pause)/g' | ovs-ofctl -O OpenFlow13 add-flows br1 -])])
5252 # Make sure the datapath is up-to-date before sending the packet.
5253 ovs-appctl revalidator/wait
5255 # Run a packet through the switch.
5256 AT_CHECK([ovs-appctl netdev-dummy/receive p1 "$flow"], [0], [stdout])
5258 # Wait for the expected number of packets to show up.
5259 n_packets=`expr $n_packets + $2 - 1 + $3`
5260 echo "waiting for $n_packets packets..."
5261 OVS_WAIT_UNTIL([test $n_packets = `ovs-ofctl parse-pcap p*-tx.pcap | wc -l`])
5263 # Wait for the expected number of NXT_RESUMEs to be logged.
5264 n_resumes=$(expr $n_resumes + $(echo "$actions0 $actions1" | count_matches pause) )
5265 echo "waiting for $n_resumes NXT_RESUMEs..."
5266 OVS_WAIT_UNTIL([test $n_resumes = `cat ofctl_monitor*.log | grep -c NXT_RESUME`])
5268 # Eliminate one "pause" from the actions.
5270 # If there were none left, then we're done.
5271 next_actions0=`echo "$actions0" | sed '1,/pause/s/pause//'`
5272 if test X"$actions0" = X"$next_actions0"; then
5273 next_actions1=`echo "$actions1" | sed '1,/pause/s/pause//'`
5274 if test X"$actions1" = X"$next_actions1"; then
5277 actions1=$next_actions1
5280 actions0=$next_actions0
5283 # Delete all the flows and verify that there are none, so that we
5284 # can be sure that our updated flow tables is actually in use
5286 AT_CHECK([ovs-ofctl del-flows br0 && ovs-ofctl dump-flows br0 | strip_xids], [0],
5289 m4_if([$3], [0], [],
5290 [AT_CHECK([ovs-ofctl del-flows br1 && ovs-ofctl dump-flows br1 | strip_xids], [0],
5298 # Check that pause at the end of the pipeline works OK.
5300 # (xlate_continuation() has a special case for no-op actions; this
5301 # fails without that special case.)
5302 CHECK_CONTINUATION([pause at end of pipeline], [2], [0], [actions=2 pause])
5304 # Check that remaining actions are preserved following resume.
5305 CHECK_CONTINUATION([actions], [7], [0],
5306 [in_port=1 actions=pause 2 pause 3 pause 4 pause 5 pause 6 pause 7])
5308 # Check that multiple levels of resubmit continue following resume.
5310 # The "resubmit:55", which is relative to the current table, is
5311 # particularly interesting because it checks that the notion of the
5312 # current table is correctly preserved.
5313 CHECK_CONTINUATION([resubmit], [10], [0],
5314 [table=0 in_port=1 actions=pause 2 pause resubmit(,1) pause 10 pause
5315 table=1 in_port=1 actions=pause 3 pause resubmit(,2) pause 9 pause
5316 table=2 in_port=1 actions=pause 4 pause resubmit(,3) pause 8 pause
5317 table=3 in_port=1 actions=pause 5 pause resubmit:55 pause 7 pause
5318 table=3 in_port=55 actions=pause 6 pause])
5320 # Check that the action set is preserved across pause/resume.
5321 CHECK_CONTINUATION([action set], [3], [0],
5322 [in_port=1 actions=1 pause resubmit(,1) pause 2
5323 table=1 actions=write_actions(3)])
5325 # Check that metadata and the stack used by push and pop is preserved
5326 # across pause/resume.
5327 CHECK_CONTINUATION([data stack], [3], [0],
5328 [in_port=1 actions=pause dnl
5329 set_field:1->reg0 dnl
5331 set_field:2->reg1 dnl
5333 output:NXM_NX_REG0[[]] dnl
5335 push:NXM_NX_REG1[[]] dnl
5337 pop:NXM_NX_REG2[[]] dnl
5339 output:NXM_NX_REG2[[]] dnl
5343 # Check that mirror output occurs once and once only, even if
5344 # separated by pause/resume.
5345 CHECK_CONTINUATION([mirroring], [5], [0],
5346 [in_port=1 actions=pause 2 pause 3 pause 4 pause], [],
5348 set Bridge br0 mirrors=@m --\
5349 --id=@p2 get Port p2 --\
5350 --id=@p3 get Port p3 --\
5351 --id=@p4 get Port p4 --\
5352 --id=@p5 get Port p5 --\
5353 --id=@m create Mirror name=mymirror select_dst_port=@p2,@p3,@p4 output_port=@p5])
5355 # Check that pause works in the presence of patch ports.
5356 CHECK_CONTINUATION([patch ports], [4], [1],
5357 [table=0 in_port=1 actions=pause 2 resubmit(,1) pause 4
5358 table=1 in_port=1 actions=pause 3 pause 10 pause],
5359 [table=0 in_port=11 actions=pause 5 pause],
5361 -- add-port br0 patch10 \
5362 -- set interface patch10 type=patch options:peer=patch11 \
5364 -- add-port br1 patch11 \
5365 -- set interface patch11 type=patch options:peer=patch10 \
5368 AT_SETUP([ofproto-dpif - continuation flow stats])
5369 AT_KEYWORDS([continuations pause resume])
5372 add_of_ports --pcap br0 `seq 1 2`
5374 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)"
5376 AT_DATA([flows.txt], [dnl
5377 table=0 in_port=1 actions=set_field:1->reg1 controller(pause) resubmit(,2)
5378 table=2 reg1=0x1 actions=2
5381 AT_CHECK([ovs-ofctl -O OpenFlow13 add-flows br0 flows.txt])
5383 AT_CAPTURE_FILE([ofctl_monitor0.log])
5384 ovs-ofctl monitor br0 resume --detach --no-chdir \
5385 --pidfile=ovs-ofctl0.pid 2> ofctl_monitor0.log
5387 # Run a packet through the switch.
5388 AT_CHECK([ovs-appctl netdev-dummy/receive p1 "$flow"], [0], [stdout])
5391 AT_CHECK([ovs-ofctl dump-flows br0], [0], [stdout])
5392 AT_CHECK([strip_xids < stdout | sed -n 's/duration=[[0-9]]*\.[[0-9]]*s/duration=0.0s/p' | sed -n 's/idle_age=[[0-9]]*/idle_age=0/p' | grep 'table=2'], [0], [dnl
5393 cookie=0x0, duration=0.0s, table=2, n_packets=1, n_bytes=106, idle_age=0, reg1=0x1 actions=output:2
5396 # The packet should be received by port 2
5397 AT_CHECK([test 1 = `$PYTHON "$top_srcdir/utilities/ovs-pcap.in" p2-tx.pcap | wc -l`])
5402 AT_SETUP([ofproto-dpif - continuation with conntrack])
5403 AT_KEYWORDS([continuations pause resume])
5406 add_of_ports --pcap br0 `seq 1 2`
5408 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)"
5410 AT_DATA([flows.txt], [dnl
5411 table=0, in_port=1 icmp action=ct(table=1)
5412 table=1, icmp action=controller(pause) resubmit(,2)
5413 table=2, in_port=1 icmp ct_state=+trk+new action=output:2
5416 AT_CHECK([ovs-ofctl -O OpenFlow13 add-flows br0 flows.txt])
5418 AT_CAPTURE_FILE([ofctl_monitor0.log])
5419 ovs-ofctl monitor br0 resume --detach --no-chdir \
5420 --pidfile=ovs-ofctl0.pid 2> ofctl_monitor0.log
5422 # Run a packet through the switch.
5423 AT_CHECK([ovs-appctl netdev-dummy/receive p1 "$flow"], [0], [stdout])
5426 AT_CHECK([ovs-ofctl dump-flows br0], [0], [stdout])
5427 AT_CHECK([strip_xids < stdout | sed -n 's/duration=[[0-9]]*\.[[0-9]]*s/duration=0.0s/p' | sed -n 's/idle_age=[[0-9]]*/idle_age=0/p' | grep 'table=2'], [0], [dnl
5428 cookie=0x0, duration=0.0s, table=2, n_packets=1, n_bytes=106, idle_age=0, ct_state=+new+trk,icmp,in_port=1 actions=output:2
5431 # The packet should be received by port 2
5432 AT_CHECK([test 1 = `$PYTHON "$top_srcdir/utilities/ovs-pcap.in" p2-tx.pcap | wc -l`])
5437 # Check that pause works after the packet is cloned.
5438 AT_SETUP([ofproto-dpif - continuation after clone])
5439 AT_KEYWORDS([continuations clone pause resume])
5442 add_of_ports --pcap br0 `seq 1 3`
5444 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)"
5446 AT_DATA([flows.txt], [dnl
5447 table=0 in_port=1 actions=set_field:1->reg1 resubmit(,2)
5448 table=1 reg1=0x5 actions=controller(pause) resubmit(,3)
5449 table=1 reg1=0x1 actions=2
5450 table=2 in_port=1 actions=clone(set_field:5->reg1, resubmit(,1))
5451 table=3 reg1=0x1 actions=3
5452 table=3 reg1=0x5 actions=2
5455 AT_CHECK([ovs-ofctl -O OpenFlow13 add-flows br0 flows.txt])
5457 AT_CAPTURE_FILE([ofctl_monitor0.log])
5458 ovs-ofctl monitor br0 resume --detach --no-chdir \
5459 --pidfile=ovs-ofctl0.pid 2> ofctl_monitor0.log
5461 # Run a packet through the switch.
5462 AT_CHECK([ovs-appctl netdev-dummy/receive p1 "$flow"], [0], [stdout])
5465 ovs-ofctl dump-flows br0
5467 # The packet should be received by port 2 and not port 3
5468 AT_CHECK([test 1 = `$PYTHON "$top_srcdir/utilities/ovs-pcap.in" p2-tx.pcap | wc -l`])
5469 AT_CHECK([test 0 = `$PYTHON "$top_srcdir/utilities/ovs-pcap.in" p3-tx.pcap | wc -l`])
5471 # NXT_RESUMEs should be 1 and reg1 should be set to 0x5.
5472 OVS_WAIT_UNTIL([test 1 = `cat ofctl_monitor*.log | grep NXT_RESUME | grep -c reg1=0x5`])
5477 # Two testcases below are for the ofproto/trace command
5478 # The first one tests all correct syntax:
5479 # ofproto/trace [dp_name] odp_flow [-generate|packet]
5480 # ofproto/trace br_name br_flow [-generate|packet]
5481 AT_SETUP([ofproto-dpif - ofproto/trace command 1])
5482 OVS_VSWITCHD_START([set bridge br0 fail-mode=standalone])
5483 add_of_ports br0 1 2 3
5485 AT_DATA([flows.txt], [dnl
5486 in_port=1 actions=output:2
5487 in_port=2 actions=output:1
5489 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
5491 odp_flow="in_port(p1)"
5493 # Test command: ofproto/trace odp_flow with in_port as a name.
5494 AT_CHECK([ovs-appctl ofproto/trace "$odp_flow"], [0], [stdout])
5495 AT_CHECK([tail -1 stdout], [0], [dnl
5499 odp_flow="in_port(1)"
5500 # Test command: ofproto/trace odp_flow
5501 AT_CHECK([ovs-appctl ofproto/trace "$odp_flow"], [0], [stdout])
5502 AT_CHECK([tail -1 stdout], [0], [dnl
5506 # Test command: ofproto/trace dp_name odp_flow
5507 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$odp_flow"], [0], [stdout])
5508 AT_CHECK([tail -1 stdout], [0], [dnl
5511 # Test commmand: ofproto/trace br_name br_flow
5512 AT_CHECK([ovs-appctl ofproto/trace br0 "$br_flow"], [0], [stdout])
5513 AT_CHECK([tail -1 stdout], [0], [dnl
5517 # Delete the inserted flows
5518 AT_CHECK([ovs-ofctl del-flows br0 "in_port=1"], [0], [stdout])
5519 AT_CHECK([ovs-ofctl del-flows br0 "in_port=2"], [0], [stdout])
5521 # This section below tests the [-generate] option
5522 odp_flow="in_port(3),eth(src=50:54:00:00:00:05,dst=ff:ff:ff:ff:ff:ff)"
5523 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"
5525 # Test command: ofproto/trace odp_flow
5526 AT_CHECK([ovs-appctl ofproto/trace "$odp_flow"], [0], [stdout])
5527 # Check for no MAC learning entry
5528 AT_CHECK_UNQUOTED([ovs-appctl fdb/show br0 | sed 's/[[0-9]]\{1,\}$/?/'], [0], [dnl
5532 # Test command: ofproto/trace br_name br_flow
5533 AT_CHECK([ovs-appctl ofproto/trace br0 "$br_flow"], [0], [stdout])
5534 # Check for no MAC learning entry
5535 AT_CHECK_UNQUOTED([ovs-appctl fdb/show br0 | sed 's/[[0-9]]\{1,\}$/?/'], [0], [dnl
5539 # Test command: ofproto/trace odp_flow -generate
5540 AT_CHECK([ovs-appctl ofproto/trace "$odp_flow" -generate], [0], [stdout])
5541 # Check for the MAC learning entry
5542 AT_CHECK_UNQUOTED([ovs-appctl fdb/show br0 | sed 's/[[0-9]]\{1,\}$/?/'], [0], [dnl
5544 3 0 50:54:00:00:00:05 ?
5547 # Test command: ofproto/trace dp_name odp_flow -generate
5548 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy \
5549 "in_port(1),eth(src=50:54:00:00:00:06,dst=50:54:00:00:00:05)" \
5550 -generate], [0], [stdout])
5551 # Check for both MAC learning entries
5552 AT_CHECK_UNQUOTED([ovs-appctl fdb/show br0 | sed 's/[[0-9]]\{1,\}$/?/'], [0], [dnl
5554 3 0 50:54:00:00:00:05 ?
5555 1 0 50:54:00:00:00:06 ?
5558 # Test command: ofproto/trace br_name br_flow -generate
5559 AT_CHECK([ovs-appctl ofproto/trace br0 \
5560 "in_port=2,dl_src=50:54:00:00:00:07,dl_dst=50:54:00:00:00:06" \
5561 -generate], [0], [stdout])
5562 # Check for both MAC learning entries.
5563 AT_CHECK_UNQUOTED([ovs-appctl fdb/show br0 | sed 's/[[0-9]]\{1,\}$/?/'], [0], [dnl
5565 3 0 50:54:00:00:00:05 ?
5566 1 0 50:54:00:00:00:06 ?
5567 2 0 50:54:00:00:00:07 ?
5570 # This section beflow tests the [packet] option
5571 # The ovs-tcpundump of packets between port1 and port2
5572 pkt1to2="50540000000250540000000108064500001C000100004001F98CC0A80001C0A800020800F7FF00000000"
5573 pkt2to1="50540000000150540000000208064500001C000100004001F98CC0A80002C0A800010800F7FF00000000"
5575 # Construct the MAC learning table
5576 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy \
5577 "in_port(1),eth(src=50:54:00:00:00:01,dst=ff:ff:ff:ff:ff:ff)" \
5578 -generate], [0], [stdout])
5580 # Construct the MAC learning table
5581 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy \
5582 "in_port(2),eth(src=50:54:00:00:00:02,dst=ff:ff:ff:ff:ff:ff)" \
5583 -generate], [0], [stdout])
5585 # Test command: ofproto/trace odp_flow packet
5586 AT_CHECK([ovs-appctl ofproto/trace \
5587 "in_port(1),skb_priority(1),skb_mark(2)" "$pkt1to2"], [0], [stdout])
5588 AT_CHECK([tail -1 stdout], [0], [dnl
5591 AT_CHECK([head -n 3 stdout], [0], [dnl
5592 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
5597 # Test command: ofproto/trace dp_name odp_flow packet
5598 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy \
5599 "in_port(1),skb_priority(1),skb_mark(2)" "$pkt1to2"], [0], [stdout])
5600 AT_CHECK([tail -1 stdout], [0], [dnl
5603 AT_CHECK([head -n 3 stdout], [0], [dnl
5604 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
5609 # Test command: ofproto/trace br_name br_flow packet
5610 AT_CHECK([ovs-appctl ofproto/trace br0 \
5611 "in_port=2,skb_priority=2,pkt_mark=1" "$pkt2to1"], [0], [stdout],[stderr])
5612 AT_CHECK([tail -1 stdout], [0], [dnl
5615 AT_CHECK([head -n 3 stdout], [0], [dnl
5616 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
5624 # The second test tests the corner cases
5625 AT_SETUP([ofproto-dpif - ofproto/trace command 2])
5627 add_of_ports br0 1 2
5630 odp_flow="in_port(1),eth(src=50:54:00:00:00:01,dst=50:54:00:00:00:02)"
5631 br_flow="in_port=1,dl_src=50:54:00:00:00:01,dl_dst=50:54:00:00:00:02"
5633 generate="-generate"
5634 pkt="50540000000250540000000108064500001C000100004001F98CC0A80001C0A800020800F7FF00000000"
5636 # Test incorrect command: ofproto/trace wrong_name odp_flow [-generate|packet]
5642 [AT_CHECK([ovs-appctl ofproto/trace wrong_name "$odp_flow" option],
5644 AT_CHECK([tail -2 stderr], [0], [dnl
5645 Cannot find the datapath
5646 ovs-appctl: ovs-vswitchd: server returned an error
5649 # Test incorrect command: ofproto/trace empty_string odp_flow [-generate|packet]
5655 [AT_CHECK([ovs-appctl ofproto/trace "" "$odp_flow" option],
5657 AT_CHECK([tail -2 stderr], [0], [dnl
5658 Cannot find the datapath
5659 ovs-appctl: ovs-vswitchd: server returned an error
5662 # Test incorrect command: ofproto/trace nonexist_dp_name odp_flow [-generate|packet]
5668 [AT_CHECK([ovs-appctl ofproto/trace ovs-system "$odp_flow" option],
5670 AT_CHECK([tail -2 stderr], [0], [dnl
5671 Cannot find the datapath
5672 ovs-appctl: ovs-vswitchd: server returned an error
5675 # Test incorrect command: ofproto/trace br_name odp_flow [-generate|packet]
5681 [AT_CHECK([ovs-appctl ofproto/trace br0 "$odp_flow" option],
5683 AT_CHECK([tail -2 stderr], [0], [dnl
5684 Cannot find the datapath
5685 ovs-appctl: ovs-vswitchd: server returned an error
5688 # Test incorrect command: ofproto/trace dp_name br_flow [-generate|packet]
5694 [AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$br_flow" option],
5696 AT_CHECK([tail -2 stderr], [0], [dnl
5697 ovs-dummy: unknown bridge
5698 ovs-appctl: ovs-vswitchd: server returned an error
5701 # Test incorrect command: ofproto/trace br_flow [-generate|packet]
5707 [AT_CHECK([ovs-appctl ofproto/trace "$br_flow" option],
5709 AT_CHECK([tail -2 stderr], [0], [dnl
5710 syntax error at in_port=1,dl_src=50:54:00:00:00:01,dl_dst=50:54:00:00:00:02 (or the bridge name was omitted)
5711 ovs-appctl: ovs-vswitchd: server returned an error
5714 # Test incorrect command: ofproto/trace dp_name odp_flow garbage_option
5715 AT_CHECK([ovs-appctl ofproto/trace \
5716 ovs-dummy "$odp_flow" garbage_option],
5717 [2], [stdout],[stderr])
5718 AT_CHECK([tail -2 stderr], [0], [dnl
5719 Trailing garbage in packet data
5720 ovs-appctl: ovs-vswitchd: server returned an error
5723 # Test incorrect command: ofproto/trace with 0 argument
5724 AT_CHECK([ovs-appctl ofproto/trace ], [2], [stdout],[stderr])
5725 AT_CHECK([tail -2 stderr], [0], [dnl
5726 "ofproto/trace" command requires at least 1 arguments
5727 ovs-appctl: ovs-vswitchd: server returned an error
5733 # The third test checks that the output of "ovs-dpctl -m" is valid to trace.
5734 AT_SETUP([ofproto-dpif - ofproto/trace from dpctl output])
5735 OVS_VSWITCHD_START([dnl
5736 set Open_vSwitch . other_config:max-idle=10000 \
5737 -- add-port br0 p1 -- set Interface p1 type=dummy])
5739 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)'])
5740 ovs-appctl revalidator/wait
5741 AT_CHECK([ovs-appctl dpif/dump-flows -m br0 | sed 's/, packets.*$//' > dp_flows1.txt])
5743 odp_flow=`cat dp_flows1.txt`
5744 AT_CHECK([ovs-appctl ofproto/trace "$odp_flow" | sed 's/\([[Ff]]low:\).*/\1 <cleared>/'], [0], [dnl
5752 Final flow: <cleared>
5754 Datapath actions: drop
5757 dnl Now, try again without megaflows:
5758 ovs-appctl upcall/disable-megaflows
5760 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)'])
5761 ovs-appctl revalidator/wait
5762 AT_CHECK([ovs-appctl dpif/dump-flows -m br0 | sed 's/, packets.*$//' > dp_flows2.txt])
5764 odp_flow=`cat dp_flows2.txt`
5765 AT_CHECK([ovs-appctl ofproto/trace "$odp_flow" | sed 's/\([[Ff]]low:\).*/\1 <cleared>/'], [0], [dnl
5773 Final flow: <cleared>
5775 Datapath actions: drop
5781 AT_SETUP([ofproto-dpif - ofproto/trace-packet-out])
5783 add_of_ports br0 1 2 3
5785 AT_DATA([flows.txt], [dnl
5786 in_port=1 actions=output:2
5787 in_port=2 actions=output:1
5789 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
5791 AT_CHECK([ovs-appctl ofproto/trace-packet-out br0 in_port=1 'mod_vlan_vid:123,resubmit(,0)'], [0], [stdout])
5792 AT_CHECK([tail -1 stdout], [0], [dnl
5793 Datapath actions: push_vlan(vid=123,pcp=0),2
5800 m4_define([OFPROTO_TRACE],
5802 AT_CHECK([ovs-appctl ofproto/trace $1 "$flow" $3], [0], [stdout])
5803 actual=`tail -1 stdout | sed 's/Datapath actions: //'`
5805 AT_CHECK([ovs-dpctl normalize-actions "$flow" "$expected" $5],
5808 AT_CHECK([ovs-dpctl normalize-actions "$flow" "$actual" $5],
5811 AT_SETUP([ofproto-dpif - MAC learning])
5812 OVS_VSWITCHD_START([set bridge br0 fail-mode=standalone])
5813 add_of_ports br0 1 2 3
5815 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)'
5817 # Trace an ARP packet arriving on p3, to create a MAC learning entry.
5820 [in_port(3),eth(src=50:54:00:00:00:05,dst=ff:ff:ff:ff:ff:ff),$arp],
5824 # Check for the MAC learning entry.
5825 AT_CHECK_UNQUOTED([ovs-appctl fdb/show br0 | sed 's/[[0-9]]\{1,\}$/?/'], [0], [dnl
5827 3 0 50:54:00:00:00:05 ?
5830 # Trace a packet arrival destined for the learned MAC.
5831 # (This will also learn a MAC.)
5834 [in_port(1),eth(src=50:54:00:00:00:06,dst=50:54:00:00:00:05),$arp],
5838 # Check for both MAC learning entries.
5839 AT_CHECK_UNQUOTED([ovs-appctl fdb/show br0 | sed 's/[[0-9]]\{1,\}$/?/'], [0], [dnl
5841 3 0 50:54:00:00:00:05 ?
5842 1 0 50:54:00:00:00:06 ?
5845 # Trace a packet arrival that updates the first learned MAC entry.
5848 [in_port(2),eth(src=50:54:00:00:00:05,dst=ff:ff:ff:ff:ff:ff),$arp],
5852 # Check that the MAC learning entry was updated.
5853 AT_CHECK_UNQUOTED([ovs-appctl fdb/show br0 | sed 's/[[0-9]]\{1,\}$/?/'], [0], [dnl
5855 1 0 50:54:00:00:00:06 ?
5856 2 0 50:54:00:00:00:05 ?
5859 # Add another bridge.
5863 -- set bridge br1 datapath-type=dummy])
5864 add_of_ports br1 4 5
5866 # Trace some packet arrivals in br1 to create MAC learning entries there too.
5869 [in_port(4),eth(src=50:54:00:00:00:06,dst=ff:ff:ff:ff:ff:ff),$arp],
5874 [in_port(5),eth(src=50:54:00:00:00:07,dst=ff:ff:ff:ff:ff:ff),$arp],
5878 # Check that the MAC learning entries were added.
5879 AT_CHECK_UNQUOTED([ovs-appctl fdb/show br1 | sed 's/[[0-9]]\{1,\}$/?/'], [0], [dnl
5881 4 0 50:54:00:00:00:06 ?
5882 5 0 50:54:00:00:00:07 ?
5885 # Delete port p1 and see that its MAC learning entry disappeared, and
5886 # that the MAC learning entry for the same MAC was also deleted from br1.
5887 AT_CHECK([ovs-vsctl del-port p1])
5888 AT_CHECK_UNQUOTED([ovs-appctl fdb/show br0 | sed 's/[[0-9]]\{1,\}$/?/'], [0], [dnl
5890 2 0 50:54:00:00:00:05 ?
5892 AT_CHECK_UNQUOTED([ovs-appctl fdb/show br1 | sed 's/[[0-9]]\{1,\}$/?/'], [0], [dnl
5894 5 0 50:54:00:00:00:07 ?
5900 AT_SETUP([ofproto-dpif - MAC table overflow])
5902 [set bridge br0 fail-mode=standalone other-config:mac-table-size=10])
5903 add_of_ports br0 1 2 3
5905 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)'
5907 AT_CHECK([ovs-appctl time/stop])
5909 # Trace 10 ARP packets arriving on p3, to create MAC learning entries.
5910 for i in 0 1 2 3 4 5 6 7 8 9; do
5913 [in_port(3),eth(src=50:54:00:00:00:0$i,dst=ff:ff:ff:ff:ff:ff),$arp],
5916 ovs-appctl time/warp 1000
5919 # Check for the MAC learning entries.
5920 AT_CHECK_UNQUOTED([ovs-appctl fdb/show br0 | sed 's/ *[[0-9]]\{1,\}$//' | sort],
5922 3 0 50:54:00:00:00:00
5923 3 0 50:54:00:00:00:01
5924 3 0 50:54:00:00:00:02
5925 3 0 50:54:00:00:00:03
5926 3 0 50:54:00:00:00:04
5927 3 0 50:54:00:00:00:05
5928 3 0 50:54:00:00:00:06
5929 3 0 50:54:00:00:00:07
5930 3 0 50:54:00:00:00:08
5931 3 0 50:54:00:00:00:09
5935 # Trace another ARP packet on another MAC.
5938 [in_port(3),eth(src=50:54:00:00:00:10,dst=ff:ff:ff:ff:ff:ff),$arp],
5942 # Check that the new one chased the oldest one out of the table.
5943 AT_CHECK_UNQUOTED([ovs-appctl fdb/show br0 | sed 's/[[0-9]]\{1,\}$/?/' | sort],
5945 3 0 50:54:00:00:00:01 ?
5946 3 0 50:54:00:00:00:02 ?
5947 3 0 50:54:00:00:00:03 ?
5948 3 0 50:54:00:00:00:04 ?
5949 3 0 50:54:00:00:00:05 ?
5950 3 0 50:54:00:00:00:06 ?
5951 3 0 50:54:00:00:00:07 ?
5952 3 0 50:54:00:00:00:08 ?
5953 3 0 50:54:00:00:00:09 ?
5954 3 0 50:54:00:00:00:10 ?
5960 AT_SETUP([ofproto-dpif - MAC table overflow fairness])
5962 [set bridge br0 fail-mode=standalone other-config:mac-table-size=10])
5963 add_of_ports br0 1 2 3 4 5 6
5965 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)'
5967 AT_CHECK([ovs-appctl time/stop])
5969 # Trace packets with 2 different source MACs arriving on each of the 5
5970 # ports, filling up the 10-entry learning table.
5971 for i in 0 1 2 3 4 5 6 7 8 9; do
5973 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
5974 ovs-appctl time/warp 1000
5977 # Check for the MAC learning entries.
5978 AT_CHECK_UNQUOTED([ovs-appctl fdb/show br0 | sed 's/ *[[0-9]]\{1,\}$//' | sort],
5980 1 0 50:54:00:00:00:00
5981 1 0 50:54:00:00:00:01
5982 2 0 50:54:00:00:00:02
5983 2 0 50:54:00:00:00:03
5984 3 0 50:54:00:00:00:04
5985 3 0 50:54:00:00:00:05
5986 4 0 50:54:00:00:00:06
5987 4 0 50:54:00:00:00:07
5988 5 0 50:54:00:00:00:08
5989 5 0 50:54:00:00:00:09
5993 # Now trace 16 new MACs on another port.
5994 for i in 0 1 2 3 4 5 6 7 8 9 a b c d e f; do
5995 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
5996 ovs-appctl time/warp 1000
5999 # Check the results.
6001 # Our eviction algorithm on overflow is that an arbitrary (but deterministic)
6002 # one of the ports with the most learned MACs loses the least recently used
6003 # one. Thus, the new port will end up with 3 MACs, 3 of the old ports with 1
6004 # MAC each, and the other 2 of the old ports with 2 MACs each.
6006 # (If someone changes lib/heap.c to do something different with equal-priority
6007 # nodes, then the output below could change, but it would still follow the
6008 # rules explained above.)
6009 AT_CHECK_UNQUOTED([ovs-appctl fdb/show br0 | sed 's/ *[[0-9]]\{1,\}$//' | sort],
6011 1 0 50:54:00:00:00:01
6012 2 0 50:54:00:00:00:03
6013 3 0 50:54:00:00:00:04
6014 3 0 50:54:00:00:00:05
6015 4 0 50:54:00:00:00:07
6016 5 0 50:54:00:00:00:08
6017 5 0 50:54:00:00:00:09
6018 6 0 50:54:00:00:0d:ff
6019 6 0 50:54:00:00:0e:ff
6020 6 0 50:54:00:00:0f:ff
6026 # CHECK_SFLOW_SAMPLING_PACKET(LOOPBACK_ADDR)
6028 # Test that sFlow samples packets correctly using IPv4/IPv6 sFlow collector
6029 m4_define([CHECK_SFLOW_SAMPLING_PACKET],
6030 [AT_XFAIL_IF([test "$IS_WIN32" = "yes"])
6031 OVS_VSWITCHD_START([set Bridge br0 fail-mode=standalone])
6033 on_exit 'kill `cat test-sflow.pid`'
6034 AT_CHECK([ovstest test-sflow --log-file --detach --no-chdir --pidfile 0:$1 > sflow.log], [0], [], [ignore])
6035 AT_CAPTURE_FILE([sflow.log])
6036 PARSE_LISTENING_PORT([test-sflow.log], [SFLOW_PORT])
6037 ovs-appctl time/stop
6039 add_of_ports br0 1 2
6041 set Interface br0 options:ifindex=1002 -- \
6042 set Interface p1 options:ifindex=1004 -- \
6043 set Interface p2 options:ifindex=1003 -- \
6044 set Bridge br0 sflow=@sf -- \
6045 --id=@sf create sflow targets=\"$1:$SFLOW_PORT\" \
6046 header=128 sampling=1 polling=1 agent=$LOOPBACK_INTERFACE
6048 dnl open with ARP packets to seed the bridge-learning. The output
6049 dnl ifIndex numbers should be reported predictably after that.
6050 dnl Since we set sampling=1 we should see all of these packets
6051 dnl reported. Sorting the output by data-source and seqNo makes
6052 dnl it deterministic. Ensuring that we send at least two packets
6053 dnl into each port means we get to check the seq nos are
6054 dnl incrementing correctly.
6055 dnl because packets from different ports can be handled by separate
6056 dnl threads, put some sleeps
6058 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)'
6060 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)'
6062 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)'
6064 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)'
6065 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)'
6067 dnl sleep long enough to get more than one counter sample
6068 dnl from each datasource so we can check sequence numbers
6069 ovs-appctl time/warp 2000 100
6071 OVS_APP_EXIT_AND_WAIT([test-sflow])
6073 AT_CHECK_UNQUOTED([[sort sflow.log | $EGREP 'HEADER|ERROR' | sed 's/ /\
6074 /g' | sed 's/\(.*\)ds=\[::1\]\(.*\)/\1ds=127.0.0.1\2/g' ]], [0], [dnl
6094 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
6114 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
6134 hdr=50-54-00-00-00-07-50-54-00-00-00-05-08-00-45-00-00-5C-00-00-00-00-40-01-F9-4D-C0-A8-00-01-C0-A8-00-02-08-00-13-FC-00-00-00-00-00-01-02-03-04-05-06-07-08-09-0A-0B-0C-0D-0E-0F-10-11-12-13-14-15-16-17-18-19-1A-1B-1C-1D-1E-1F-20-21-22-23-24-25-26-27-28-29-2A-2B-2C-2D-2E-2F-30-31-32-33-34-35-36-37-38-39-3A-3B-3C-3D-3E-3F
6154 hdr=50-54-00-00-00-05-50-54-00-00-00-07-08-00-45-00-00-5C-00-00-00-00-40-01-F9-4D-C0-A8-00-02-C0-A8-00-01-00-00-1B-FC-00-00-00-00-00-01-02-03-04-05-06-07-08-09-0A-0B-0C-0D-0E-0F-10-11-12-13-14-15-16-17-18-19-1A-1B-1C-1D-1E-1F-20-21-22-23-24-25-26-27-28-29-2A-2B-2C-2D-2E-2F-30-31-32-33-34-35-36-37-38-39-3A-3B-3C-3D-3E-3F
6174 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
6177 AT_CHECK_UNQUOTED([[sort sflow.log | $EGREP 'ETHCOUNTERS|IFCOUNTERS|ERROR|PORTNAME|OPENFLOWPORT' | head -24 | sed 's/ /\
6178 /g' | sed 's/\(.*\)ds=\[::1\]\(.*\)/\1ds=127.0.0.1\2/g' ]], [0], [dnl
6180 dot3StatsAlignmentErrors=4294967295
6181 dot3StatsFCSErrors=4294967295
6182 dot3StatsSingleCollisionFrames=4294967295
6183 dot3StatsMultipleCollisionFrames=4294967295
6184 dot3StatsSQETestErrors=4294967295
6185 dot3StatsDeferredTransmissions=4294967295
6186 dot3StatsLateCollisions=4294967295
6187 dot3StatsExcessiveCollisions=4294967295
6188 dot3StatsInternalMacTransmitErrors=4294967295
6189 dot3StatsCarrierSenseErrors=4294967295
6190 dot3StatsFrameTooLongs=4294967295
6191 dot3StatsInternalMacReceiveErrors=4294967295
6192 dot3StatsSymbolErrors=4294967295
6194 dot3StatsAlignmentErrors=4294967295
6195 dot3StatsFCSErrors=4294967295
6196 dot3StatsSingleCollisionFrames=4294967295
6197 dot3StatsMultipleCollisionFrames=4294967295
6198 dot3StatsSQETestErrors=4294967295
6199 dot3StatsDeferredTransmissions=4294967295
6200 dot3StatsLateCollisions=4294967295
6201 dot3StatsExcessiveCollisions=4294967295
6202 dot3StatsInternalMacTransmitErrors=4294967295
6203 dot3StatsCarrierSenseErrors=4294967295
6204 dot3StatsFrameTooLongs=4294967295
6205 dot3StatsInternalMacReceiveErrors=4294967295
6206 dot3StatsSymbolErrors=4294967295
6208 dot3StatsAlignmentErrors=4294967295
6209 dot3StatsFCSErrors=4294967295
6210 dot3StatsSingleCollisionFrames=4294967295
6211 dot3StatsMultipleCollisionFrames=4294967295
6212 dot3StatsSQETestErrors=4294967295
6213 dot3StatsDeferredTransmissions=4294967295
6214 dot3StatsLateCollisions=4294967295
6215 dot3StatsExcessiveCollisions=4294967295
6216 dot3StatsInternalMacTransmitErrors=4294967295
6217 dot3StatsCarrierSenseErrors=4294967295
6218 dot3StatsFrameTooLongs=4294967295
6219 dot3StatsInternalMacReceiveErrors=4294967295
6220 dot3StatsSymbolErrors=4294967295
6222 dot3StatsAlignmentErrors=4294967295
6223 dot3StatsFCSErrors=4294967295
6224 dot3StatsSingleCollisionFrames=4294967295
6225 dot3StatsMultipleCollisionFrames=4294967295
6226 dot3StatsSQETestErrors=4294967295
6227 dot3StatsDeferredTransmissions=4294967295
6228 dot3StatsLateCollisions=4294967295
6229 dot3StatsExcessiveCollisions=4294967295
6230 dot3StatsInternalMacTransmitErrors=4294967295
6231 dot3StatsCarrierSenseErrors=4294967295
6232 dot3StatsFrameTooLongs=4294967295
6233 dot3StatsInternalMacReceiveErrors=4294967295
6234 dot3StatsSymbolErrors=4294967295
6236 dot3StatsAlignmentErrors=4294967295
6237 dot3StatsFCSErrors=4294967295
6238 dot3StatsSingleCollisionFrames=4294967295
6239 dot3StatsMultipleCollisionFrames=4294967295
6240 dot3StatsSQETestErrors=4294967295
6241 dot3StatsDeferredTransmissions=4294967295
6242 dot3StatsLateCollisions=4294967295
6243 dot3StatsExcessiveCollisions=4294967295
6244 dot3StatsInternalMacTransmitErrors=4294967295
6245 dot3StatsCarrierSenseErrors=4294967295
6246 dot3StatsFrameTooLongs=4294967295
6247 dot3StatsInternalMacReceiveErrors=4294967295
6248 dot3StatsSymbolErrors=4294967295
6250 dot3StatsAlignmentErrors=4294967295
6251 dot3StatsFCSErrors=4294967295
6252 dot3StatsSingleCollisionFrames=4294967295
6253 dot3StatsMultipleCollisionFrames=4294967295
6254 dot3StatsSQETestErrors=4294967295
6255 dot3StatsDeferredTransmissions=4294967295
6256 dot3StatsLateCollisions=4294967295
6257 dot3StatsExcessiveCollisions=4294967295
6258 dot3StatsInternalMacTransmitErrors=4294967295
6259 dot3StatsCarrierSenseErrors=4294967295
6260 dot3StatsFrameTooLongs=4294967295
6261 dot3StatsInternalMacReceiveErrors=4294967295
6262 dot3StatsSymbolErrors=4294967295
6274 in_multicasts=4294967295
6275 in_broadcasts=4294967295
6276 in_discards=4294967295
6277 in_errors=4294967295
6278 in_unknownprotos=4294967295
6281 out_multicasts=4294967295
6282 out_broadcasts=4294967295
6283 out_discards=4294967295
6284 out_errors=4294967295
6297 in_multicasts=4294967295
6298 in_broadcasts=4294967295
6299 in_discards=4294967295
6300 in_errors=4294967295
6301 in_unknownprotos=4294967295
6304 out_multicasts=4294967295
6305 out_broadcasts=4294967295
6306 out_discards=4294967295
6307 out_errors=4294967295
6320 in_multicasts=4294967295
6321 in_broadcasts=4294967295
6322 in_discards=4294967295
6323 in_errors=4294967295
6324 in_unknownprotos=4294967295
6327 out_multicasts=4294967295
6328 out_broadcasts=4294967295
6329 out_discards=4294967295
6330 out_errors=4294967295
6343 in_multicasts=4294967295
6344 in_broadcasts=4294967295
6345 in_discards=4294967295
6346 in_errors=4294967295
6347 in_unknownprotos=4294967295
6350 out_multicasts=4294967295
6351 out_broadcasts=4294967295
6352 out_discards=4294967295
6353 out_errors=4294967295
6366 in_multicasts=4294967295
6367 in_broadcasts=4294967295
6368 in_discards=4294967295
6369 in_errors=4294967295
6370 in_unknownprotos=4294967295
6373 out_multicasts=4294967295
6374 out_broadcasts=4294967295
6375 out_discards=4294967295
6376 out_errors=4294967295
6389 in_multicasts=4294967295
6390 in_broadcasts=4294967295
6391 in_discards=4294967295
6392 in_errors=4294967295
6393 in_unknownprotos=4294967295
6396 out_multicasts=4294967295
6397 out_broadcasts=4294967295
6398 out_discards=4294967295
6399 out_errors=4294967295
6402 datapath_id=18364758544493064720
6405 datapath_id=18364758544493064720
6408 datapath_id=18364758544493064720
6411 datapath_id=18364758544493064720
6414 datapath_id=18364758544493064720
6417 datapath_id=18364758544493064720
6433 AT_SETUP([ofproto-dpif - basic truncate action])
6435 add_of_ports br0 1 2 3 4 5
6437 AT_CHECK([ovs-vsctl -- set Interface p1 type=dummy options:pcap=p1.pcap])
6438 AT_CHECK([ovs-vsctl -- set Interface p2 type=dummy options:pstream=punix:p2.sock])
6439 AT_CHECK([ovs-vsctl -- set Interface p3 type=dummy options:stream=unix:p2.sock])
6440 AT_CHECK([ovs-vsctl -- set Interface p4 type=dummy options:pstream=punix:p4.sock])
6441 AT_CHECK([ovs-vsctl -- set Interface p5 type=dummy options:stream=unix:p4.sock])
6443 AT_DATA([flows.txt], [dnl
6444 in_port=3,actions=drop
6445 in_port=5,actions=drop
6446 in_port=1,actions=output(port=2,max_len=64),output:4
6448 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
6450 dnl Datapath actions
6451 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])
6452 AT_CHECK([tail -1 stdout], [0],
6453 [Datapath actions: trunc(64),2,4
6456 dnl An 170 byte packet
6457 AT_CHECK([ovs-appctl netdev-dummy/receive p1 '000c29c8a0a4005056c0000808004500009cb4a6000040019003c0a8da01c0a8da640800cb5fa762000556f431ad0009388e08090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f'])
6459 AT_CHECK([ovs-ofctl parse-pcap p1.pcap], [0], [dnl
6460 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
6463 AT_CHECK([ovs-appctl revalidator/purge], [0])
6464 dnl packet with truncated size
6465 AT_CHECK([ovs-ofctl dump-flows br0 | grep "in_port=3" | sed -n 's/.*\(n\_bytes=[[0-9]]*\).*/\1/p'], [0], [dnl
6468 dnl packet with original size
6469 AT_CHECK([ovs-ofctl dump-flows br0 | grep "in_port=5" | sed -n 's/.*\(n\_bytes=[[0-9]]*\).*/\1/p'], [0], [dnl
6473 dnl More complicated case
6474 AT_CHECK([ovs-ofctl del-flows br0])
6475 AT_DATA([flows.txt], [dnl
6476 in_port=3,actions=drop
6477 in_port=5,actions=drop
6478 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
6480 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
6482 dnl Datapath actions
6483 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])
6484 AT_CHECK([tail -1 stdout], [0],
6485 [Datapath actions: trunc(64),2,trunc(128),2,trunc(60),4,2,4
6488 dnl An 170 byte packet
6489 AT_CHECK([ovs-appctl netdev-dummy/receive p1 '000c29c8a0a4005056c0000808004500009cb4a6000040019003c0a8da01c0a8da640800cb5fa762000556f431ad0009388e08090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f'])
6491 AT_CHECK([ovs-appctl revalidator/purge], [0])
6492 dnl packet size: 64 + 128 + 170 = 362
6493 AT_CHECK([ovs-ofctl dump-flows br0 | grep "in_port=3" | sed -n 's/.*\(n\_bytes=[[0-9]]*\).*/\1/p'], [0], [dnl
6496 dnl packet size: 60 + 170 = 230
6497 AT_CHECK([ovs-ofctl dump-flows br0 | grep "in_port=5" | sed -n 's/.*\(n\_bytes=[[0-9]]*\).*/\1/p'], [0], [dnl
6502 AT_CHECK([ovs-ofctl add-flow br0 'actions=output(port=ALL,max_len=100)'], [1], [], [dnl
6503 ovs-ofctl: output to unsupported truncate port: ALL
6509 AT_SETUP([ofproto-dpif - truncate and output to patch port])
6510 OVS_VSWITCHD_START([add-br br1 \
6511 -- set bridge br1 datapath-type=dummy fail-mode=secure \
6512 -- add-port br1 pbr1 -- set int pbr1 type=patch options:peer=pbr0 ofport_request=1 \
6513 -- add-port br0 pbr0 -- set int pbr0 type=patch options:peer=pbr1])
6517 AT_CHECK([ovs-ofctl add-flow br0 actions='output(port=1,max_len=100),output:2'])
6518 AT_CHECK([ovs-ofctl add-flow br1 actions=NORMAL])
6520 AT_CHECK([ovs-appctl ofproto/trace br0 in_port=LOCAL,dl_src=10:20:30:40:50:60],
6522 AT_CHECK([tail -1 stdout], [0], [Datapath actions: 2
6524 dnl the output(port=1,max_len=100) fails the translation, only output:2 in datapath
6525 AT_CHECK([grep "output_trunc does not support patch port [[0-9]]*" stdout], [0], [stdout])
6530 AT_SETUP([ofproto-dpif - truncate and output to gre tunnel])
6531 OVS_VSWITCHD_START([add-port br0 p1 -- set Interface p1 type=gre \
6532 options:remote_ip=1.1.1.1 options:local_ip=2.2.2.2 \
6533 options:key=5 ofport_request=1\
6534 -- add-port br0 p2 -- set Interface p2 type=dummy \
6536 AT_DATA([flows.txt], [dnl
6537 actions=output(max_len=100, port=1)
6539 OVS_VSWITCHD_DISABLE_TUNNEL_PUSH_POP
6540 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
6542 AT_CHECK([ovs-appctl dpif/show | tail -n +3], [0], [dnl
6543 br0 65534/100: (dummy-internal)
6544 p1 1/1: (gre: key=5, local_ip=2.2.2.2, remote_ip=1.1.1.1)
6549 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])
6550 AT_CHECK([tail -1 stdout], [0],
6551 [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
6557 AT_SETUP([ofproto-dpif - sFlow packet sampling - IPv4 collector])
6558 CHECK_SFLOW_SAMPLING_PACKET([127.0.0.1])
6561 AT_SETUP([ofproto-dpif - sFlow packet sampling - IPv6 collector])
6562 AT_SKIP_IF([test $HAVE_IPV6 = no])
6563 CHECK_SFLOW_SAMPLING_PACKET([[[::1]]])
6566 dnl Test sFlow LAG structures
6567 AT_SETUP([ofproto-dpif - sFlow packet sampling - LACP structures])
6568 AT_SKIP_IF([test "$IS_WIN32" = "yes"])
6569 OVS_VSWITCHD_START([dnl
6570 add-bond br0 bond p1 p2 -- \
6571 set Port bond lacp=active bond-mode=active-backup \
6572 other_config:lacp-time="fast" \
6573 other_config:lacp-system-id=11:22:33:44:55:66 \
6574 other_config:lacp-system-priority=54321 -- \
6575 set Interface p1 type=dummy \
6576 other_config:lacp-port-id=11 \
6577 other_config:lacp-port-priority=111 \
6578 other_config:lacp-aggregation-key=3333 -- \
6579 set Interface p2 type=dummy \
6580 other_config:lacp-port-id=22 \
6581 other_config:lacp-port-priority=222 \
6582 other_config:lacp-aggregation-key=3333 ])
6584 on_exit 'kill `cat test-sflow.pid`'
6585 AT_CHECK([ovstest test-sflow --log-file --detach --no-chdir --pidfile 0:127.0.0.1 > sflow.log], [0], [], [ignore])
6586 AT_CAPTURE_FILE([sflow.log])
6587 PARSE_LISTENING_PORT([test-sflow.log], [SFLOW_PORT])
6589 ovs-appctl time/stop
6592 set Interface p1 options:ifindex=1003 -- \
6593 set Bridge br0 sflow=@sf -- \
6594 --id=@sf create sflow targets=\"127.0.0.1:$SFLOW_PORT\" \
6595 header=128 sampling=1 polling=1 agent=127.0.0.1
6597 dnl sleep long enough to get the sFlow datagram flushed out (may be delayed for up to 1 second)
6598 AT_CHECK([ovs-appctl time/warp 2000 100], [0], [ignore])
6599 AT_CHECK([ovs-appctl revalidator/purge], [0])
6600 OVS_VSWITCHD_STOP(["/failed to get flags for network device 127.0.0.1/d"])
6601 OVS_APP_EXIT_AND_WAIT([test-sflow])
6602 AT_CHECK([[sort sflow.log | $EGREP 'LACPCOUNTERS|ERROR' | head -n 1 | sed 's/ /\
6605 sysID=11:22:33:44:55:66
6606 partnerID=00:00:00:00:00:00
6613 markerPDUsRx=4294967295
6614 markerRespPDUsRx=4294967295
6615 unknownRx=4294967295
6618 markerPDUsTx=4294967295
6619 markerRespPDUsTx=4294967295
6624 AT_SETUP([ofproto-dpif - sFlow packet sampling - tunnel set])
6625 AT_XFAIL_IF([test "$IS_WIN32" = "yes"])
6626 OVS_VSWITCHD_START([set Bridge br0 fail-mode=standalone])
6628 dnl set up sFlow logging
6629 AT_CHECK([ovstest test-sflow --log-file --detach --no-chdir --pidfile 0:127.0.0.1 > sflow.log], [0], [], [ignore])
6630 AT_CAPTURE_FILE([sflow.log])
6631 PARSE_LISTENING_PORT([test-sflow.log], [SFLOW_PORT])
6632 ovs-appctl time/stop
6634 OVS_VSWITCHD_DISABLE_TUNNEL_PUSH_POP
6635 AT_CHECK([ovs-vsctl add-port br0 gre0 -- set Interface gre0 type=gre \
6636 options:remote_ip=1.1.1.1 options:key=456 ofport_request=3])
6637 AT_CHECK([ovs-vsctl add-port br0 p1 -- set Interface p1 type=dummy ofport_request=4])
6639 AT_CHECK([ovs-ofctl add-flow br0 action=3])
6643 set Bridge br0 sflow=@sf -- \
6644 --id=@sf create sflow targets=\"127.0.0.1:$SFLOW_PORT\" agent=127.0.0.1 \
6645 header=128 sampling=1 polling=0
6647 dnl introduce a packet that will be flooded to the tunnel
6648 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)'])
6650 dnl sleep long enough to get the sFlow datagram flushed out (may be delayed for up to 1 second)
6651 for i in `seq 1 30`; do
6652 ovs-appctl time/warp 100
6655 OVS_APP_EXIT_AND_WAIT([test-sflow])
6657 AT_CHECK_UNQUOTED([[sort sflow.log | $EGREP 'HEADER|ERROR' | sed 's/ /\
6663 tunnel4_out_length=0
6664 tunnel4_out_protocol=47
6665 tunnel4_out_src=0.0.0.0
6666 tunnel4_out_dst=1.1.1.1
6667 tunnel4_out_src_port=0
6668 tunnel4_out_dst_port=0
6669 tunnel4_out_tcp_flags=0
6687 hdr=50-54-00-00-00-0A-50-54-00-00-00-09-08-00-45-01-00-5C-00-00-00-00-80-01-12-8A-0A-0A-0A-02-0A-0A-0A-01-08-00-13-FC-00-00-00-00-00-01-02-03-04-05-06-07-08-09-0A-0B-0C-0D-0E-0F-10-11-12-13-14-15-16-17-18-19-1A-1B-1C-1D-1E-1F-20-21-22-23-24-25-26-27-28-29-2A-2B-2C-2D-2E-2F-30-31-32-33-34-35-36-37-38-39-3A-3B-3C-3D-3E-3F
6690 OVS_VSWITCHD_STOP(["/failed to get flags for network device 127.0.0.1/d"])
6693 AT_SETUP([ofproto-dpif - sFlow packet sampling - tunnel push])
6694 AT_XFAIL_IF([test "$IS_WIN32" = "yes"])
6696 OVS_VSWITCHD_START([add-port br0 p0 -- set Interface p0 type=dummy ofport_request=1 options:ifindex=1010])
6698 dnl set up sFlow logging
6699 AT_CHECK([ovstest test-sflow --log-file --detach --no-chdir --pidfile 0:127.0.0.1 > sflow.log], [0], [], [ignore])
6700 AT_CAPTURE_FILE([sflow.log])
6701 PARSE_LISTENING_PORT([test-sflow.log], [SFLOW_PORT])
6702 ovs-appctl time/stop
6704 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
6705 AT_CHECK([ovs-vsctl add-br int-br -- set bridge int-br datapath_type=dummy], [0])
6706 AT_CHECK([ovs-vsctl -- add-port int-br t1 -- set Interface t1 type=gre \
6707 options:remote_ip=1.1.2.92 options:key=456 ofport_request=4\
6708 -- add-port int-br vm1 -- set Interface vm1 type=dummy \
6709 options:ifindex=2011 ofport_request=5
6712 AT_CHECK([ovs-appctl dpif/show], [0], [dnl
6713 dummy@ovs-dummy: hit:0 missed:0
6715 br0 65534/100: (dummy-internal)
6716 p0 1/1: (dummy: ifindex=1010)
6718 int-br 65534/2: (dummy-internal)
6719 t1 4/4: (gre: key=456, remote_ip=1.1.2.92)
6720 vm1 5/3: (dummy: ifindex=2011)
6723 dnl set up route to 1.1.2.92 via br0 and action=normal
6724 AT_CHECK([ovs-appctl netdev-dummy/ip4addr br0 1.1.2.88/24], [0], [OK
6726 AT_CHECK([ovs-appctl ovs/route/add 1.1.2.92/24 br0], [0], [OK
6728 AT_CHECK([ovs-ofctl add-flow br0 action=normal])
6730 dnl Prime ARP Cache for 1.1.2.92
6731 AT_CHECK([ovs-appctl netdev-dummy/receive p0 'recirc_id(0),in_port(1),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)'])
6733 dnl configure sflow on int-br only
6735 set Bridge int-br sflow=@sf -- \
6736 --id=@sf create sflow targets=\"127.0.0.1:$SFLOW_PORT\" agent=127.0.0.1 \
6737 header=128 sampling=1 polling=0
6739 dnl set up route to 192.168.1.2 via br0
6740 AT_CHECK([ovs-appctl netdev-dummy/ip4addr br0 192.168.1.1/16], [0], [OK
6742 AT_CHECK([ovs-appctl ovs/route/add 192.168.0.0/16 br0], [0], [OK
6745 dnl add rule for int-br to force packet onto tunnel. There is no ifindex
6746 dnl for this port so the sFlow output will just report that it went to
6747 dnl 1 output (out_format=2, out_ifindex=1)
6748 AT_CHECK([ovs-ofctl add-flow int-br "actions=4"])
6750 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)'])
6752 dnl sleep long enough to get the sFlow datagram flushed out (may be delayed for up to 1 second)
6753 for i in `seq 1 30`; do
6754 ovs-appctl time/warp 100
6757 OVS_APP_EXIT_AND_WAIT([test-sflow])
6759 AT_CHECK_UNQUOTED([[sort sflow.log | $EGREP 'HEADER|ERROR' | sed 's/ /\
6765 tunnel4_out_length=0
6766 tunnel4_out_protocol=47
6767 tunnel4_out_src=1.1.2.88
6768 tunnel4_out_dst=1.1.2.92
6769 tunnel4_out_src_port=0
6770 tunnel4_out_dst_port=0
6771 tunnel4_out_tcp_flags=0
6789 hdr=50-54-00-00-00-0A-50-54-00-00-00-05-08-00-45-00-00-5C-00-00-00-00-80-01-B6-4D-C0-A8-01-01-C0-A8-02-02-08-00-13-FC-00-00-00-00-00-01-02-03-04-05-06-07-08-09-0A-0B-0C-0D-0E-0F-10-11-12-13-14-15-16-17-18-19-1A-1B-1C-1D-1E-1F-20-21-22-23-24-25-26-27-28-29-2A-2B-2C-2D-2E-2F-30-31-32-33-34-35-36-37-38-39-3A-3B-3C-3D-3E-3F
6792 OVS_VSWITCHD_STOP(["/failed to get flags for network device 127.0.0.1/d"])
6795 AT_SETUP([ofproto-dpif - sFlow packet sampling - MPLS])
6796 AT_XFAIL_IF([test "$IS_WIN32" = "yes"])
6798 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
6799 add_of_ports br0 1 2
6800 AT_DATA([flows.txt], [dnl
6801 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
6802 table=0 dl_src=50:54:00:00:00:0b actions=pop_mpls:0x0800,2
6804 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
6806 dnl set up sFlow logging
6807 AT_CHECK([ovstest test-sflow --log-file --detach --no-chdir --pidfile 0:127.0.0.1 > sflow.log], [0], [], [ignore])
6808 AT_CAPTURE_FILE([sflow.log])
6809 PARSE_LISTENING_PORT([test-sflow.log], [SFLOW_PORT])
6810 ovs-appctl time/stop
6814 set Bridge br0 sflow=@sf -- \
6815 --id=@sf create sflow targets=\"127.0.0.1:$SFLOW_PORT\" agent=127.0.0.1 \
6816 header=128 sampling=1 polling=0
6818 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)'])
6819 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)'])
6821 dnl sleep long enough to get the sFlow datagram flushed out (may be delayed for up to 1 second)
6822 for i in `seq 1 30`; do
6823 ovs-appctl time/warp 100
6826 OVS_APP_EXIT_AND_WAIT([test-sflow])
6828 AT_CHECK_UNQUOTED([[sort sflow.log | $EGREP 'HEADER|ERROR' | sed 's/ /\
6857 hdr=50-54-00-00-00-0A-50-54-00-00-00-09-88-47-00-00-B7-40
6881 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
6884 OVS_VSWITCHD_STOP(["/failed to get flags for network device 127.0.0.1/d"])
6888 # CHECK_NETFLOW_EXPIRATION(LOOPBACK_ADDR)
6890 # Test that basic NetFlow reports flow statistics correctly:
6891 # The initial packet of a flow are correctly accounted.
6892 # Later packets within a flow are correctly accounted.
6893 # Flow actions changing (in this case, due to MAC learning)
6894 # cause a record to be sent.
6895 m4_define([CHECK_NETFLOW_EXPIRATION],
6896 [OVS_VSWITCHD_START([set Bridge br0 fail-mode=standalone])
6897 add_of_ports br0 1 2
6899 ovs-appctl time/stop
6900 on_exit 'kill `cat test-netflow.pid`'
6901 AT_CHECK([ovstest test-netflow --log-file --detach --no-chdir --pidfile 0:$1 > netflow.log], [0], [], [ignore])
6902 AT_CAPTURE_FILE([netflow.log])
6903 PARSE_LISTENING_PORT([test-netflow.log], [NETFLOW_PORT])
6906 set Bridge br0 netflow=@nf -- \
6907 --id=@nf create NetFlow targets=\"$1:$NETFLOW_PORT\" \
6908 engine_id=1 engine_type=2 active_timeout=30 add-id-to-interface=false
6910 for delay in 1000 30000; do
6911 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)'
6912 sleep 1 # ensure the order in which these two packets are processed
6913 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)'
6915 ovs-appctl time/warp $delay
6918 ovs-appctl time/warp 6000
6919 ovs-appctl revalidator/wait
6921 OVS_APP_EXIT_AND_WAIT([test-netflow])
6923 AT_CHECK([test `grep "192.168.0.1 > 192.168.0.2, if 1 > 65535, 1 pkts, 106 bytes, ICMP 8:0" netflow.log | wc -l` -eq 1])
6925 AT_CHECK([test `grep "192.168.0.1 > 192.168.0.2, if 1 > 2, 1 pkts, 106 bytes, ICMP 8:0" netflow.log | wc -l` -eq 1])
6927 combined=`grep "192.168.0.2 > 192.168.0.1, if 2 > 1, 2 pkts, 212 bytes, ICMP 0:0" netflow.log | wc -l`
6928 separate=`grep "192.168.0.2 > 192.168.0.1, if 2 > 1, 1 pkts, 106 bytes, ICMP 0:0" netflow.log | wc -l`
6929 AT_CHECK([test $separate = 2 || test $combined = 1], [0])])
6931 AT_SETUP([ofproto-dpif - NetFlow flow expiration - IPv4 collector])
6932 CHECK_NETFLOW_EXPIRATION([127.0.0.1])
6935 AT_SETUP([ofproto-dpif - NetFlow flow expiration - IPv6 collector])
6936 AT_SKIP_IF([test $HAVE_IPV6 = no])
6937 CHECK_NETFLOW_EXPIRATION([[[::1]]])
6940 # CHECK_NETFLOW_ACTIVE_EXPIRATION(LOOPBACK_ADDR)
6942 # Test that basic NetFlow reports active expirations correctly.
6943 m4_define([CHECK_NETFLOW_ACTIVE_EXPIRATION],
6944 [OVS_VSWITCHD_START([set Bridge br0 fail-mode=standalone])
6945 add_of_ports br0 1 2
6947 on_exit 'kill `cat test-netflow.pid`'
6948 AT_CHECK([ovstest test-netflow --log-file --detach --no-chdir --pidfile 0:$1 > netflow.log], [0], [], [ignore])
6949 AT_CAPTURE_FILE([netflow.log])
6950 PARSE_LISTENING_PORT([test-netflow.log], [NETFLOW_PORT])
6953 set Bridge br0 netflow=@nf -- \
6954 --id=@nf create NetFlow targets=\"$1:$NETFLOW_PORT\" \
6955 engine_id=1 engine_type=2 active_timeout=10 add-id-to-interface=false
6957 AT_CHECK([ovs-appctl time/stop])
6959 while test $n -le 60; do
6962 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)'
6963 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)'
6965 ovs-appctl time/warp 1000
6968 ovs-appctl time/warp 10000
6970 ovs-appctl revalidator/wait
6972 OVS_APP_EXIT_AND_WAIT([test-netflow])
6974 # Count the number of reported packets:
6975 # - From source to destination before MAC learning kicks in (just one).
6976 # - From source to destination after that.
6977 # - From destination to source.
6985 pkts=`echo "$line" | sed 's/.*, \([[0-9]]*\) pkts,.*/\1/'`
6992 "seq "*": 192.168.0.1 > 192.168.0.2, if 1 > 65535, "*" pkts, "*" bytes, TCP 1234 > 80, time "*)
6995 "seq "*": 192.168.0.1 > 192.168.0.2, if 1 > 2, "*" pkts, "*" bytes, TCP 1234 > 80, time "*)
6998 "seq "*": 192.168.0.2 > 192.168.0.1, if 2 > 1, "*" pkts, "*" bytes, TCP 80 > 1234, time "*)
7005 eval $counter=\`expr \$$counter + \$pkts\`
7006 n_recs=`expr $n_recs + 1`
7009 # There should be exactly 1 MAC learning packet,
7010 # exactly 59 other packets in that direction,
7011 # and exactly 60 packets in the other direction.
7012 AT_CHECK([echo $n_learn $n_in $n_out $n_other], [0], [1 59 60 0
7015 AT_SETUP([ofproto-dpif - NetFlow active expiration - IPv4 collector])
7016 CHECK_NETFLOW_ACTIVE_EXPIRATION([127.0.0.1])
7019 AT_SETUP([ofproto-dpif - NetFlow active expiration - IPv6 collector])
7020 AT_SKIP_IF([test $HAVE_IPV6 = no])
7021 CHECK_NETFLOW_ACTIVE_EXPIRATION([[[::1]]])
7024 dnl In the absence of an IPFIX collector to verify protocol correctness, simply
7025 dnl configure bridge IPFIX and ensure that sample action generation works at the
7027 AT_SETUP([ofproto-dpif - Bridge IPFIX sanity check])
7029 add_of_ports br0 1 2
7031 dnl Sample every packet using bridge-based sampling.
7032 AT_CHECK([ovs-vsctl -- set bridge br0 ipfix=@fix -- \
7033 --id=@fix create ipfix targets=\"127.0.0.1:4739\" \
7034 sampling=1], [0], [ignore])
7036 dnl Send some packets that should be sampled.
7037 for i in `seq 1 3`; do
7038 AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800)'])
7040 AT_CHECK([ovs-appctl dpctl/dump-flows | sed 's/.*\(packets:\)/\1/' | sed 's/used:[[0-9]].[[0-9]]*s/used:0.001s/'], [0], [dnl
7041 flow-dump from non-dpdk interfaces:
7042 packets:2, bytes:68, used:0.001s, actions:userspace(pid=0,ipfix(output_port=4294967295))
7045 AT_CHECK([ovs-appctl revalidator/purge])
7047 dnl Add a slowpath meter. The userspace action should be metered.
7048 AT_CHECK([ovs-ofctl -O OpenFlow13 add-meter br0 'meter=slowpath pktps burst stats bands=type=drop rate=3 burst_size=1'])
7050 dnl Send some packets that should be sampled and metered.
7051 for i in `seq 1 3`; do
7052 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)'])
7054 AT_CHECK([ovs-appctl dpctl/dump-flows | sed 's/.*\(packets:\)/\1/' | sed 's/used:[[0-9]].[[0-9]]*s/used:0.001s/'], [0], [dnl
7055 flow-dump from non-dpdk interfaces:
7056 packets:2, bytes:68, used:0.001s, actions:sample(sample=100.0%,actions(meter(0),userspace(pid=0,ipfix(output_port=4294967295))))
7059 dnl Remove the IPFIX configuration.
7060 AT_CHECK([ovs-vsctl clear bridge br0 ipfix])
7061 AT_CHECK([ovs-appctl revalidator/purge])
7063 dnl Send some more packets, to ensure that these are not sampled.
7064 for i in `seq 1 3`; do
7065 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)'])
7067 AT_CHECK([ovs-appctl dpctl/dump-flows | sed 's/.*\(packets:\)/\1/' | sed 's/used:[[0-9]].[[0-9]]*s/used:0.001s/'], [0], [dnl
7068 flow-dump from non-dpdk interfaces:
7069 packets:2, bytes:68, used:0.001s, actions:drop
7072 OVS_VSWITCHD_STOP(["/sending to collector failed/d"])
7075 dnl Bridge IPFIX statistics check
7076 AT_SETUP([ofproto-dpif - Bridge IPFIX statistics check])
7078 add_of_ports br0 1 2
7080 dnl Negative test check.
7081 AT_CHECK([ovs-ofctl dump-ipfix-bridge br0], [0], [dnl
7082 OFPT_ERROR (xid=0x2): NXST_NOT_CONFIGURED
7083 NXST_IPFIX_BRIDGE request (xid=0x2):
7086 dnl Sample every packet using bridge-based sampling.
7087 AT_CHECK([ovs-vsctl -- set bridge br0 ipfix=@fix -- \
7088 --id=@fix create ipfix targets=\"127.0.0.1:4739\" \
7089 sampling=1], [0], [ignore])
7091 dnl Send some packets that should be sampled.
7092 for i in `seq 1 20`; do
7093 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)'])
7096 dnl There are 4 extra IPFIX template packets.
7097 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
7098 NXST_IPFIX_BRIDGE reply (xid=0x2):
7099 bridge ipfix: flows=20, current flows=0, sampled pkts=20, ipv4 ok=0, ipv6 ok=0, tx pkts=24
7100 pkts errs=20, ipv4 errs=20, ipv6 errs=0, tx errs=0
7103 dnl Remove the IPFIX configuration.
7104 AT_CHECK([ovs-vsctl clear bridge br0 ipfix])
7105 AT_CHECK([ovs-appctl revalidator/purge])
7107 dnl Send some more packets, to ensure that these are not sampled.
7108 for i in `seq 1 2`; do
7109 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)'])
7111 AT_CHECK([ovs-ofctl dump-ipfix-bridge br0], [0], [dnl
7112 OFPT_ERROR (xid=0x2): NXST_NOT_CONFIGURED
7113 NXST_IPFIX_BRIDGE request (xid=0x2):
7116 OVS_VSWITCHD_STOP(["/sending to collector failed/d"])
7119 dnl Flow IPFIX sanity check
7120 AT_SETUP([ofproto-dpif - Flow IPFIX sanity check])
7122 add_of_ports br0 1 2
7124 # Check for regression against a bug where an invalid target caused an
7125 # assertion failure and a crash.
7126 AT_CHECK([ovs-vsctl -- --id=@br0 get Bridge br0 \
7127 -- --id=@ipfix create IPFIX targets=\"xyzzy\" \
7128 -- --id=@cs create Flow_Sample_Collector_Set id=0 bridge=@br0 ipfix=@ipfix],
7131 AT_CHECK([ovs-vsctl -- --id=@br0 get Bridge br0 \
7132 -- --id=@ipfix create IPFIX targets=\"127.0.0.1:4739\" \
7133 -- --id=@cs create Flow_Sample_Collector_Set id=1 bridge=@br0 ipfix=@ipfix],
7136 AT_DATA([flows.txt], [dnl
7137 in_port=1, actions=sample(probability=65535,collector_set_id=1),output:2
7140 AT_CHECK([ovs-ofctl add-flows br0 flows.txt], [0], [ignore])
7142 dnl Send some packets that should be sampled.
7143 for i in `seq 1 3`; do
7144 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)'])
7146 AT_CHECK([ovs-appctl dpctl/dump-flows | sed 's/.*\(packets:\)/\1/' | sed 's/used:[[0-9]].[[0-9]]*s/used:0.001s/'], [0], [dnl
7147 flow-dump from non-dpdk interfaces:
7148 packets:2, bytes:68, used:0.001s, actions:userspace(pid=0,flow_sample(probability=65535,collector_set_id=1,obs_domain_id=0,obs_point_id=0,output_port=4294967295)),2
7151 dnl Remove the flow which contains sample action.
7152 AT_CHECK([ovs-ofctl del-flows br0 in_port=1], [0], [ignore])
7153 AT_CHECK([ovs-appctl revalidator/purge])
7155 dnl Send some more packets, to ensure that these are not sampled.
7156 for i in `seq 1 3`; do
7157 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)'])
7159 AT_CHECK([ovs-appctl dpctl/dump-flows | sed 's/.*\(packets:\)/\1/' | sed 's/used:[[0-9]].[[0-9]]*s/used:0.001s/'], [0], [dnl
7160 flow-dump from non-dpdk interfaces:
7161 packets:2, bytes:68, used:0.001s, actions:drop
7164 OVS_VSWITCHD_STOP(["/sending to collector failed/d
7169 dnl Flow IPFIX sanity check for tunnel set
7170 AT_SETUP([ofproto-dpif - Flow IPFIX sanity check - tunnel set])
7171 OVS_VSWITCHD_START([add-port br0 p1 -- set Interface p1 type=gre \
7172 options:remote_ip=1.1.1.1 options:local_ip=2.2.2.2 \
7173 options:key=5 ofport_request=1\
7174 -- add-port br0 p2 -- set Interface p2 type=stt \
7175 options:remote_ip=1.1.1.2 options:local_ip=2.2.2.3 \
7176 options:key=6 ofport_request=2\
7177 -- add-port br0 p3 -- set Interface p3 type=dummy \
7179 -- --id=@br0 get Bridge br0 \
7180 -- --id=@ipfix create IPFIX targets=\"127.0.0.1:4739\" \
7181 -- --id=@cs create Flow_Sample_Collector_Set id=1 bridge=@br0 ipfix=@ipfix],
7186 OVS_VSWITCHD_DISABLE_TUNNEL_PUSH_POP
7188 dnl Add openflow sample action without sampling_port.
7189 AT_DATA([flows.txt], [dnl
7190 in_port=3, actions=sample(probability=65535,collector_set_id=1),output:1
7192 AT_CHECK([ovs-ofctl add-flows br0 flows.txt], [0], [ignore])
7194 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])
7195 AT_CHECK([tail -1 stdout], [0], [dnl
7196 Datapath 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
7199 dnl Remove the flow which contains sample action.
7200 AT_CHECK([ovs-ofctl del-flows br0 in_port=3], [0], [ignore])
7201 AT_CHECK([ovs-appctl revalidator/purge])
7203 dnl Add openflow sample action with sampling_port which is
7204 dnl equal to output port.
7205 AT_DATA([flows2.txt], [dnl
7206 in_port=3, actions=sample(probability=65535,collector_set_id=1,sampling_port=1),output:1
7208 AT_CHECK([ovs-ofctl add-flows br0 flows2.txt], [0], [ignore])
7210 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])
7211 dnl Make sure flow sample action in datapath is behind set tunnel
7212 dnl action at egress point of tunnel port.
7213 AT_CHECK([tail -1 stdout], [0], [dnl
7214 Datapath actions: set(tunnel(tun_id=0x5,src=2.2.2.2,dst=1.1.1.1,tos=0x1,ttl=64,flags(df|key))),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
7217 dnl Remove the flow which contains sample action.
7218 AT_CHECK([ovs-ofctl del-flows br0 in_port=3], [0], [ignore])
7219 AT_CHECK([ovs-appctl revalidator/purge])
7221 dnl Add a rule with two sample actions and each sample action
7222 dnl has a sampling_port
7223 AT_DATA([flows3.txt], [dnl
7224 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
7226 AT_CHECK([ovs-ofctl add-flows br0 flows3.txt], [0], [ignore])
7228 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])
7229 dnl Make sure flow sample action in datapath is behind set tunnel
7230 dnl action at egress point of tunnel port.
7231 AT_CHECK([tail -1 stdout], [0], [dnl
7232 Datapath actions: set(tunnel(tun_id=0x5,src=2.2.2.2,dst=1.1.1.1,tos=0x1,ttl=64,flags(df|key))),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))),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
7235 dnl Remove the flow which contains sample action.
7236 AT_CHECK([ovs-ofctl del-flows br0 in_port=3], [0], [ignore])
7237 AT_CHECK([ovs-vsctl destroy Flow_Sample_Collector_Set 1], [0], [ignore])
7242 AT_SETUP([ofproto-dpif - clone action])
7244 add_of_ports br0 1 2 3 4
7246 dnl Reversible open flow clone actions, no datapath clone action should be generated.
7247 AT_DATA([flows.txt], [dnl
7248 in_port=1, ip, actions=clone(set_field:192.168.3.3->ip_src),clone(set_field:192.168.4.4->ip_dst,output:2),clone(mod_dl_src:80:81:81:81:81:81,set_field:192.168.5.5->ip_dst,output:3),output:4
7250 AT_CHECK([ovs-ofctl add-flows br0 flows.txt], [0], [ignore])
7252 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(1),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])
7254 AT_CHECK([tail -1 stdout], [0], [dnl
7255 Datapath actions: set(ipv4(src=10.10.10.2,dst=192.168.4.4)),2,set(eth(src=80:81:81:81:81:81)),set(ipv4(src=10.10.10.2,dst=192.168.5.5)),3,set(eth(src=50:54:00:00:00:09)),set(ipv4(src=10.10.10.2,dst=10.10.10.1)),4
7258 dnl Test flow xlate openflow clone action without using datapath clone action.
7259 AT_CHECK([ovs-appctl dpif/set-dp-features br0 clone false], [0], [ignore])
7261 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(1),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])
7263 AT_CHECK([tail -1 stdout], [0], [dnl
7264 Datapath actions: set(ipv4(src=10.10.10.2,dst=192.168.4.4)),2,set(eth(src=80:81:81:81:81:81)),set(ipv4(src=10.10.10.2,dst=192.168.5.5)),3,set(eth(src=50:54:00:00:00:09)),set(ipv4(src=10.10.10.2,dst=10.10.10.1)),4
7267 AT_CHECK([ovs-appctl dpif/set-dp-features br0 sample_nesting 2], [0], [ignore])
7268 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(1),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])
7270 AT_CHECK([tail -1 stdout], [0], [dnl
7271 Datapath actions: set(ipv4(src=10.10.10.2,dst=192.168.4.4)),2,set(eth(src=80:81:81:81:81:81)),set(ipv4(src=10.10.10.2,dst=192.168.5.5)),3,set(eth(src=50:54:00:00:00:09)),set(ipv4(src=10.10.10.2,dst=10.10.10.1)),4
7274 dnl Mixing reversible and irreversible open flow clone actions. Datapath clone action
7275 dnl should be generated when necessary.
7277 dnl Restore the datapath support level.
7278 AT_CHECK([ovs-appctl dpif/set-dp-features br0 clone true], [0], [])
7279 AT_CHECK([ovs-appctl dpif/set-dp-features br0 sample_nesting 10], [0], [])
7281 AT_DATA([flows.txt], [dnl
7282 in_port=1, ip, actions=clone(set_field:192.168.3.3->ip_src),clone(set_field:192.168.4.4->ip_dst,output:2),clone(ct(commit),output:3),output:4
7284 AT_CHECK([ovs-ofctl add-flows br0 flows.txt], [0], [ignore])
7286 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(1),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])
7288 AT_CHECK([tail -1 stdout], [0], [dnl
7289 Datapath actions: set(ipv4(src=10.10.10.2,dst=192.168.4.4)),2,set(ipv4(src=10.10.10.2,dst=10.10.10.1)),clone(ct(commit),3),4
7292 AT_CHECK([ovs-appctl dpif/set-dp-features br0 clone false], [0], [ignore])
7294 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(1),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])
7296 AT_CHECK([tail -1 stdout], [0], [dnl
7297 Datapath actions: set(ipv4(src=10.10.10.2,dst=192.168.4.4)),2,set(ipv4(src=10.10.10.2,dst=10.10.10.1)),sample(sample=100.0%,actions(ct(commit),3)),4
7300 AT_CHECK([ovs-appctl dpif/set-dp-features br0 sample_nesting 2], [0], [ignore])
7301 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(1),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])
7303 AT_CHECK([tail -1 stdout], [0], [dnl
7304 Datapath actions: set(ipv4(src=10.10.10.2,dst=192.168.4.4)),2,set(ipv4(src=10.10.10.2,dst=10.10.10.1)),4
7306 AT_CHECK([grep "Failed to compose clone action" stdout], [0], [ignore])
7311 dnl Flow based IPFIX statistics check
7312 AT_SETUP([ofproto-dpif - Flow IPFIX statistics check])
7314 add_of_ports br0 1 2
7316 dnl Negative test check.
7317 AT_CHECK([ovs-ofctl dump-ipfix-flow br0], [0], [dnl
7318 OFPT_ERROR (xid=0x2): NXST_NOT_CONFIGURED
7319 NXST_IPFIX_FLOW request (xid=0x2):
7322 AT_CHECK([ovs-vsctl -- --id=@br0 get Bridge br0 \
7323 -- --id=@ipfix create IPFIX targets=\"127.0.0.1:4739\" \
7324 -- --id=@cs create Flow_Sample_Collector_Set id=1 bridge=@br0 ipfix=@ipfix],
7327 AT_DATA([flows.txt], [dnl
7328 in_port=1, actions=sample(probability=65535,collector_set_id=1),output:2
7331 AT_CHECK([ovs-ofctl add-flows br0 flows.txt], [0], [ignore])
7333 dnl Send some packets that should be sampled.
7334 for i in `seq 1 20`; do
7335 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)'])
7338 dnl There are 4 extra IPFIX template packets.
7339 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
7340 NXST_IPFIX_FLOW reply (xid=0x2): 1 ids
7341 id 1: flows=20, current flows=0, sampled pkts=20, ipv4 ok=0, ipv6 ok=0, tx pkts=24
7342 pkts errs=20, ipv4 errs=20, ipv6 errs=0, tx errs=0
7345 dnl Remove the flow which contains sample action.
7346 AT_CHECK([ovs-ofctl del-flows br0 in_port=1], [0], [ignore])
7347 AT_CHECK([ovs-vsctl destroy Flow_Sample_Collector_Set 1], [0], [ignore])
7348 AT_CHECK([ovs-appctl revalidator/purge])
7350 dnl Send some more packets, to ensure that these are not sampled.
7351 for i in `seq 1 3`; do
7352 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)'])
7354 AT_CHECK([ovs-ofctl dump-ipfix-flow br0], [0], [dnl
7355 OFPT_ERROR (xid=0x2): NXST_NOT_CONFIGURED
7356 NXST_IPFIX_FLOW request (xid=0x2):
7359 OVS_VSWITCHD_STOP(["/sending to collector failed/d"])
7362 AT_SETUP([ofproto-dpif - flow stats])
7364 AT_CHECK([ovs-ofctl add-flow br0 "ip,actions=NORMAL"])
7365 AT_CHECK([ovs-ofctl add-flow br0 "icmp,actions=NORMAL"])
7367 ovs-appctl time/stop
7369 for i in `seq 1 10`; do
7370 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)'
7373 AT_CHECK([ovs-appctl time/warp 1000], [0], [ignore])
7374 AT_CHECK([ovs-appctl revalidator/purge], [0])
7375 AT_CHECK([ovs-ofctl dump-flows br0], [0], [stdout])
7376 AT_CHECK([strip_xids < stdout | sed -n 's/duration=[[0-9]]*\.[[0-9]]*s/duration=0.0s/p' | sort], [0], [dnl
7377 cookie=0x0, duration=0.0s, table=0, n_packets=0, n_bytes=0, idle_age=1, icmp actions=NORMAL
7378 cookie=0x0, duration=0.0s, table=0, n_packets=10, n_bytes=1180, idle_age=1, ip actions=NORMAL
7383 AT_SETUP([ofproto-dpif - flow stats reset_counts])
7385 flow="ip,actions=NORMAL"
7387 ovs-appctl time/stop
7389 AT_CHECK([ovs-ofctl add-flow br0 $flow])
7391 warp_and_dump_NXM () {
7392 AT_CHECK([ovs-appctl time/warp 1000], [0], [ignore])
7393 AT_CHECK([ovs-appctl revalidator/purge], [0])
7395 AT_CHECK_UNQUOTED([ovs-ofctl dump-flows br0], [0], [stdout])
7396 if [[ $5 -gt 0 ]]; then
7397 expected=" cookie=0x0, duration=$1s, table=0, n_packets=$2, n_bytes=$3, idle_age=$4, hard_age=$5, ip actions=NORMAL"
7399 expected=" cookie=0x0, duration=$1s, table=0, n_packets=$2, n_bytes=$3, idle_age=$4, ip actions=NORMAL"
7401 AT_CHECK_UNQUOTED([strip_xids < stdout | sed -n 's/duration=\([[0-9]]*\)\.*[[0-9]]*s/duration=\1s/p' | sort], [0], [dnl
7406 warp_and_dump_OF () {
7407 AT_CHECK([ovs-appctl time/warp 1000], [0], [ignore])
7408 AT_CHECK([ovs-appctl revalidator/purge], [0])
7410 AT_CHECK_UNQUOTED([ovs-ofctl -O OpenFlow$1 dump-flows br0], [0], [stdout])
7411 if [[ $1 -lt 13 -o "$5X" = "X" ]]; then
7412 expected=" cookie=0x0, duration=$2s, table=0, n_packets=$3, n_bytes=$4, ip actions=NORMAL"
7414 expected=" cookie=0x0, duration=$2s, table=0, n_packets=$3, n_bytes=$4, $5 ip actions=NORMAL"
7416 AT_CHECK_UNQUOTED([strip_xids < stdout | sed -n 's/duration=\([[0-9]]*\)\.*[[0-9]]*s/duration=\1s/p' | sort], [0], [dnl
7422 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)'
7425 # OpenFlow 1.0, implicit reset_counts
7427 warp_and_dump_NXM 1 1 118 1
7428 AT_CHECK_UNQUOTED([ovs-ofctl -O OpenFlow10 add-flow br0 $flow])
7429 # add-flow resets duration and counts,
7430 # but idle age is inherited from the old flow
7431 warp_and_dump_NXM 1 0 0 2
7434 warp_and_dump_NXM 2 1 118 1
7435 AT_CHECK_UNQUOTED([ovs-ofctl -O OpenFlow10 mod-flows br0 $flow])
7436 # mod-flows resets hard_age, but not counts
7437 # but duration and idle_age is inherited from the old flow
7438 warp_and_dump_NXM 3 1 118 2 1
7440 # OpenFlow 1.1, implicit reset_counts
7442 warp_and_dump_OF 11 4 2 236
7443 AT_CHECK_UNQUOTED([ovs-ofctl -O OpenFlow11 add-flow br0 $flow])
7444 # add-flow resets duration and counts,
7445 # but idle age is inherited from the old flow
7446 warp_and_dump_NXM 1 0 0 2
7447 warp_and_dump_OF 11 2 0 0
7450 warp_and_dump_OF 11 3 1 118
7451 AT_CHECK_UNQUOTED([ovs-ofctl -O OpenFlow11 mod-flows br0 $flow])
7452 # mod-flows resets hard_age, but not counts
7453 # but duration and idle_age is inherited from the old flow
7454 warp_and_dump_NXM 4 1 118 2 1
7455 warp_and_dump_OF 11 5 1 118
7457 # OpenFlow 1.2, explicit reset_counts
7459 warp_and_dump_OF 12 6 2 236
7460 AT_CHECK_UNQUOTED([ovs-ofctl -O OpenFlow12 add-flow br0 $flow])
7461 # add-flow without flags resets duration, but not counts,
7462 # idle age is inherited from the old flow
7463 warp_and_dump_NXM 1 2 236 2
7464 warp_and_dump_OF 12 2 2 236
7467 warp_and_dump_OF 12 3 3 354
7468 AT_CHECK_UNQUOTED([ovs-ofctl -O OpenFlow12 mod-flows br0 $flow])
7469 # mod-flows without flags does not reset duration nor counts,
7470 # idle age is inherited from the old flow
7471 warp_and_dump_NXM 4 3 354 2 1
7472 warp_and_dump_OF 12 5 3 354
7475 warp_and_dump_OF 12 6 4 472
7476 AT_CHECK_UNQUOTED([ovs-ofctl -O OpenFlow12 add-flow br0 reset_counts,$flow])
7477 # add-flow with reset_counts resets both duration and counts,
7478 # idle age is inherited from the old flow
7479 warp_and_dump_NXM 1 0 0 2
7480 warp_and_dump_OF 12 2 0 0
7483 warp_and_dump_OF 12 3 1 118
7484 AT_CHECK_UNQUOTED([ovs-ofctl -O OpenFlow12 mod-flows br0 reset_counts,$flow])
7485 # mod-flows with reset_counts resets counts, but not duration,
7486 # idle age is inherited from the old flow
7487 warp_and_dump_NXM 4 0 0 2 1
7488 warp_and_dump_OF 12 5 0 0
7490 # OpenFlow > 1.3, explicit reset_counts
7491 flow_mods_reset_counts () {
7492 # Reset to a known state
7493 AT_CHECK([ovs-ofctl add-flow br0 $flow])
7496 warp_and_dump_OF $1 1 1 118 reset_counts
7497 AT_CHECK_UNQUOTED([ovs-ofctl -O OpenFlow$1 add-flow br0 $flow])
7498 # add-flow without flags resets duration, but not counts,
7499 # idle age is inherited from the old flow
7500 warp_and_dump_NXM 1 1 118 2
7501 warp_and_dump_OF $1 2 1 118
7504 warp_and_dump_OF $1 3 2 236
7505 AT_CHECK_UNQUOTED([ovs-ofctl -O OpenFlow$1 mod-flows br0 $flow])
7506 # mod-flows without flags does not reset duration nor counts,
7507 # idle age is inherited from the old flow
7508 warp_and_dump_NXM 4 2 236 2 1
7509 warp_and_dump_OF $1 5 2 236
7512 warp_and_dump_OF $1 6 3 354
7513 AT_CHECK_UNQUOTED([ovs-ofctl -O OpenFlow$1 add-flow br0 reset_counts,$flow])
7514 # add-flow with reset_counts resets both duration and counts,
7515 # idle age is inherited from the old flow
7516 warp_and_dump_NXM 1 0 0 2
7517 warp_and_dump_OF $1 2 0 0 reset_counts
7520 warp_and_dump_OF $1 3 1 118 reset_counts
7521 AT_CHECK_UNQUOTED([ovs-ofctl -O OpenFlow$1 mod-flows br0 reset_counts,$flow])
7522 # mod-flows with reset_counts resets counts, but not duration,
7523 # idle age is inherited from the old flow
7524 warp_and_dump_NXM 4 0 0 2 1
7525 warp_and_dump_OF $1 5 0 0 reset_counts
7527 # Modify flow having reset_counts flag without reset_counts
7529 warp_and_dump_OF $1 6 1 118 reset_counts
7530 AT_CHECK_UNQUOTED([ovs-ofctl -O OpenFlow$1 mod-flows br0 $flow])
7531 warp_and_dump_NXM 7 1 118 2 1
7532 warp_and_dump_OF $1 8 1 118 reset_counts
7534 # Add flow having reset_counts flag without reset_counts
7536 warp_and_dump_OF $1 9 2 236 reset_counts
7537 AT_CHECK_UNQUOTED([ovs-ofctl -O OpenFlow$1 add-flow br0 $flow])
7538 warp_and_dump_NXM 1 2 236 2
7539 warp_and_dump_OF $1 2 2 236
7541 # Modify flow w/o reset_counts flag with a flow_mod having reset_counts
7543 warp_and_dump_OF $1 3 3 354
7544 AT_CHECK_UNQUOTED([ovs-ofctl -O OpenFlow$1 mod-flows br0 reset_counts,$flow])
7545 warp_and_dump_NXM 4 0 0 2 1
7546 warp_and_dump_OF $1 5 0 0
7549 # OpenFlow versions >= 1.3 should behave the same way
7550 flow_mods_reset_counts 13
7551 flow_mods_reset_counts 14
7556 AT_SETUP([ofproto-dpif - flow stats reset_counts OpenFlow1.5])
7558 flow="ip,actions=NORMAL"
7560 ovs-appctl time/stop
7562 AT_CHECK([ovs-ofctl add-flow br0 $flow])
7564 warp_and_dump_OF () {
7565 AT_CHECK([ovs-appctl time/warp 1000], [0], [ignore])
7566 AT_CHECK([ovs-appctl revalidator/purge], [0])
7568 AT_CHECK_UNQUOTED([ovs-ofctl -O OpenFlow$1 dump-flows br0 ], [0], [stdout])
7569 if [[ "$6X" = "X" ]]; then
7570 expected=" cookie=0x0, duration=$2s, table=0, n_packets=$3, n_bytes=$4, idle_age=$5, ip actions=NORMAL"
7572 expected=" cookie=0x0, duration=$2s, table=0, n_packets=$3, n_bytes=$4, $6 idle_age=$5, ip actions=NORMAL"
7574 AT_CHECK_UNQUOTED([strip_xids < stdout | sed -n 's/duration=\([[0-9]]*\)\.*[[0-9]]*s/duration=\1s/p' | sort], [0], [dnl
7580 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)'
7583 # OpenFlow 1.5, explicit reset_counts
7584 flow_mods_reset_counts () {
7585 # Reset to a known state
7586 AT_CHECK([ovs-ofctl add-flow br0 $flow])
7589 warp_and_dump_OF $1 1 1 118 1 reset_counts
7590 AT_CHECK_UNQUOTED([ovs-ofctl -O OpenFlow$1 add-flow br0 $flow])
7591 # add-flow without flags resets duration, but not counts,
7592 # idle age is inherited from the old flow
7593 warp_and_dump_OF $1 1 1 118 2
7596 warp_and_dump_OF $1 2 2 236 1
7597 AT_CHECK_UNQUOTED([ovs-ofctl -O OpenFlow$1 mod-flows br0 $flow])
7598 # mod-flows without flags does not reset duration nor counts,
7599 # idle age is inherited from the old flow
7600 warp_and_dump_OF $1 3 2 236 2
7603 warp_and_dump_OF $1 4 3 354 1
7604 AT_CHECK_UNQUOTED([ovs-ofctl -O OpenFlow$1 add-flow br0 reset_counts,$flow])
7605 # add-flow with reset_counts resets both duration and counts,
7606 # idle age is inherited from the old flow
7607 warp_and_dump_OF $1 1 0 0 2 reset_counts
7610 warp_and_dump_OF $1 2 1 118 1 reset_counts
7611 AT_CHECK_UNQUOTED([ovs-ofctl -O OpenFlow$1 mod-flows br0 reset_counts,$flow])
7612 # mod-flows with reset_counts resets counts, but not duration,
7613 # idle age is inherited from the old flow
7614 warp_and_dump_OF $1 3 0 0 2 reset_counts
7616 # Modify flow having reset_counts flag without reset_counts
7618 warp_and_dump_OF $1 4 1 118 1 reset_counts
7619 AT_CHECK_UNQUOTED([ovs-ofctl -O OpenFlow$1 mod-flows br0 $flow])
7620 warp_and_dump_OF $1 5 1 118 2 reset_counts
7622 # Add flow having reset_counts flag without reset_counts
7624 warp_and_dump_OF $1 6 2 236 1 reset_counts
7625 AT_CHECK_UNQUOTED([ovs-ofctl -O OpenFlow$1 add-flow br0 $flow])
7626 warp_and_dump_OF $1 1 2 236 2
7628 # Modify flow w/o reset_counts flag with a flow_mod having reset_counts
7630 warp_and_dump_OF $1 2 3 354 1
7631 AT_CHECK_UNQUOTED([ovs-ofctl -O OpenFlow$1 mod-flows br0 reset_counts,$flow])
7632 warp_and_dump_OF $1 3 0 0 2
7635 # OpenFlow versions >= 1.3 should behave the same way
7636 flow_mods_reset_counts 15
7642 AT_SETUP([ofproto-dpif - flow stats, set-n-threads])
7644 AT_CHECK([ovs-ofctl add-flow br0 "ip,actions=NORMAL"])
7645 AT_CHECK([ovs-ofctl add-flow br0 "icmp,actions=NORMAL"])
7647 ovs-appctl time/stop
7649 for i in `seq 1 10`; do
7650 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)'
7653 ovs-appctl time/warp 100
7654 AT_CHECK([ovs-vsctl set Open_vSwitch . other-config:n-revalidator-threads=2])
7655 ovs-appctl time/warp 1000
7657 AT_CHECK([ovs-ofctl dump-flows br0], [0], [stdout])
7658 AT_CHECK([strip_xids < stdout | sed -n 's/duration=[[0-9]]*\.[[0-9]]*s/duration=0.0s/p' | sort], [0], [dnl
7659 cookie=0x0, duration=0.0s, table=0, n_packets=0, n_bytes=0, idle_age=1, icmp actions=NORMAL
7660 cookie=0x0, duration=0.0s, table=0, n_packets=10, n_bytes=1180, idle_age=1, ip actions=NORMAL
7665 AT_SETUP([ofproto-dpif - idle_age and hard_age increase over time])
7668 # get_ages DURATION HARD IDLE
7670 # Fetch the flow duration, hard age, and idle age into the variables
7671 # whose names are given as arguments. Rounds DURATION down to the
7672 # nearest integer. If hard_age doesn't appear in the output, sets
7673 # HARD to "none". If idle_age doesn't appear in the output, sets IDLE
7676 AT_CHECK([ovs-ofctl dump-flows br0], [0], [stdout])
7678 duration=`sed -n 's/.*duration=\([[0-9]]*\)\(\.[[0-9]]*\)\{0,1\}s.*/\1/p' stdout`
7679 AT_CHECK([[expr X"$duration" : 'X[0-9][0-9]*$']], [0], [ignore])
7680 AS_VAR_COPY([$1], [duration])
7682 hard=`sed -n 's/.*hard_age=\([[0-9]]*\),.*/\1/p' stdout`
7683 if test X"$hard" = X; then
7686 AT_CHECK([[expr X"$hard" : 'X[0-9][0-9]*$']], [0], [ignore])
7688 AS_VAR_COPY([$2], [hard])
7690 idle=`sed -n 's/.*idle_age=\([[0-9]]*\),.*/\1/p' stdout`
7691 if test X"$idle" = X; then
7694 AT_CHECK([[expr X"$idle" : 'X[0-9][0-9]*$']], [0], [ignore])
7696 AS_VAR_COPY([$3], [idle])
7699 # Add a flow and get its initial hard and idle age.
7700 AT_CHECK([ovs-ofctl add-flow br0 hard_timeout=199,idle_timeout=188,actions=drop])
7701 get_ages duration1 hard1 idle1
7703 ovs-appctl time/stop
7704 # Warp time forward by 10 seconds, then modify the flow's actions.
7705 ovs-appctl time/warp 10000
7706 get_ages duration2 hard2 idle2
7707 AT_CHECK([ovs-ofctl mod-flows br0 actions=flood])
7709 # Warp time forward by 10 seconds.
7710 ovs-appctl time/warp 10000
7711 get_ages duration3 hard3 idle3
7713 # Warp time forward 10 more seconds, then pass some packets through the flow,
7714 # then warp forward a few more times because idle times are only updated
7716 ovs-appctl time/warp 10000
7717 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)'
7718 ovs-appctl time/warp 3000 1000
7720 get_ages duration4 hard4 idle4
7722 printf "duration: %4s => %4s => %4s => %4s\n" $duration1 $duration2 $duration3 $duration4
7723 printf "hard_age: %4s => %4s => %4s => %4s\n" $hard1 $hard2 $hard3 $hard4
7724 printf "idle_age: %4s => %4s => %4s => %4s\n" $idle1 $idle2 $idle3 $idle4
7726 # Duration should increase steadily over time.
7727 AT_CHECK([test $duration1 -lt $duration2])
7728 AT_CHECK([test $duration2 -lt $duration3])
7729 AT_CHECK([test $duration3 -lt $duration4])
7731 # Hard age should be "none" initially because it's the same as flow_duration,
7732 # then it should increase.
7733 AT_CHECK([test $hard1 = none])
7734 AT_CHECK([test $hard2 = none])
7735 AT_CHECK([test $hard3 != none])
7736 AT_CHECK([test $hard4 != none])
7737 AT_CHECK([test $hard3 -lt $hard4])
7739 # Idle age should increase from 1 to 2 to 3, then decrease.
7740 AT_CHECK([test $idle1 -lt $idle2])
7741 AT_CHECK([test $idle2 -lt $idle3])
7742 AT_CHECK([test $idle3 -gt $idle4])
7744 # Check some invariant relationships.
7745 AT_CHECK([test $duration1 = $idle1])
7746 AT_CHECK([test $duration2 = $idle2])
7747 AT_CHECK([test $duration3 = $idle3])
7748 AT_CHECK([test $idle3 -gt $hard3])
7749 AT_CHECK([test $idle4 -lt $hard4])
7750 AT_CHECK([test $hard4 -lt $duration4])
7755 AT_SETUP([ofproto-dpif - fin_timeout])
7757 ovs-appctl time/stop
7758 AT_CHECK([ovs-ofctl add-flow br0 'idle_timeout=60,actions=fin_timeout(idle_timeout=5)'])
7759 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip], [0],
7761 idle_timeout=60, actions=fin_timeout(idle_timeout=5)
7764 # Check that a TCP SYN packet does not change the timeout. (Because
7765 # flow stats updates are mainly what implements the fin_timeout
7766 # feature, we warp forward a couple of times to ensure that flow stats
7767 # run before re-checking the flow table.)
7768 AT_CHECK([ovs-appctl netdev-dummy/receive br0 0021853763af0026b98cb0f908004500003c2e2440004006465dac11370dac11370b828b0016751e267b00000000a00216d017360000020405b40402080a2d25085f0000000001030307])
7769 AT_CHECK([ovs-appctl time/warp 1000 && ovs-appctl time/warp 1000], [0], [warped
7772 AT_CHECK([ovs-appctl revalidator/purge], [0])
7773 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip], [0],
7775 n_packets=1, n_bytes=74, idle_timeout=60, actions=fin_timeout(idle_timeout=5)
7777 # Check that a TCP FIN packet does change the timeout.
7778 AT_CHECK([ovs-appctl netdev-dummy/receive br0 0021853763af0026b98cb0f90800451000342e3e40004006463bac11370dac11370b828b0016751e319dfc96399b801100717ae800000101080a2d250a9408579588])
7779 AT_CHECK([ovs-appctl time/warp 1000 && ovs-appctl time/warp 1000], [0], [warped
7782 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip], [0],
7784 n_packets=2, n_bytes=140, idle_timeout=5, actions=fin_timeout(idle_timeout=5)
7789 AT_SETUP([ofproto-dpif - ovs-appctl dpif/dump-dps])
7790 OVS_VSWITCHD_START([add-br br1 -- set bridge br1 datapath-type=dummy])
7791 add_of_ports br0 1 2
7794 AT_CHECK([ovs-appctl dpif/dump-dps], [0], [dnl
7801 AT_SETUP([ofproto-dpif - ovs-appctl dpif/show])
7802 OVS_VSWITCHD_START([add-br br1 -- set bridge br1 datapath-type=dummy], [], [],
7803 [--dummy-numa="0,0,0,0,1,1,1,1"])
7804 add_pmd_of_ports br0 1 2
7807 AT_CHECK([ovs-appctl dpif/show | sed 's/\(dummy-pmd: \).*)/\1<cleared>)/'], [0], [dnl
7808 dummy@ovs-dummy: hit:0 missed:0
7810 br0 65534/100: (dummy-internal)
7811 p1 1/1: (dummy-pmd: <cleared>)
7812 p2 2/2: (dummy-pmd: <cleared>)
7814 br1 65534/101: (dummy-internal)
7820 AT_SETUP([ofproto-dpif - ovs-appctl dpif/dump-flows])
7821 # bump max-idle to avoid the flows being reclaimed behind us
7822 OVS_VSWITCHD_START([add-br br1 -- \
7823 set bridge br1 datapath-type=dummy fail-mode=secure -- \
7824 set Open_vSwitch . other_config:max-idle=10000], [], [],
7825 [--dummy-numa="0,0,0,0,1,1,1,1"])
7827 add_pmd_of_ports br0 2
7830 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)'])
7831 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)'])
7832 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)'])
7833 ovs-appctl revalidator/wait
7834 AT_CHECK([ovs-appctl dpif/dump-flows br0 | strip_ufid | strip_used | sort], [0], [dnl
7835 recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth_type(0x0800),ipv4(frag=no), packets:0, bytes:0, used:never, actions:drop
7836 recirc_id(0),in_port(2),packet_type(ns=0,id=0),eth_type(0x0800),ipv4(frag=no), packets:0, bytes:0, used:never, actions:drop
7839 AT_CHECK([ovs-appctl dpif/dump-flows br1 | strip_ufid | strip_used | sort], [0], [dnl
7840 recirc_id(0),in_port(3),packet_type(ns=0,id=0),eth_type(0x0800),ipv4(frag=no), packets:0, bytes:0, used:never, actions:drop
7843 AT_CHECK([ovs-appctl dpif/dump-flows -m br0 | strip_ufid | strip_used | sort], [0], [dnl
7844 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),packet_type(ns=0,id=0),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
7845 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),packet_type(ns=0,id=0),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
7848 AT_CHECK([ovs-appctl dpif/dump-flows -m br1 | strip_ufid | strip_used | sort], [0], [dnl
7849 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),packet_type(ns=0,id=0),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
7855 m4_define([OFPROTO_DPIF_GET_FLOW],
7856 [AT_SETUP([ofproto-dpif - ovs-appctl dpif/get-flow$1])
7858 OVS_VSWITCHD_START([add-br br1 -- \
7859 set bridge br1 datapath-type=dummy fail-mode=secure -- \
7860 set Open_vSwitch . other_config:max-idle=10000], [], [],
7861 [m4_if([$1], [], [], [--dummy-numa="0,0,0,0,1,1,1,1"])])
7863 func=`printf '%s_' "$1" | cut -c 4-`
7864 add_${func}of_ports br0 1 2
7866 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)'])
7867 ovs-appctl revalidator/wait
7868 AT_CHECK([ovs-appctl dpif/dump-flows -m br0], [0], [stdout])
7870 UFID=`sed -n 's/\(ufid:[[-0-9a-fA-F]]*\).*/\1/p' stdout`
7871 AT_CHECK([ovs-appctl dpctl/get-flow $UFID], [0], [dnl
7872 recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth_type(0x0800),ipv4(frag=no), packets:0, bytes:0, used:never, actions:drop
7878 OFPROTO_DPIF_GET_FLOW([])
7879 OFPROTO_DPIF_GET_FLOW([ - pmd])
7881 AT_SETUP([ofproto-dpif - MPLS actions that result in a userspace action])
7882 OVS_VSWITCHD_START([dnl
7883 add-port br0 p1 -- set Interface p1 type=dummy
7885 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
7886 on_exit 'kill `cat ovs-ofctl.pid`'
7888 AT_CAPTURE_FILE([ofctl_monitor.log])
7889 AT_DATA([flows.txt], [dnl
7890 dl_src=60:66:66:66:66:00 actions=push_mpls:0x8847,controller
7891 dl_src=60:66:66:66:66:01 actions=pop_mpls:0x8847,controller
7893 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
7895 dnl Packet is sent to userspace because a MPLS push or pop action is applied to
7896 dnl a packet with 2 MPLS LSEs but dpif-netdev can't handle any labels.
7898 dnl The input is a frame with two MPLS labels which tcpdump -vve shows as:
7899 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)
7900 dnl (label 20, exp 0, [S], ttl 32)
7901 dnl (tos 0x0, ttl 64, id 0, offset 0, flags [none], proto TCP (6), length 44, bad cksum 3b78 (->f978)!)
7902 dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x7744 (correct), seq 42:46, win 10000, length 4
7904 for dl_src in 00 01; do
7905 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"])
7907 sleep 1 # wait for the datapath flow installed
7908 AT_CHECK_UNQUOTED([strip_ufid < ovs-vswitchd.log | filter_flow_install | strip_used], [0], [dnl
7909 recirc_id(0),in_port(1),packet_type(ns=0,id=0),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:push_mpls(label=20,tc=0,ttl=32,bos=0,eth_type=0x8847),userspace(pid=0,controller(reason=1,dont_send=0,continuation=0,recirc_id=1,rule_cookie=0,controller_id=0,max_len=65535))
7910 recirc_id(0),in_port(1),packet_type(ns=0,id=0),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:pop_mpls(eth_type=0x8847),userspace(pid=0,controller(reason=1,dont_send=0,continuation=0,recirc_id=1,rule_cookie=0,controller_id=0,max_len=65535))
7917 AT_SETUP([ofproto-dpif - MPLS actions that result in a drop])
7918 OVS_VSWITCHD_START([dnl
7919 add-port br0 p1 -- set Interface p1 type=dummy
7921 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
7922 on_exit 'kill `cat ovs-ofctl.pid`'
7924 AT_CAPTURE_FILE([ofctl_monitor.log])
7925 AT_DATA([flows.txt], [dnl
7926 dl_src=60:66:66:66:66:00 actions=push_mpls:0x8847,controller
7927 dl_src=60:66:66:66:66:01 actions=pop_mpls:0x8847,controller
7929 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
7931 dnl Packet is dropped because an MPLS PUSH action is applied to a packet with
7932 dnl 4 MPLS LSEs but ovs-vswtichd can only handle up to 3 MPLS LSEs and thus
7933 dnl can't determine the resulting MPLS label after MPLS push/pop actions.
7935 dnl The input is a frame with two MPLS headers which tcpdump -vve shows as:
7936 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)
7937 dnl (label 20, exp 0, ttl 32)
7938 dnl (label 20, exp 0, ttl 32)
7939 dnl (label 20, exp 0, [S], ttl 32)
7940 dnl (tos 0x0, ttl 64, id 0, offset 0, flags [none], proto TCP (6), length 44, bad cksum 3b78 (->f978)!)
7941 dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x7744 (correct), seq 42:46, win 10000, length 4
7943 for dl_src in 00 01; do
7944 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"])
7946 sleep 1 # wait for the datapath flow installed
7947 AT_CHECK_UNQUOTED([strip_ufid < ovs-vswitchd.log | filter_flow_install | strip_used], [0], [dnl
7948 recirc_id(0),in_port(1),packet_type(ns=0,id=0),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:push_mpls(label=20,tc=0,ttl=32,bos=0,eth_type=0x8847),userspace(pid=0,controller(reason=1,dont_send=0,continuation=0,recirc_id=1,rule_cookie=0,controller_id=0,max_len=65535))
7949 recirc_id(0),in_port(1),packet_type(ns=0,id=0),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:pop_mpls(eth_type=0x8847),userspace(pid=0,controller(reason=1,dont_send=0,continuation=0,recirc_id=1,rule_cookie=0,controller_id=0,max_len=65535))
7955 AT_SETUP([ofproto-dpif - patch ports])
7956 OVS_VSWITCHD_START([add-br br1 \
7957 -- set bridge br1 datapath-type=dummy fail-mode=secure \
7958 -- add-port br1 pbr1 -- set int pbr1 type=patch options:peer=pbr0 \
7959 -- add-port br0 pbr0 -- set int pbr0 type=patch options:peer=pbr1])
7964 AT_CHECK([ovs-appctl upcall/disable-ufid], [0], [Datapath dumping tersely using UFID disabled
7966 AT_CHECK([ovs-appctl time/stop])
7967 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
7969 AT_CHECK([ovs-ofctl add-flow br0 actions=LOCAL,output:1,output:2])
7970 AT_CHECK([ovs-ofctl add-flow br1 actions=LOCAL,output:1,output:3])
7972 for i in $(seq 1 10); do
7973 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)'
7974 if [[ $i -eq 1 ]]; then
7979 for i in $(seq 1 5); do
7980 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)'
7981 if [[ $i -eq 1 ]]; then
7986 AT_CHECK([ovs-appctl time/warp 500], [0],
7989 sleep 1 # wait for log writer
7991 AT_CHECK([ovs-appctl dpif/show], [0], [dnl
7992 dummy@ovs-dummy: hit:13 missed:2
7994 br0 65534/100: (dummy-internal)
7996 pbr0 1/none: (patch: peer=pbr1)
7998 br1 65534/101: (dummy-internal)
8000 pbr1 1/none: (patch: peer=pbr0)
8003 AT_CHECK([strip_ufid < ovs-vswitchd.log | filter_flow_install | strip_used], [0], [dnl
8004 recirc_id(0),in_port(100),packet_type(ns=0,id=0),eth_type(0x0800),ipv4(frag=no), actions:101,3,2
8005 recirc_id(0),in_port(101),packet_type(ns=0,id=0),eth_type(0x0800),ipv4(frag=no), actions:100,2,3
8008 AT_CHECK([grep -e 'in_port(100).*packets:9' ovs-vswitchd.log | strip_ufid | filter_flow_dump], [0], [dnl
8009 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),packet_type(ns=0,id=0),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:954, used:0.0s, actions:101,3,2
8011 AT_CHECK([grep -e 'in_port(101).*packets:4' ovs-vswitchd.log | strip_ufid | filter_flow_dump], [0], [dnl
8012 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),packet_type(ns=0,id=0),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:424, used:0.0s, actions:100,2,3
8015 AT_CHECK([ovs-ofctl dump-ports br0 pbr0], [0], [dnl
8016 OFPST_PORT reply (xid=0x4): 1 ports
8017 port 1: rx pkts=5, bytes=530, drop=?, errs=?, frame=?, over=?, crc=?
8018 tx pkts=10, bytes=1060, drop=?, errs=?, coll=?
8021 AT_CHECK([ovs-ofctl dump-ports br1 pbr1], [0], [dnl
8022 OFPST_PORT reply (xid=0x4): 1 ports
8023 port 1: rx pkts=10, bytes=1060, drop=?, errs=?, frame=?, over=?, crc=?
8024 tx pkts=5, bytes=530, drop=?, errs=?, coll=?
8030 AT_SETUP([ofproto-dpif - patch ports - stack])
8031 OVS_VSWITCHD_START([add-br br1 \
8032 -- set bridge br1 datapath-type=dummy fail-mode=secure \
8033 -- add-port br1 pbr1 -- set int pbr1 type=patch options:peer=pbr0 \
8034 -- add-port br0 pbr0 -- set int pbr0 type=patch options:peer=pbr1])
8039 AT_CHECK([ovs-appctl upcall/disable-ufid], [0], [Datapath dumping tersely using UFID disabled
8041 AT_CHECK([ovs-appctl time/stop])
8042 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
8044 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"])
8045 # Try to pop from empty stack, and push and leave data to stack.
8046 AT_CHECK([ovs-ofctl add-flow br1 "ip actions=pop:OXM_OF_IPV4_DST[[0..31]],push:NXM_NX_REG1[[0..31]],LOCAL"])
8048 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)'
8050 AT_CHECK([ovs-appctl time/warp 500], [0],
8054 OVS_WAIT_UNTIL([test `grep flow_add ovs-vswitchd.log | wc -l` -ge 1])
8056 AT_CHECK([ovs-appctl dpif/show], [0], [dnl
8057 dummy@ovs-dummy: hit:0 missed:1
8059 br0 65534/100: (dummy-internal)
8061 pbr0 1/none: (patch: peer=pbr1)
8063 br1 65534/101: (dummy-internal)
8065 pbr1 1/none: (patch: peer=pbr0)
8068 AT_CHECK([strip_ufid < ovs-vswitchd.log | filter_flow_install | strip_used], [0], [dnl
8069 recirc_id(0),in_port(100),packet_type(ns=0,id=0),eth_type(0x0800),ipv4(src=192.168.0.1,frag=no), actions:101,set(ipv4(src=255.255.255.254)),2
8072 AT_CHECK([grep -e '|ofproto_dpif_xlate|WARN|' ovs-vswitchd.log | sed "s/^.*|WARN|//"], [0], [dnl
8073 stack underflow on bridge br1 while processing icmp,in_port=LOCAL,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,icmp_type=8,icmp_code=0
8076 OVS_VSWITCHD_STOP(["/stack underflow/d"])
8079 AT_SETUP([ofproto-dpif - port duration])
8080 OVS_VSWITCHD_START([set Bridge br0 protocols=OpenFlow13])
8081 add_of_ports br0 1 2
8083 ovs-appctl time/stop
8084 ovs-appctl time/warp 10000
8086 AT_CHECK([ovs-ofctl -O openflow13 dump-ports br0], [0], [stdout])
8087 AT_CHECK([sed -n 's/=[[0-9]][[0-9]]\(\.[[0-9]][[0-9]]*\)\{0,1\}s/=?s/p' stdout], [0],
8096 dnl ----------------------------------------------------------------------
8097 AT_BANNER([ofproto-dpif -- megaflows])
8099 AT_SETUP([ofproto-dpif megaflow - port classification])
8101 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
8102 add_of_ports br0 1 2
8103 AT_DATA([flows.txt], [dnl
8104 table=0 in_port=1 actions=output(2)
8106 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
8107 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)'])
8109 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)'])
8111 AT_CHECK([filter_flow_install < ovs-vswitchd.log | strip_xout], [0], [dnl
8112 recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth_type(0x0800),ipv4(frag=no), actions: <del>
8117 AT_SETUP([ofproto-dpif megaflow - L2 classification])
8119 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
8120 add_of_ports br0 1 2
8121 AT_DATA([flows.txt], [dnl
8122 table=0 in_port=1,dl_src=50:54:00:00:00:09 actions=output(2)
8124 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
8125 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)'])
8126 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)'])
8128 AT_CHECK([filter_flow_install < ovs-vswitchd.log | strip_xout], [0], [dnl
8129 recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth(src=50:54:00:00:00:09),eth_type(0x0800),ipv4(frag=no), actions: <del>
8130 recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth(src=50:54:00:00:00:0b),eth_type(0x0800),ipv4(frag=no), actions: <del>
8135 AT_SETUP([ofproto-dpif megaflow - L3 classification])
8137 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
8138 add_of_ports br0 1 2
8139 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], [])
8140 AT_DATA([flows.txt], [dnl
8141 table=0 in_port=1,icmp,nw_src=10.0.0.4 actions=output(2)
8143 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
8144 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)'])
8145 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)'])
8147 AT_CHECK([filter_flow_install < ovs-vswitchd.log | strip_xout], [0], [dnl
8148 recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth_type(0x0800),ipv4(src=10.0.0.2/255.255.255.252,frag=no), actions: <del>
8149 recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth_type(0x0800),ipv4(src=10.0.0.4,proto=1,frag=no), actions: <del>
8154 AT_SETUP([ofproto-dpif megaflow - IPv6 classification])
8156 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
8157 add_of_ports br0 1 2
8158 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], [])
8159 AT_DATA([flows.txt], [dnl
8160 table=0 in_port=1,ipv6,ipv6_src=2001:db8:3c4d:1:2:3:4:5 actions=output(2)
8162 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
8163 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)'])
8164 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)'])
8166 AT_CHECK([filter_flow_install < ovs-vswitchd.log | strip_xout], [0], [dnl
8167 recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth_type(0x86dd),ipv6(src=2001:db8:3c4d:1:2:3:4:5,frag=no), actions: <del>
8168 recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth_type(0x86dd),ipv6(src=2001:db8:3c4d:5:4:3:2:1/ffff:ffff:ffff:fffc::,frag=no), actions: <del>
8173 AT_SETUP([ofproto-dpif megaflow - L4 classification])
8175 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
8176 add_of_ports br0 1 2
8177 AT_DATA([flows.txt], [dnl
8178 table=0 in_port=1,icmp,icmp_type=8 actions=output(2)
8180 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
8181 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)'])
8183 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)'])
8185 AT_CHECK([filter_flow_install < ovs-vswitchd.log | strip_xout], [0], [dnl
8186 recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth_type(0x0800),ipv4(proto=1,frag=no),icmp(type=8), actions: <del>
8191 m4_define([OFPROTO_DPIF_MEGAFLOW_NORMAL],
8192 [AT_SETUP([ofproto-dpif megaflow - normal$1])
8193 OVS_VSWITCHD_START([], [], [], [m4_if([$1], [], [], [--dummy-numa="0,0,0,0,1,1,1,1"])])
8194 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
8195 func=`printf '%s_' "$1" | cut -c 4-`
8196 add_${func}of_ports br0 1 2
8197 AT_CHECK([ovs-ofctl add-flow br0 action=normal])
8198 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)'])
8199 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)'])
8201 AT_CHECK([filter_flow_install < ovs-vswitchd.log | strip_xout], [0], [dnl
8202 recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(frag=no), actions: <del>
8203 recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(frag=no), actions: <del>
8208 OFPROTO_DPIF_MEGAFLOW_NORMAL([])
8209 OFPROTO_DPIF_MEGAFLOW_NORMAL([ - pmd])
8211 AT_SETUP([ofproto-dpif megaflow - mpls])
8213 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
8214 add_of_ports br0 1 2
8215 AT_DATA([flows.txt], [dnl
8216 table=0 dl_src=50:54:00:00:00:09 actions=push_mpls:0x8847,2
8217 table=0 dl_src=50:54:00:00:00:0b actions=pop_mpls:0x0800,2
8219 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
8220 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)'])
8221 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)'])
8223 AT_CHECK([filter_flow_install < ovs-vswitchd.log | strip_xout_keep_actions], [0], [dnl
8224 recirc_id(0),in_port(1),packet_type(ns=0,id=0),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
8225 recirc_id(0),in_port(1),packet_type(ns=0,id=0),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
8230 # CHECK_MEGAFLOW_NETFLOW(LOOPBACK_ADDR)
8231 m4_define([CHECK_MEGAFLOW_NETFLOW],
8233 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
8234 add_of_ports br0 1 2
8236 dnl NetFlow configuration disables wildcarding relevant fields
8237 on_exit 'kill `cat test-netflow.pid`'
8238 AT_CHECK([ovstest test-netflow --log-file --detach --no-chdir --pidfile 0:$1 > netflow.log], [0], [], [ignore])
8239 AT_CAPTURE_FILE([netflow.log])
8240 PARSE_LISTENING_PORT([test-netflow.log], [NETFLOW_PORT])
8242 set Bridge br0 netflow=@nf -- \
8243 --id=@nf create NetFlow targets=\"$1:$NETFLOW_PORT\" \
8244 engine_id=1 engine_type=2 active_timeout=30 add-id-to-interface=false
8246 AT_CHECK([ovs-ofctl add-flow br0 action=normal])
8247 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)'])
8248 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)'])
8250 AT_CHECK([filter_flow_install < ovs-vswitchd.log | strip_xout], [0], [dnl
8251 recirc_id(0),in_port(1),packet_type(ns=0,id=0),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>
8252 recirc_id(0),in_port(1),packet_type(ns=0,id=0),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>
8254 OVS_APP_EXIT_AND_WAIT([test-netflow])
8257 AT_SETUP([ofproto-dpif megaflow - netflow - IPv4 collector])
8258 CHECK_MEGAFLOW_NETFLOW([127.0.0.1], [IPv4])
8261 AT_SETUP([ofproto-dpif megaflow - netflow - IPv6 collector])
8262 AT_SKIP_IF([test $HAVE_IPV6 = no])
8263 CHECK_MEGAFLOW_NETFLOW([[[::1]]], [IPv6])
8266 m4_define([OFPROTO_DPIF_MEGAFLOW_NORMAL_ACB_BOND],
8267 [AT_SETUP([ofproto-dpif megaflow - normal, active-backup bonding - $1])
8269 [add-port br0 p1 -- set Interface p1 type=$1 ofport_request=1 -- \
8270 add-bond br0 bond0 p2 p3 bond_mode=active-backup -- \
8271 set interface p2 type=$1 ofport_request=2 -- \
8272 set interface p3 type=$1 ofport_request=3], [], [],
8273 [m4_if([$1], [dummy-pmd], [--dummy-numa="0,0,0,0,1,1,1,1"], [])])
8274 AT_CHECK([ovs-appctl netdev-dummy/set-admin-state up], 0, [OK
8276 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
8278 AT_CHECK([ovs-ofctl add-flow br0 action=normal])
8279 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)'])
8280 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)'])
8282 AT_CHECK([filter_flow_install < ovs-vswitchd.log | strip_xout], [0], [dnl
8283 recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(frag=no), actions: <del>
8284 recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(frag=no), actions: <del>
8289 OFPROTO_DPIF_MEGAFLOW_NORMAL_ACB_BOND([dummy])
8290 OFPROTO_DPIF_MEGAFLOW_NORMAL_ACB_BOND([dummy-pmd])
8292 AT_SETUP([ofproto-dpif megaflow - normal, balance-slb bonding])
8294 [add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1 -- \
8295 add-bond br0 bond0 p2 p3 bond_mode=balance-slb -- \
8296 set interface p2 type=dummy ofport_request=2 -- \
8297 set interface p3 type=dummy ofport_request=3])
8298 AT_CHECK([ovs-appctl netdev-dummy/set-admin-state up], 0, [OK
8300 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
8302 AT_CHECK([ovs-ofctl add-flow br0 action=normal])
8303 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)'])
8304 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)'])
8306 AT_CHECK([filter_flow_install < ovs-vswitchd.log | strip_xout], [0], [dnl
8307 recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(frag=no), actions: <del>
8308 recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(frag=no), actions: <del>
8313 AT_SETUP([ofproto-dpif megaflow - normal, balance-tcp bonding])
8314 # Create bond0 on br0 with interfaces p0 and p1
8315 # and bond1 on br1 with interfaces p2 and p3
8316 # with p0 patched to p2 and p1 patched to p3.
8318 [add-bond br0 bond0 p0 p1 bond_mode=balance-tcp lacp=active \
8319 other-config:lacp-time=fast \
8320 other-config:bond-rebalance-interval=0 -- \
8321 set interface p0 type=patch options:peer=p2 ofport_request=1 -- \
8322 set interface p1 type=patch options:peer=p3 ofport_request=2 -- \
8324 set bridge br1 other-config:hwaddr=aa:66:aa:66:00:00 -- \
8325 set bridge br1 datapath-type=dummy other-config:datapath-id=1234 \
8326 fail-mode=secure -- \
8327 add-bond br1 bond1 p2 p3 bond_mode=balance-tcp lacp=active \
8328 other-config:lacp-time=fast \
8329 other-config:bond-rebalance-interval=0 -- \
8330 set interface p2 type=patch options:peer=p0 ofport_request=3 -- \
8331 set interface p3 type=patch options:peer=p1 ofport_request=4 --])
8333 AT_CHECK([ovs-appctl netdev-dummy/set-admin-state up], 0, [OK
8335 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
8337 AT_CHECK([ovs-ofctl add-flow br0 action=normal])
8338 AT_CHECK([ovs-ofctl add-flow br1 action=normal])
8339 ovs-appctl time/stop
8340 ovs-appctl time/warp 5000
8341 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)'])
8342 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)'])
8344 AT_CHECK([filter_flow_install < ovs-vswitchd.log | strip_xout], [0], [dnl
8345 recirc_id(0),in_port(7),packet_type(ns=0,id=0),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(frag=no), actions: <del>
8346 recirc_id(0),in_port(7),packet_type(ns=0,id=0),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(frag=no), actions: <del>
8351 AT_SETUP([ofproto-dpif megaflow - resubmit port action])
8353 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
8354 add_of_ports br0 1 2
8355 AT_DATA([flows.txt], [dnl
8356 table=0 in_port=1,ip actions=resubmit(90)
8357 table=0 in_port=90,dl_src=50:54:00:00:00:09 actions=output(2)
8359 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
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.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
8361 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)'])
8363 AT_CHECK([filter_flow_install < ovs-vswitchd.log | strip_xout], [0], [dnl
8364 recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth(src=50:54:00:00:00:09),eth_type(0x0800),ipv4(frag=no), actions: <del>
8365 recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth(src=50:54:00:00:00:0b),eth_type(0x0800),ipv4(frag=no), actions: <del>
8370 AT_SETUP([ofproto-dpif megaflow - resubmit table action])
8372 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
8373 add_of_ports br0 1 2
8374 AT_DATA([flows.txt], [dnl
8375 table=0 in_port=1,ip actions=resubmit(,1)
8376 table=1 dl_src=50:54:00:00:00:09 actions=output(2)
8378 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
8379 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)'])
8380 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=
8381 1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
8383 AT_CHECK([filter_flow_install < ovs-vswitchd.log | strip_xout], [0], [dnl
8384 recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth(src=50:54:00:00:00:09),eth_type(0x0800),ipv4(frag=no), actions: <del>
8385 recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth(src=50:54:00:00:00:0b),eth_type(0x0800),ipv4(frag=no), actions: <del>
8390 AT_SETUP([ofproto-dpif megaflow - goto_table action])
8392 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
8393 add_of_ports br0 1 2
8394 AT_DATA([flows.txt], [dnl
8395 table=0 in_port=1,ip actions=goto_table(1)
8396 table=1 dl_src=50:54:00:00:00:09 actions=output(2)
8398 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flows br0 flows.txt])
8399 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)'])
8400 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)'])
8402 AT_CHECK([filter_flow_install < ovs-vswitchd.log | strip_xout], [0], [dnl
8403 recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth(src=50:54:00:00:00:09),eth_type(0x0800),ipv4(frag=no), actions: <del>
8404 recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth(src=50:54:00:00:00:0b),eth_type(0x0800),ipv4(frag=no), actions: <del>
8409 AT_SETUP([ofproto-dpif megaflow - mirroring, select_all])
8410 AT_KEYWORDS([mirror mirrors mirroring])
8412 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
8413 add_of_ports br0 1 2 3
8415 set Bridge br0 mirrors=@m --\
8416 --id=@p3 get Port p3 --\
8417 --id=@m create Mirror name=mymirror select_all=true output_port=@p3
8419 AT_DATA([flows.txt], [dnl
8420 in_port=1 actions=output:2
8422 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
8423 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)'])
8425 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)'])
8427 AT_CHECK([filter_flow_install < ovs-vswitchd.log | strip_xout], [0], [dnl
8428 recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth_type(0x0800),ipv4(frag=no), actions: <del>
8433 AT_SETUP([ofproto-dpif megaflow - mirroring, select_vlan])
8435 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
8436 add_of_ports br0 1 2 3
8438 set Bridge br0 mirrors=@m --\
8439 --id=@p2 get Port p2 -- --id=@p3 get Port p3 --\
8440 --id=@m create Mirror name=mymirror select_all=true select_vlan=11 output_port=@p3
8442 AT_DATA([flows.txt], [dnl
8443 in_port=1 actions=output:2
8445 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
8446 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))'])
8447 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)'])
8449 AT_CHECK([filter_flow_install < ovs-vswitchd.log | strip_xout], [0], [dnl
8450 recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth_type(0x0800),ipv4(frag=no), actions: <del>
8451 recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth_type(0x8100),vlan(vid=11,pcp=7/0x0),encap(eth_type(0x0800),ipv4(frag=no)), actions: <del>
8456 AT_SETUP([ofproto-dpif megaflow - move action])
8458 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
8459 add_of_ports br0 1 2
8460 AT_DATA([flows.txt], [dnl
8461 table=0 in_port=1 ip,actions=move:NXM_OF_IP_SRC[[]]->NXM_NX_REG0[[]],resubmit(90)
8462 table=0 in_port=90 ip,actions=move:NXM_NX_REG0[[]]->NXM_NX_REG1[[]],resubmit(91)
8463 table=0 in_port=91 reg0=0x0a000002,actions=output(2)
8465 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
8466 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)'])
8467 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)'])
8469 AT_CHECK([filter_flow_install < ovs-vswitchd.log | strip_xout], [0], [dnl
8470 recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth_type(0x0800),ipv4(src=10.0.0.2,frag=no), actions: <del>
8471 recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth_type(0x0800),ipv4(src=10.0.0.4,frag=no), actions: <del>
8476 AT_SETUP([ofproto-dpif megaflow - push action])
8478 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
8479 add_of_ports br0 1 2
8480 AT_DATA([flows.txt], [dnl
8481 table=0 in_port=1 ip,actions=push:NXM_OF_IP_SRC[[]],output(2)
8483 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
8484 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)'])
8485 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)'])
8487 AT_CHECK([filter_flow_install < ovs-vswitchd.log | strip_xout], [0], [dnl
8488 recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth_type(0x0800),ipv4(src=10.0.0.2,frag=no), actions: <del>
8489 recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth_type(0x0800),ipv4(src=10.0.0.4,frag=no), actions: <del>
8494 AT_SETUP([ofproto-dpif megaflow - learning])
8496 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
8497 add_of_ports br0 1 2
8498 AT_DATA([flows.txt], [dnl
8499 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
8501 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
8502 ovs-appctl time/stop
8503 # We send each packet twice because the first packet in each flow causes the
8504 # flow table to change and thus revalidations, which (depending on timing)
8505 # can keep a megaflow from being installed. The revalidations are done by
8506 # the second iteration, allowing the flows to be installed.
8508 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)'])
8509 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)'])
8510 ovs-appctl time/warp 100
8513 dnl The original flow is missing due to a revalidation.
8514 AT_CHECK([filter_flow_install < ovs-vswitchd.log | strip_xout], [0], [dnl
8515 recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth(src=50:54:00:00:00:09),eth_type(0x0800),ipv4(frag=no), actions: <del>
8516 recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth(src=50:54:00:00:00:0b),eth_type(0x0800),ipv4(frag=no), actions: <del>
8521 AT_SETUP([ofproto-dpif megaflow - tunnels])
8523 [add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1])
8524 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
8525 AT_CHECK([ovs-vsctl add-port br0 p2 -- set Interface p2 type=gre \
8526 options:remote_ip=1.1.1.1 ofport_request=2 options:key=flow])
8527 AT_CHECK([ovs-vsctl add-port br0 p3 -- set Interface p3 type=dummy \
8529 AT_CHECK([ovs-vsctl add-port br0 p4 -- set Interface p4 type=gre \
8530 options:remote_ip=1.1.1.2 options:tos=inherit options:ttl=inherit \
8531 ofport_request=4 options:key=flow])
8532 AT_DATA([flows.txt], [dnl
8533 in_port=1,actions=output(2)
8534 in_port=3,actions=output(4)
8536 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
8537 dnl ECN bits are always copied out, but don't use 0x3 (CE), since that
8538 dnl will cause the packet to be dropped.
8539 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)'])
8541 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)'])
8542 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)'])
8544 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)'])
8546 AT_CHECK([filter_flow_install < ovs-vswitchd.log | strip_xout], [0], [dnl
8547 recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth_type(0x0800),ipv4(tos=0xfd/0x3,frag=no), actions: <del>
8548 recirc_id(0),in_port(3),packet_type(ns=0,id=0),eth_type(0x0800),ipv4(tos=0x1,ttl=64,frag=no), actions: <del>
8549 recirc_id(0),in_port(3),packet_type(ns=0,id=0),eth_type(0x0800),ipv4(tos=0xfd,ttl=128,frag=no), actions: <del>
8554 AT_SETUP([ofproto-dpif megaflow - dec_ttl])
8556 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
8557 add_of_ports br0 1 2
8558 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], [])
8559 AT_DATA([flows.txt], [dnl
8560 table=0 in_port=1,icmp,nw_src=10.0.0.4 actions=dec_ttl,output(2)
8562 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
8563 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)'])
8564 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)'])
8566 AT_CHECK([filter_flow_install < ovs-vswitchd.log | strip_xout], [0], [dnl
8567 recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth_type(0x0800),ipv4(src=10.0.0.2/255.255.255.252,frag=no), actions: <del>
8568 recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth_type(0x0800),ipv4(src=10.0.0.4,proto=1,ttl=64,frag=no), actions: <del>
8573 AT_SETUP([ofproto-dpif megaflow - set dl_dst])
8575 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
8576 add_of_ports br0 1 2
8577 AT_DATA([flows.txt], [dnl
8578 table=0 in_port=1 actions=mod_dl_dst(50:54:00:00:00:0a),output(2)
8580 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
8581 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)'])
8582 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)'])
8584 dnl The first packet is essentially a no-op, as the new destination MAC is the
8585 dnl same as the original. The second entry actually updates the destination
8587 AT_CHECK([strip_ufid < ovs-vswitchd.log | filter_flow_install | strip_used], [0], [dnl
8588 recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth(dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(frag=no), actions:2
8589 recirc_id(0),in_port(1),packet_type(ns=0,id=0),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
8594 m4_define([OFPROTO_DPIF_MEGAFLOW_DISABLED],
8595 [AT_SETUP([ofproto-dpif megaflow - disabled$1])
8596 OVS_VSWITCHD_START([], [], [], [m4_if([$1], [], [], [--dummy-numa="0,0,0,0,1,1,1,1"])])
8597 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
8598 func=`printf '%s_' "$1" | cut -c 4-`
8599 add_${func}of_ports br0 1 2
8600 AT_DATA([flows.txt], [dnl
8601 table=0 in_port=1,ip,nw_dst=10.0.0.1 actions=output(2)
8602 table=0 in_port=1,ip,nw_dst=10.0.0.3 actions=drop
8604 AT_CHECK([ovs-appctl upcall/disable-megaflows], [0], [megaflows disabled
8606 AT_CHECK([ovs-appctl upcall/disable-ufid], [0], [Datapath dumping tersely using UFID disabled
8608 AT_CHECK([ovs-appctl vlog/set dpif_netdev:dbg], [0], [], [])
8609 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
8610 for i in 1 2 3 4; do
8611 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)'])
8612 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)'])
8613 if [[ $i -eq 1 ]]; then
8618 AT_CHECK([strip_ufid < ovs-vswitchd.log | filter_flow_install | strip_used], [0], [dnl
8619 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),packet_type(ns=0,id=0),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
8620 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),packet_type(ns=0,id=0),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
8622 AT_CHECK([strip_ufid < ovs-vswitchd.log | filter_flow_dump | grep 'packets:3'], [0], [dnl
8623 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),packet_type(ns=0,id=0),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:318, used:0.0s, actions:2
8624 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),packet_type(ns=0,id=0),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:318, used:0.0s, actions:drop
8629 OFPROTO_DPIF_MEGAFLOW_DISABLED([])
8630 OFPROTO_DPIF_MEGAFLOW_DISABLED([ - pmd])
8632 AT_SETUP([ofproto-dpif - datapath port number change])
8633 OVS_VSWITCHD_START([set Bridge br0 fail-mode=standalone])
8636 # Trace a flow that should output to p1.
8637 AT_CHECK([ovs-appctl ofproto/trace br0 in_port=LOCAL,dl_src=10:20:30:40:50:60],
8639 AT_CHECK([tail -1 stdout], [0], [Datapath actions: 1
8642 # Change p1's port number to 5.
8643 AT_CHECK([ovs-appctl dpif-dummy/change-port-number ovs-dummy p1 5])
8645 # Trace a flow that should output to p1 in its new location.
8646 AT_CHECK([ovs-appctl ofproto/trace br0 in_port=LOCAL,dl_src=10:20:30:40:50:60],
8648 AT_CHECK([tail -1 stdout], [0], [Datapath actions: 5
8653 # Tests the bundling with various bfd and cfm configurations.
8654 AT_SETUP([ofproto - bundle with variable bfd/cfm config])
8655 OVS_VSWITCHD_START([add-br br1 -- set bridge br1 datapath-type=dummy -- \
8656 add-bond br0 br0bond p0 p2 bond-mode=active-backup -- \
8657 add-bond br1 br1bond p1 p3 bond-mode=active-backup -- \
8658 set Interface p1 type=patch options:peer=p0 ofport_request=2 -- \
8659 set Interface p3 type=patch options:peer=p2 ofport_request=4 -- \
8660 set Interface p0 type=patch options:peer=p1 ofport_request=1 -- \
8661 set Interface p2 type=patch options:peer=p3 ofport_request=3 -- \
8662 set Interface p0 bfd:enable=true bfd:min_tx=300 bfd:min_rx=300 -- \
8663 set Interface p0 cfm_mpid=1 -- \
8664 set Interface p1 bfd:enable=true bfd:min_tx=500 bfd:min_rx=500])
8666 ovs-appctl time/stop
8667 # advance the clock to stablize everything.
8668 ovs-appctl time/warp 5000 100
8669 # cfm/show should show 'recv' fault.
8670 AT_CHECK([ovs-appctl cfm/show | sed -n '/^.*fault:.*/p'], [0], [dnl
8673 # bfd/show should show 'up'.
8674 AT_CHECK([ovs-appctl bfd/show | sed -n '/^.*Session State:.*/p'], [0], [dnl
8675 Local Session State: up
8676 Remote Session State: up
8677 Local Session State: up
8678 Remote Session State: up
8680 # bond/show should show 'may-enable: true' for all slaves.
8681 AT_CHECK([ovs-appctl bond/show | sed -n '/^.*may_enable:.*/p'], [0], [dnl
8688 # now disable the bfd on p1.
8689 AT_CHECK([ovs-vsctl set Interface p1 bfd:enable=false])
8690 # advance the clock to stablize everything.
8691 ovs-appctl time/warp 5000 100
8692 # cfm/show should show 'recv' fault.
8693 AT_CHECK([ovs-appctl cfm/show | sed -n '/^.*fault:.*/p'], [0], [dnl
8696 # bfd/show should show 'down'.
8697 AT_CHECK([ovs-appctl bfd/show | sed -n '/^.*Session State:.*/p'], [0], [dnl
8698 Local Session State: down
8699 Remote Session State: down
8701 # bond/show should show 'may-enable: false' for p0.
8702 AT_CHECK([ovs-appctl bond/show br0bond | sed -n '/^.*may_enable:.*/p'], [0], [dnl
8707 # now enable the bfd on p1 and disable bfd on p0.
8708 AT_CHECK([ovs-vsctl set Interface p1 bfd:enable=true])
8709 AT_CHECK([ovs-vsctl set Interface p0 bfd:enable=false])
8710 # advance the clock to stablize everything.
8711 ovs-appctl time/warp 5000 100
8712 # cfm/show should show 'recv' fault.
8713 AT_CHECK([ovs-appctl cfm/show | sed -n '/^.*fault:.*/p'], [0], [dnl
8716 # bfd/show should show 'down'.
8717 AT_CHECK([ovs-appctl bfd/show | sed -n '/^.*Session State:.*/p'], [0], [dnl
8718 Local Session State: down
8719 Remote Session State: down
8721 # bond/show should show 'may-enable: false' for p0 and p1.
8722 AT_CHECK([ovs-appctl bond/show | sed -n '/^.*may_enable:.*/p'], [0], [dnl
8732 AT_SETUP([ofproto-dpif - ofproto-dpif-monitor 1])
8733 OVS_VSWITCHD_START([add-port br0 p0 -- set interface p0 type=gre options:remote_ip=1.2.3.4])
8736 AT_CHECK([ovs-vsctl set interface p0 bfd:enable=true])
8738 OVS_WAIT_UNTIL([grep "monitor thread created" ovs-vswitchd.log])
8739 # disable bfd on p0.
8740 AT_CHECK([ovs-vsctl set interface p0 bfd:enable=false])
8742 OVS_WAIT_UNTIL([grep "monitor thread terminated" ovs-vswitchd.log])
8743 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])
8746 AT_CHECK([ovs-vsctl set interface p0 cfm_mpid=10])
8748 OVS_WAIT_UNTIL([grep "monitor thread created" ovs-vswitchd.log])
8749 # disable cfm on p0.
8750 AT_CHECK([ovs-vsctl remove interface p0 cfm_mpid 10])
8752 OVS_WAIT_UNTIL([grep "monitor thread terminated" ovs-vswitchd.log])
8753 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])
8755 # enable both bfd and cfm on p0.
8756 AT_CHECK([ovs-vsctl set interface p0 bfd:enable=true cfm_mpid=10])
8758 OVS_WAIT_UNTIL([grep "monitor thread created" ovs-vswitchd.log])
8759 # disable bfd on p0.
8760 AT_CHECK([ovs-vsctl set interface p0 bfd:enable=false])
8761 # check log, there should not be the log of thread terminated.
8762 AT_CHECK([sed -n "s/^.*|ofproto_dpif_monitor(monitor[[0-9]]*)|INFO|\(.* terminated\)$/\1/p" ovs-vswitchd.log], [0], [dnl
8764 # reenable bfd on p0.
8765 AT_CHECK([ovs-vsctl set interface p0 bfd:enable=true])
8766 # check log, should still be on log of thread created.
8767 AT_CHECK([sed -n "s/^.*|ofproto_dpif_monitor(monitor[[0-9]]*)|INFO|\(.* created\)$/\1/p" ovs-vswitchd.log], [0], [dnl
8768 monitor thread created
8770 # disable bfd and cfm together.
8771 AT_CHECK([ovs-vsctl set interface p0 bfd:enable=false -- remove interface p0 cfm_mpid 10])
8773 OVS_WAIT_UNTIL([grep "monitor thread terminated" ovs-vswitchd.log])
8778 # this test helps avoid the deadlock between the main thread and monitor thread.
8779 AT_SETUP([ofproto-dpif - ofproto-dpif-monitor 2])
8782 for i in `seq 1 199`
8784 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])
8790 AT_BANNER([ofproto-dpif - flow translation resource limits])
8792 dnl Resubmits to later tables do not count against the depth limit, so we
8793 dnl can do 99 of them even though the maximum depth is 64.
8794 AT_SETUP([ofproto-dpif - forward resubmit])
8796 (for i in `seq 0 99`; do
8798 echo "table=$i, actions=resubmit(,$j)"
8800 echo "table=100, actions=local") > flows
8801 AT_CHECK([ovs-ofctl add-flows br0 flows])
8802 AT_CHECK([ovs-appctl -vpoll_loop:off ofproto/trace br0 'eth_dst=ff:ff:ff:ff:ff:ff'],
8804 AT_CHECK([tail -1 stdout], [0], [Datapath actions: 100
8809 dnl Resubmits to the same or an earlier table count against the depth limit,
8810 dnl so only 64 of them are allowed.
8811 AT_SETUP([ofproto-dpif - backward resubmit])
8813 (echo "table=0, actions=resubmit(,66)"
8814 for i in `seq 2 66`; do
8816 echo "table=$i, actions=resubmit(,$j)"
8818 echo "table=1, actions=local") > flows
8819 AT_CHECK([ovs-ofctl add-flows br0 flows])
8820 AT_CHECK([ovs-appctl -vpoll_loop:off ofproto/trace br0 'eth_dst=ff:ff:ff:ff:ff:ff'],
8822 AT_CHECK([tail -1 stdout], [0],
8823 [Translation failed (Recursion too deep), packet is dropped.
8825 AT_CHECK([grep -c 'over max translation depth 64' stdout],
8828 OVS_VSWITCHD_STOP(["/resubmit actions recursed/d"])
8831 AT_SETUP([ofproto-dpif - infinite resubmit])
8833 AT_CHECK([ovs-ofctl add-flow br0 actions=resubmit:1,resubmit:2,output:3])
8834 AT_CHECK([ovs-appctl -vpoll_loop:off ofproto/trace br0 'eth_dst=ff:ff:ff:ff:ff:ff'],
8836 AT_CHECK([tail -1 stdout], [0],
8837 [Translation failed (Recursion too deep), packet is dropped.
8839 AT_CHECK([grep -c 'over max translation depth 64' stdout],
8842 OVS_VSWITCHD_STOP(["/resubmit actions recursed/d"])
8845 dnl Without using ofproto/trace, make sure the
8846 dnl ofproto trace is still logged
8847 AT_SETUP([ofproto-dpif - backward resubmit without trace])
8849 (echo "table=0, actions=resubmit(,66)"
8850 for i in `seq 2 66`; do
8852 echo "table=$i, actions=resubmit(,$j)"
8854 echo "table=1, actions=local") > flows
8855 AT_CHECK([ovs-ofctl add-flows br0 flows])
8857 AT_CHECK([ovs-appctl netdev-dummy/receive br0 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x1234)'], [0], [stdout])
8859 OVS_WAIT_UNTIL([grep 'packet is dropped' ovs-vswitchd.log])
8861 dnl make sure the full ofproto trace dump is present
8862 AT_CHECK([grep -c "^ *resubmit" ovs-vswitchd.log],
8866 OVS_VSWITCHD_STOP(["/over max translation depth/d
8867 /ofproto_dpif_upcall/d"])
8870 AT_SETUP([ofproto-dpif - exponential resubmit chain])
8873 (for i in `seq 1 64`; do
8875 echo "in_port=$i, actions=resubmit:$j, resubmit:$j, local"
8877 echo "in_port=65, actions=local") > flows
8878 AT_CHECK([ovs-ofctl add-flows br0 flows])
8879 AT_CHECK([ovs-appctl -vpoll_loop:off ofproto/trace br0 'in_port=1'], [0], [stdout])
8880 AT_CHECK([tail -1 stdout], [0],
8881 [Translation failed (Too many resubmits), packet is dropped.
8883 AT_CHECK([grep -c 'over 4096 resubmit actions' stdout], [0], [1
8885 OVS_VSWITCHD_STOP(["/over.*resubmit actions/d"])
8888 AT_SETUP([ofproto-dpif - too many output actions])
8891 (for i in `seq 1 12`; do
8893 echo "in_port=$i, actions=resubmit:$j, resubmit:$j, local"
8895 echo "in_port=13, actions=local,local,local,local,local,local,local,local") > flows
8896 AT_CHECK([ovs-ofctl add-flows br0 flows])
8897 AT_CHECK([ovs-appctl -vpoll_loop:off ofproto/trace br0 'in_port=1'], [0], [stdout])
8898 AT_CHECK([grep -c -e '- Uses action(s) not supported by datapath' stdout],
8901 AT_CHECK([grep -c 'resubmits yielded over 64 kB of actions' stdout], [0], [1
8903 OVS_VSWITCHD_STOP(["/resubmits yielded over 64 kB of actions/d"])
8906 AT_SETUP([ofproto-dpif - stack too deep])
8909 (for i in `seq 1 12`; do
8911 echo "in_port=$i, actions=resubmit:$j, resubmit:$j, local"
8913 push="push:NXM_NX_REG0[[]]"
8914 echo "in_port=13, actions=$push,$push,$push,$push,$push,$push,$push,$push") > flows
8915 AT_CHECK([ovs-ofctl add-flows br0 flows])
8916 AT_CHECK([ovs-appctl -vpoll_loop:off ofproto/trace br0 'in_port=1'], [0], [stdout])
8917 AT_CHECK([tail -1 stdout], [0],
8918 [Translation failed (Stack too deep), packet is dropped.
8920 AT_CHECK([grep -c 'resubmits yielded over 64 kB of stack' stdout], [0], [1
8922 OVS_VSWITCHD_STOP(["/resubmits yielded over 64 kB of stack/d"])
8926 AT_SETUP([ofproto-dpif packet-out controller])
8928 add_of_ports br0 1 2
8930 AT_CHECK([ovs-ofctl add-flow br0 'dl_dst=50:54:00:00:00:0a actions=controller'])
8932 AT_CAPTURE_FILE([ofctl_monitor.log])
8933 AT_CHECK([ovs-ofctl monitor br0 65534 invalid_ttl -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
8936 AT_CHECK([ovs-ofctl -O OpenFlow13 packet-out br0 CONTROLLER controller '50540000000a5054000000091234'])
8939 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
8940 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
8941 NXT_PACKET_IN (xid=0x0): total_len=14 in_port=CONTROLLER (via action) data_len=14 (unbuffered)
8942 vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,dl_type=0x1234
8944 NXT_PACKET_IN (xid=0x0): total_len=14 in_port=CONTROLLER (via action) data_len=14 (unbuffered)
8945 vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,dl_type=0x1234
8947 NXT_PACKET_IN (xid=0x0): total_len=14 in_port=CONTROLLER (via action) data_len=14 (unbuffered)
8948 vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,dl_type=0x1234
8951 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
8952 dl_dst=50:54:00:00:00:0a actions=CONTROLLER:65535
8956 AT_CHECK([ovs-ofctl -O OpenFlow13 dump-tables br0], [0],
8957 [OFPST_TABLE reply (OF1.3) (xid=0x2):
8959 active=1, lookup=0, matched=0
8962 active=0, lookup=0, matched=0
8964 tables 2...253: ditto
8970 AT_SETUP([ofproto-dpif packet-out controller (patch port)])
8973 add-port br0 p1 -- \
8974 set interface p1 type=patch options:peer=p2 -- \
8976 set bridge br1 datapath-type=dummy -- \
8977 set bridge br1 fail-mode=secure -- \
8978 set bridge br1 protocols='[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13]' -- \
8979 add-port br1 p2 -- \
8980 set interface p2 type=patch options:peer=p1 --])
8982 AT_CAPTURE_FILE([ofctl_monitor.log])
8983 AT_CHECK([ovs-ofctl monitor br1 65534 invalid_ttl -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
8986 AT_CHECK([ovs-ofctl -O OpenFlow13 packet-out br0 CONTROLLER output:1 '50540000000a5054000000091234'])
8989 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
8990 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
8991 NXT_PACKET_IN (xid=0x0): cookie=0x0 total_len=14 in_port=1 (via no_match) data_len=14 (unbuffered)
8992 vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,dl_type=0x1234
8994 NXT_PACKET_IN (xid=0x0): cookie=0x0 total_len=14 in_port=1 (via no_match) data_len=14 (unbuffered)
8995 vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,dl_type=0x1234
8997 NXT_PACKET_IN (xid=0x0): cookie=0x0 total_len=14 in_port=1 (via no_match) data_len=14 (unbuffered)
8998 vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,dl_type=0x1234
9001 AT_CHECK([ovs-ofctl -O OpenFlow13 dump-tables br0], [0], [dnl
9002 OFPST_TABLE reply (OF1.3) (xid=0x2):
9004 active=0, lookup=0, matched=0
9006 tables 1...253: ditto
9009 AT_CHECK([ovs-ofctl -O OpenFlow13 dump-tables br1], [0], [dnl
9010 OFPST_TABLE reply (OF1.3) (xid=0x2):
9012 active=0, lookup=3, matched=0
9015 active=0, lookup=0, matched=0
9017 tables 2...253: ditto
9023 AT_SETUP([ofproto-dpif packet-out pipeline match field (OpenFlow 1.5)])
9026 AT_CHECK([ovs-ofctl add-tlv-map br0 "{class=0xffff,type=0,len=8}->tun_metadata2"])
9027 AT_CHECK([ovs-ofctl add-tlv-map br0 "{class=0xffff,type=1,len=4}->tun_metadata3"])
9028 AT_DATA([flows.txt], [dnl
9029 table=0,in_port=1 actions=controller
9030 table=0,tun_id=3 actions=controller
9031 table=0,metadata=5 actions=controller
9032 table=0,reg0=1,reg4=2,reg8=3,reg12=5 actions=controller
9033 table=0,tun_src=1.1.1.1,tun_dst=2.2.2.2,tun_gbp_id=0x01,tun_gbp_flags=0x03 actions=controller
9034 table=0,tun_metadata3=0x11 actions=controller
9036 AT_CHECK([ovs-ofctl -O OpenFlow15 add-flows br0 flows.txt])
9038 AT_CHECK([ovs-ofctl -O OpenFlow15 -P standard monitor br0 --detach --no-chdir --pidfile])
9039 ovs-appctl -t ovs-ofctl ofctl/send 0609000c0123456700000080
9040 ovs-appctl -t ovs-ofctl ofctl/barrier
9041 ovs-appctl -t ovs-ofctl ofctl/set-output-file monitor.log
9042 AT_CAPTURE_FILE([monitor.log])
9044 AT_CHECK([ovs-ofctl -O OpenFlow15 packet-out br0 "in_port=1 packet=0001020304050010203040501111 actions=table"])
9045 AT_CHECK([ovs-ofctl -O OpenFlow15 packet-out br0 "in_port=2,tunnel_id=3 packet=0001020304050010203040502222 actions=table"])
9046 AT_CHECK([ovs-ofctl -O OpenFlow15 packet-out br0 "in_port=2,metadata=5 packet=0001020304050010203040503333 actions=table"])
9047 AT_CHECK([ovs-ofctl -O OpenFlow15 packet-out br0 "in_port=2,reg0=1,reg4=2,reg8=3,reg12=5 packet=0001020304050010203040503333 actions=table"])
9048 AT_CHECK([ovs-ofctl -O OpenFlow15 packet-out br0 "in_port=2,tun_src=1.1.1.1,tun_dst=2.2.2.2,tun_gbp_id=0x01,tun_gbp_flags=0x03 packet=0001020304050010203040503333 actions=table"])
9049 AT_CHECK([ovs-ofctl -O OpenFlow15 packet-out br0 "in_port=2,tun_metadata2=0x22,tun_metadata3=0x11 packet=0001020304050010203040503333 actions=table"])
9051 ovs-appctl -t ovs-ofctl ofctl/barrier
9052 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
9054 AT_CHECK([sed 's/ (xid=0x[[0-9a-fA-F]]*)//' monitor.log], [0], [dnl
9055 OFPT_PACKET_IN (OF1.5): cookie=0x0 total_len=14 in_port=1 (via packet_out) data_len=14 (unbuffered)
9056 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x1111
9057 OFPT_PACKET_IN (OF1.5): cookie=0x0 total_len=14 tun_id=0x3,in_port=2 (via packet_out) data_len=14 (unbuffered)
9058 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x2222
9059 OFPT_PACKET_IN (OF1.5): cookie=0x0 total_len=14 metadata=0x5,in_port=2 (via packet_out) data_len=14 (unbuffered)
9060 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x3333
9061 OFPT_PACKET_IN (OF1.5): cookie=0x0 total_len=14 reg0=0x1,reg4=0x2,reg8=0x3,reg12=0x5,in_port=2 (via packet_out) data_len=14 (unbuffered)
9062 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x3333
9063 OFPT_PACKET_IN (OF1.5): cookie=0x0 total_len=14 tun_src=1.1.1.1,tun_dst=2.2.2.2,tun_gbp_id=1,tun_gbp_flags=0x3,in_port=2 (via packet_out) data_len=14 (unbuffered)
9064 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x3333
9065 OFPT_PACKET_IN (OF1.5): cookie=0x0 total_len=14 tun_metadata2=0x22,tun_metadata3=0x11,in_port=2 (via packet_out) data_len=14 (unbuffered)
9066 vlan_tci=0x0000,dl_src=00:10:20:30:40:50,dl_dst=00:01:02:03:04:05,dl_type=0x3333
9067 OFPT_BARRIER_REPLY (OF1.5):
9073 AT_SETUP([ofproto-dpif packet-out goto_table])
9075 add_of_ports br0 1 2
9077 AT_DATA([flows.txt], [dnl
9078 table=0 dl_dst=50:54:00:00:00:0a actions=goto_table(1)
9079 table=1 dl_dst=50:54:00:00:00:0a actions=controller
9081 AT_CHECK([ovs-ofctl -O OpenFlow13 add-flows br0 flows.txt])
9083 AT_CAPTURE_FILE([ofctl_monitor.log])
9084 AT_CHECK([ovs-ofctl monitor br0 65534 invalid_ttl -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
9087 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)'
9090 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
9091 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
9092 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
9093 NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=14 in_port=1 (via action) data_len=14 (unbuffered)
9094 vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,dl_type=0x1234
9096 NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=14 in_port=1 (via action) data_len=14 (unbuffered)
9097 vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,dl_type=0x1234
9099 NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=14 in_port=1 (via action) data_len=14 (unbuffered)
9100 vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,dl_type=0x1234
9103 AT_CHECK([ovs-appctl revalidator/purge], [0])
9104 AT_CHECK([ovs-ofctl -O OpenFlow13 dump-flows br0 | ofctl_strip | sort], [0], [dnl
9105 n_packets=3, n_bytes=42, dl_dst=50:54:00:00:00:0a actions=goto_table:1
9106 table=1, n_packets=3, n_bytes=42, dl_dst=50:54:00:00:00:0a actions=CONTROLLER:65535
9107 OFPST_FLOW reply (OF1.3):
9110 AT_CHECK([ovs-ofctl -O OpenFlow13 dump-tables br0], [0], [dnl
9111 OFPST_TABLE reply (OF1.3) (xid=0x2):
9113 active=1, lookup=3, matched=3
9118 active=0, lookup=0, matched=0
9120 tables 3...253: ditto
9127 AT_SETUP([ofproto-dpif packet-out table-miss (continue)])
9129 add_of_ports br0 1 2
9131 AT_CHECK([ovs-ofctl -O OpenFlow11 add-flow br0 'table=1 dl_dst=50:54:00:00:00:0a actions=controller'])
9132 AT_CHECK([ovs-ofctl -O OpenFlow11 mod-table br0 all continue])
9134 AT_CAPTURE_FILE([ofctl_monitor.log])
9135 AT_CHECK([ovs-ofctl monitor br0 65534 invalid_ttl -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
9138 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)'
9141 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
9142 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
9143 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
9144 NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=14 in_port=1 (via action) data_len=14 (unbuffered)
9145 vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,dl_type=0x1234
9147 NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=14 in_port=1 (via action) data_len=14 (unbuffered)
9148 vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,dl_type=0x1234
9150 NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=14 in_port=1 (via action) data_len=14 (unbuffered)
9151 vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,dl_type=0x1234
9154 AT_CHECK([ovs-appctl revalidator/purge], [0])
9155 AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort], [0], [dnl
9156 table=1, n_packets=3, n_bytes=42, dl_dst=50:54:00:00:00:0a actions=CONTROLLER:65535
9157 OFPST_FLOW reply (OF1.1):
9160 AT_CHECK([ovs-ofctl -O OpenFlow13 dump-tables br0], [0], [dnl
9161 OFPST_TABLE reply (OF1.3) (xid=0x2):
9163 active=0, lookup=3, matched=0
9166 active=1, lookup=3, matched=3
9169 active=0, lookup=0, matched=0
9171 tables 3...253: ditto
9177 AT_SETUP([ofproto-dpif - ICMPv6])
9181 AT_CAPTURE_FILE([ofctl_monitor.log])
9183 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
9185 ovs-appctl netdev-dummy/receive p1 '0060970769ea0000860580da86dd6000000000203afffe80000000000000020086fffe0580dafe80000000000000026097fffe0769ea870068bd00000000fe80000000000000026097fffe0769ea01010000860580da'
9187 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
9189 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
9190 NXT_PACKET_IN (xid=0x0): cookie=0x0 total_len=86 in_port=1 (via no_match) data_len=86 (unbuffered)
9191 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
9197 AT_SETUP([ofproto-dpif - ICMPv6 type match])
9199 add_of_ports br0 1 2 3
9201 AT_CHECK([ovs-ofctl add-flow br0 'icmp6,icmp_type=128,actions=2'])
9202 AT_CHECK([ovs-ofctl add-flow br0 'icmp6,icmp_type=129,actions=3'])
9204 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
9206 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)'])
9207 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)'])
9208 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)'])
9209 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)'])
9211 AT_CHECK([ovs-appctl revalidator/purge], [0])
9213 AT_CHECK([strip_ufid < ovs-vswitchd.log | filter_flow_install | strip_used], [0], [dnl
9214 recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth_type(0x86dd),ipv6(proto=58,frag=no),icmpv6(type=128), actions:2
9215 recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth_type(0x86dd),ipv6(proto=58,frag=no),icmpv6(type=129), actions:3
9218 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
9219 n_packets=2, n_bytes=252, icmp6,icmp_type=128 actions=output:2
9220 n_packets=2, n_bytes=252, icmp6,icmp_type=129 actions=output:3
9227 AT_SETUP([ofproto-dpif - Neighbor Discovery set-field with checksum update])
9230 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])
9232 AT_CAPTURE_FILE([ofctl_monitor.log])
9234 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
9236 ovs-appctl netdev-dummy/receive p1 '0060970769ea0000860580da86dd6000000000203afffe80000000000000020086fffe0580dafe80000000000000026097fffe0769ea870068bd00000000fe80000000000000026097fffe0769ea01010000860580da'
9238 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
9240 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
9241 NXT_PACKET_IN (xid=0x0): cookie=0x0 total_len=86 in_port=1 (via action) data_len=86 (unbuffered)
9242 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
9248 # Tests the exact match of CFI bit in installed datapath flows matching VLAN.
9249 AT_SETUP([ofproto-dpif - vlan matching])
9251 [add-port br0 p0 -- set Interface p0 type=dummy ofport_request=1])
9252 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
9254 AT_CHECK([ovs-ofctl del-flows br0])
9255 AT_CHECK([ovs-ofctl add-flow br0 "vlan_tci=0x000a/0x0fff,action=output:local"])
9257 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))'])
9259 OVS_WAIT_UNTIL([grep flow_add: ovs-vswitchd.log])
9260 AT_CHECK([grep 'in_port([[1]])' ovs-vswitchd.log | filter_flow_install | strip_xout], [0], [dnl
9261 recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth_type(0x8100),vlan(vid=10),encap(eth_type(0x0800),ipv4(frag=no)), actions: <del>
9266 # Tests in place modification of installed datapath flows.
9267 AT_SETUP([ofproto-dpif - in place modification])
9269 [add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1])
9270 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
9272 AT_CHECK([ovs-ofctl del-flows br0])
9273 AT_CHECK([ovs-ofctl add-flow br0 in_port=1,actions=mod_vlan_vid:3,output:local])
9275 ovs-appctl vlog/set PATTERN:ANY:'%c|%p|%m'
9277 ovs-appctl time/stop
9279 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)'])
9281 # Wait for the flow setup to be done.
9282 OVS_WAIT_UNTIL([grep 'flow_add:' ovs-vswitchd.log])
9285 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)'
9288 AT_CHECK([ovs-appctl dpif/dump-flows br0 | strip_ufid | strip_used | sort], [0], [dnl
9289 recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth_type(0x1234), packets:2, bytes:28, used:0.0s, actions:push_vlan(vid=3,pcp=0),100
9292 AT_CHECK([ovs-ofctl add-flow br0 priority=60000,in_port=1,actions=mod_vlan_vid:4,output:local])
9294 ovs-appctl time/warp 500
9295 ovs-appctl time/warp 500
9298 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)'
9301 AT_CHECK([ovs-appctl dpif/dump-flows br0 | strip_ufid | strip_used | sort], [0], [dnl
9302 recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth_type(0x1234), packets:5, bytes:70, used:0.0s, actions:push_vlan(vid=4,pcp=0),100
9305 AT_CHECK([grep 'modify' ovs-vswitchd.log | strip_ufid ], [0], [dnl
9306 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),packet_type(ns=0,id=0),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
9311 # Tests in place modification of installed datapath flows with vlans.
9312 AT_SETUP([ofproto-dpif - in place modification (vlan)])
9314 [add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1])
9315 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
9317 # Always drop misses
9318 AT_CHECK([ovs-ofctl -O OpenFlow11 mod-table br0 all drop])
9319 AT_CHECK([ovs-ofctl add-flow br0 in_port=1,actions=output:local])
9321 ovs-appctl vlog/set PATTERN:ANY:'%c|%p|%m'
9323 ovs-appctl time/stop
9325 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)'])
9327 # Check that a correct datapath flow is created.
9328 OVS_WAIT_UNTIL([grep 'flow_add:' ovs-vswitchd.log])
9331 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)'
9334 AT_CHECK([ovs-appctl dpif/dump-flows br0 | strip_ufid | strip_used | sort], [0], [dnl
9335 recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth_type(0x1234), packets:2, bytes:28, used:0.0s, actions:100
9338 # Delete the flow. Then check that the datapath flow is modified to
9339 # drop the packets. A modified flow inherits the stats, a new
9340 # datapath flow would start from sero.
9341 AT_CHECK([ovs-ofctl del-flows br0])
9343 ovs-appctl time/warp 500
9344 ovs-appctl time/warp 500
9347 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)'
9350 AT_CHECK([ovs-appctl dpif/dump-flows br0 | strip_ufid | strip_used | sort], [0], [dnl
9351 recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth_type(0x1234), packets:5, bytes:70, used:0.0s, actions:drop
9354 # Add a flow that matches the non-presence of a vlan tag, and check
9355 # that the datapath flow is modified accordingly.
9356 AT_CHECK([ovs-ofctl add-flow br0 in_port=1,vlan_tci=0x0000/0x1fff,actions=output:local])
9358 ovs-appctl time/warp 500
9359 ovs-appctl time/warp 500
9362 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)'
9365 AT_CHECK([ovs-appctl dpif/dump-flows br0 | strip_ufid | strip_used | sort], [0], [dnl
9366 recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth_type(0x1234), packets:8, bytes:112, used:0.0s, actions:100
9369 # Check that VLAN packets will not hit the same datapath megaflow.
9371 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))'])
9372 OVS_WAIT_UNTIL([grep 'flow_add:.*vlan(vid=99' ovs-vswitchd.log])
9375 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))'
9378 AT_CHECK([ovs-appctl dpif/dump-flows br0 | strip_ufid | strip_used | sort], [0], [dnl
9379 recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth_type(0x1234), packets:8, bytes:112, used:0.0s, actions:100
9380 recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth_type(0x8100),vlan(vid=99,pcp=7/0x0),encap(eth_type(0x1234)), packets:2, bytes:36, used:0.0s, actions:drop
9383 # Check that the new flow matches the CFI bit, while both vid and pcp
9385 AT_CHECK([grep '\(modify\)\|\(flow_add\)' ovs-vswitchd.log | strip_ufid ], [0], [dnl
9386 dpif_netdev|DBG|flow_add: recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth_type(0x1234), actions:100
9387 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),packet_type(ns=0,id=0),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)
9388 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),packet_type(ns=0,id=0),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
9389 dpif_netdev|DBG|flow_add: recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth_type(0x8100),vlan(vid=99,pcp=7/0x0),encap(eth_type(0x1234)), actions:drop
9394 AT_SETUP([ofproto-dpif - trace (unchanged)])
9396 AT_CHECK([ovs-appctl ofproto/trace br0 'in_port=1'], [0], [stdout])
9397 AT_CHECK([grep "Final flow:" stdout], [0], [Final flow: unchanged
9399 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(100)'], [0], [stdout])
9400 AT_CHECK([grep "Final flow:" stdout], [0], [Final flow: unchanged
9406 AT_SETUP([ofproto-dpif - conntrack - controller])
9409 add_of_ports br0 1 2
9411 AT_CHECK([ovs-appctl vlog/set dpif_netdev:dbg vconn:info ofproto_dpif:info])
9413 dnl Allow new UDP connections on p1 for dst port 2, drop everything else.
9414 AT_DATA([flows.txt], [dnl
9416 dnl Store zone in reg4 and packet direction in reg3 (IN=1, OUT=2).
9418 table=0,priority=100,arp,action=normal
9419 table=0,priority=10,in_port=1,ip,action=set_field:1->reg4,set_field:1->reg3,ct(zone=NXM_NX_REG4[[0..15]],table=1)
9420 table=0,priority=10,in_port=2,ip,action=set_field:1->reg4,set_field:2->reg3,ct(zone=NXM_NX_REG4[[0..15]],table=1)
9421 table=0,priority=1,action=drop
9423 dnl Pass tracked traffic through ACL, drop everything else.
9424 dnl Non-REPLY/RELATED packets get the ACL lookup with the packet headers
9425 dnl in the actual packet direction in reg0 (IN=1, OUT=2). REPLY packets
9426 dnl get the ACL lookup using the conntrack tuple and the inverted direction.
9427 dnl RELATED packets get ACL lookup using the conntrack tuple in the direction
9428 dnl of the master connection, as storted in ct_mark.
9430 dnl Incoming non-related packet in the original direction (ACL IN)
9431 table=1 reg3=1, ip, ct_state=-rel-rpl+trk-inv action=set_field:1->reg0,resubmit(,3),goto_table:5
9432 dnl Incoming non-related reply packet (CT ACL OUT)
9433 table=1 reg3=1, ip, ct_state=-rel+rpl+trk-inv action=set_field:2->reg0,resubmit(,3,ct),goto_table:4
9434 dnl Outgoing non-related packet (ACL OUT)
9435 table=1 reg3=2, ip, ct_state=-rel-rpl+trk-inv action=set_field:2->reg0,resubmit(,3),goto_table:5
9436 dnl Outgoing non-related reply packet (CT ACL IN)
9437 table=1 reg3=2, ip, ct_state=-rel+rpl+trk-inv action=set_field:1->reg0,resubmit(,3,ct),goto_table:4
9439 dnl Related packet (CT ACL in the direction of the master connection.)
9440 table=1 ip, ct_state=+rel+trk-inv, action=move:NXM_NX_CT_MARK[[]]->NXM_NX_REG0[[]],resubmit(,3,ct),goto_table:4
9441 dnl Drop everything else.
9442 table=1 priority=0, action=drop
9446 dnl Stateful accept (1->reg2) all incoming (reg0=1) IP connections with
9447 dnl UDP destination port '2'. Store rule ID (1234) in reg1, verdict
9449 table=3 priority=10, reg0=1, udp, udp_dst=2 action=set_field:1234->reg1,set_field:1->reg2
9450 dnl Stateless drop (0->reg2) everything else in both directions. (Rule ID: 1235)
9451 table=3 priority=0, action=set_field:1235->reg1,set_field:0->reg2
9453 dnl Re-process stateful traffic that was not accepted by a stateful rule as
9454 dnl normal traffic in the current direction. This should also delete the
9455 dnl now stale conntrack state, so that new state can be created in it's place.
9457 dnl Stateful accepts go to next table.
9458 table=4 priority=100 reg2=1, action=goto_table:5
9459 dnl Everything else is reprocessed disregarding the CT state, using the actual
9460 dnl packet direction.
9461 table=4 priority=0 action=move:NXM_NX_REG3[[]]->NXM_NX_REG0[[]],resubmit(,3),goto_table:5
9463 dnl "ACL verdict processing table."
9465 dnl Handle stateful (reg2=1) / stateless (reg2=2) accepts and drops (reg2=0)
9467 dnl Drop all non-accepted packets.
9468 table=5 reg2=0 priority=1000 action=drop
9469 dnl Commit new non-related IP connections.
9470 table=5 priority=10 reg2=1 ct_state=+new-rel, ip, action=ct(zone=NXM_NX_REG4[[0..15]],commit,exec(move:NXM_NX_REG3[[0..31]]->NXM_NX_CT_MARK[[0..31]],move:NXM_NX_REG1[[0..31]]->NXM_NX_CT_LABEL[[96..127]])),goto_table:6
9471 dnl Commit new related connections in either direction, which inherit the mark
9472 dnl (the direction of the original direction master tuple) from the master
9474 table=5 priority=10 reg2=1 ct_state=+new+rel, ip, action=ct(zone=NXM_NX_REG4[[0..15]],commit,exec(move:NXM_NX_REG1[[0..31]]->NXM_NX_CT_LABEL[[96..127]])),goto_table:6
9475 dnl Forward everything else, including stateless accepts.
9476 table=5 priority=0 action=goto_table:6
9478 dnl "Forwarding table"
9480 table=6 action=controller
9483 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
9485 AT_CAPTURE_FILE([ofctl_monitor.log])
9486 AT_CHECK([ovs-ofctl monitor br0 65534 invalid_ttl -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
9488 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)'])
9490 dnl OK, now start a new connection from port 1.
9491 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)'])
9493 dnl Now try a reply from port 2.
9494 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)'])
9496 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 4])
9497 OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
9499 dnl Check this output. We only see the latter two packets, not the first.
9500 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
9501 NXT_PACKET_IN (xid=0x0): table_id=6 cookie=0x0 total_len=106 reg0=0x1,reg1=0x4d2,reg2=0x1,reg3=0x1,reg4=0x1,in_port=1 (via action) data_len=106 (unbuffered)
9502 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:553
9504 NXT_PACKET_IN (xid=0x0): table_id=6 cookie=0x0 total_len=106 ct_state=est|rpl|trk,ct_zone=1,ct_mark=0x1,ct_label=0x4d2000000000000000000000000,ct_nw_src=10.1.1.1,ct_nw_dst=10.1.1.2,ct_nw_proto=17,ct_tp_src=1,ct_tp_dst=2,ip,reg0=0x1,reg1=0x4d2,reg2=0x1,reg3=0x2,reg4=0x1,in_port=2 (via action) data_len=106 (unbuffered)
9505 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:553
9508 AT_CHECK([ovs-ofctl monitor br0 65534 invalid_ttl -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
9510 dnl OK, now start a second connection from port 1
9511 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=2)'])
9513 dnl Now try a reply from port 2.
9514 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=3)'])
9517 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 4])
9518 OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
9520 dnl Check this output. We should see both packets
9521 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
9522 NXT_PACKET_IN (xid=0x0): table_id=6 cookie=0x0 total_len=106 reg0=0x1,reg1=0x4d2,reg2=0x1,reg3=0x1,reg4=0x1,in_port=1 (via action) data_len=106 (unbuffered)
9523 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=2 udp_csum:551
9525 NXT_PACKET_IN (xid=0x0): table_id=6 cookie=0x0 total_len=106 ct_state=est|rpl|trk,ct_zone=1,ct_mark=0x1,ct_label=0x4d2000000000000000000000000,ct_nw_src=10.1.1.1,ct_nw_dst=10.1.1.2,ct_nw_proto=17,ct_tp_src=3,ct_tp_dst=2,ip,reg0=0x1,reg1=0x4d2,reg2=0x1,reg3=0x2,reg4=0x1,in_port=2 (via action) data_len=106 (unbuffered)
9526 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=3 udp_csum:551
9532 AT_SETUP([ofproto-dpif - conntrack - force commit])
9535 add_of_ports br0 1 2
9537 AT_CHECK([ovs-appctl vlog/set dpif_netdev:dbg vconn:info ofproto_dpif:info])
9539 dnl Allow new connections on p1->p2, but not on p2->p1.
9540 AT_DATA([flows.txt], [dnl
9543 table=0,priority=100,arp,action=normal
9544 table=0,priority=10,in_port=1,udp,action=ct(commit),controller
9545 table=0,priority=10,in_port=2,udp,action=ct(table=1)
9546 table=0,priority=1,action=drop
9550 table=1,priority=10,in_port=2,ct_state=+est,udp,action=ct(force,commit),controller
9551 table=1,priority=1,action=drop
9554 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
9556 AT_CAPTURE_FILE([ofctl_monitor.log])
9557 AT_CHECK([ovs-ofctl monitor br0 65534 invalid_ttl -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
9559 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)'])
9561 dnl OK, now start a new connection from port 1.
9562 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)'])
9564 dnl Now try a reply from port 2.
9565 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)'])
9567 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 4])
9568 OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
9570 dnl Check this output. We only see the latter two packets, not the first.
9571 dnl Note that the first packet doesn't have the ct_state bits set. This
9572 dnl happens because the ct_state field is available only after recirc.
9573 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
9574 NXT_PACKET_IN (xid=0x0): cookie=0x0 total_len=106 in_port=1 (via action) data_len=106 (unbuffered)
9575 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:553
9577 NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=106 in_port=2 (via action) data_len=106 (unbuffered)
9578 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:553
9581 AT_CHECK([ovs-ofctl monitor br0 65534 invalid_ttl -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
9583 dnl OK, now start a second connection from port 1
9584 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)'])
9586 dnl Now try a reply from port 2.
9587 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)'])
9589 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 4])
9590 OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
9592 dnl Check this output. We should see both packets
9593 dnl Note that the first packet doesn't have the ct_state bits set. This
9594 dnl happens because the ct_state field is available only after recirc.
9595 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
9596 NXT_PACKET_IN (xid=0x0): cookie=0x0 total_len=106 in_port=1 (via action) data_len=106 (unbuffered)
9597 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:54f
9599 NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=106 in_port=2 (via action) data_len=106 (unbuffered)
9600 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:54f
9604 dnl Check that the directionality has been changed by force commit.
9606 AT_CHECK([ovs-appctl dpctl/dump-conntrack | sort], [], [dnl
9607 udp,orig=(src=10.1.1.2,dst=10.1.1.1,sport=2,dport=1),reply=(src=10.1.1.1,dst=10.1.1.2,sport=1,dport=2)
9608 udp,orig=(src=10.1.1.2,dst=10.1.1.1,sport=4,dport=3),reply=(src=10.1.1.1,dst=10.1.1.2,sport=3,dport=4)
9614 AT_SETUP([ofproto-dpif - conntrack - ipv6])
9617 add_of_ports br0 1 2
9619 AT_CHECK([ovs-appctl vlog/set dpif_netdev:dbg vconn:info ofproto_dpif:info])
9621 dnl Allow new connections on p1->p2, but not on p2->p1.
9622 AT_DATA([flows.txt], [dnl
9625 table=0,priority=100,arp,action=normal
9626 table=0,priority=10,in_port=1,udp6,action=ct(commit,zone=0),controller
9627 table=0,priority=10,in_port=2,udp6,action=ct(table=1,zone=0)
9628 table=0,priority=1,action=drop
9631 table=1,priority=10,in_port=2,ct_state=+trk+est-new,udp6,action=controller
9632 table=1,priority=1,action=drop
9635 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
9637 AT_CAPTURE_FILE([ofctl_monitor.log])
9638 AT_CHECK([ovs-ofctl monitor br0 65534 invalid_ttl -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
9640 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)'])
9642 dnl OK, now start a new connection from port 1.
9643 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)'])
9645 dnl Now try a reply from port 2.
9646 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)'])
9648 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 4])
9649 OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
9651 dnl Check this output. We only see the latter two packets, not the first.
9652 dnl Note that the first packet doesn't have the ct_state bits set. This
9653 dnl happens because the ct_state field is available only after recirc.
9654 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
9655 NXT_PACKET_IN (xid=0x0): cookie=0x0 total_len=126 in_port=1 (via action) data_len=126 (unbuffered)
9656 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:bfe2
9657 NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=126 ct_state=est|rpl|trk,ct_ipv6_src=2001:db8::1,ct_ipv6_dst=2001:db8::2,ct_nw_proto=17,ct_tp_src=1,ct_tp_dst=2,ipv6,in_port=2 (via action) data_len=126 (unbuffered)
9658 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:bfe2
9664 AT_SETUP([ofproto-dpif - conntrack - output action])
9667 add_of_ports br0 1 2
9669 AT_CHECK([ovs-appctl vlog/set dpif_netdev:dbg vconn:info ofproto_dpif:info])
9671 dnl Allow new connections on p1->p2. Allow only established connections p2->p1
9672 AT_DATA([flows.txt], [dnl
9673 dnl The flows are in two separate tables for two reasons:
9674 dnl * To make the pipeline more clear.
9675 dnl * To make megaflows more consistent (we check megaflows below). The
9676 dnl unwildcarding in megaflows depends on the internal ordering of the
9677 dnl subtables, which are sorted using the system qsort(). qsort()
9678 dnl is provided by libc and may or may not be stable, so we can't rely
9679 dnl on that. By having separate tables we have more control over which
9680 dnl subtables are visited, meaning consistent megaflows.
9684 table=0,priority=100,arp,action=normal
9685 table=0,priority=10,in_port=1,udp,action=ct(commit,zone=0),2
9686 table=0,priority=10,in_port=2,udp,action=ct(table=1,zone=0)
9687 table=0,priority=1,action=drop
9691 table=1,priority=10,in_port=2,ct_state=+trk+est-new,udp,action=1
9692 table=1,priority=1,action=drop
9695 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
9698 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)'])
9700 dnl OK, now start a new connection from port 1.
9701 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)'])
9703 dnl Now try a reply from port 2.
9704 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)'])
9706 dnl OK, now start a second connection from port 1
9707 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)'])
9709 dnl Now try a reply from port 2.
9710 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)'])
9713 AT_CHECK([cat ovs-vswitchd.log | strip_ufid | filter_flow_install], [0], [dnl
9714 ct_state(+new-est+trk),recirc_id(0x1),in_port(2),packet_type(ns=0,id=0),eth_type(0x0800),ipv4(frag=no), actions:drop
9715 ct_state(-new+est+trk),recirc_id(0x1),in_port(2),packet_type(ns=0,id=0),eth_type(0x0800),ipv4(proto=17,frag=no), actions:1
9716 recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth_type(0x0800),ipv4(proto=17,frag=no), actions:ct(commit),2
9717 recirc_id(0),in_port(2),packet_type(ns=0,id=0),eth_type(0x0800),ipv4(proto=17,frag=no), actions:ct,recirc(0x1)
9723 AT_SETUP([ofproto-dpif - conntrack - expiration])
9726 add_of_ports br0 1 2
9728 AT_CHECK([ovs-appctl vlog/set dpif_netdev:dbg vconn:info ofproto_dpif:info])
9730 dnl Allow new connections on p1->p2. Allow only established connections p2->p1
9731 AT_DATA([flows.txt], [dnl
9734 table=0,priority=100,arp,action=normal
9735 table=0,priority=10,in_port=1,udp,action=ct(commit,zone=0)
9736 table=0,priority=10,in_port=2,udp,action=ct(table=1,zone=0)
9737 table=0,priority=1,action=drop
9741 table=1,priority=10,in_port=2,ct_state=+trk+est-new,udp,action=controller
9742 table=1,priority=1,action=drop
9745 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
9747 AT_CAPTURE_FILE([ofctl_monitor.log])
9748 AT_CHECK([ovs-ofctl monitor br0 65534 invalid_ttl -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
9750 AT_CHECK([ovs-appctl time/stop])
9752 dnl Start a new connection from port 1.
9753 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)'])
9755 dnl Now try a reply from port 2.
9756 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)'])
9758 ovs-appctl time/warp 100000
9760 dnl Now try another reply from port 2.
9761 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)'])
9763 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 3])
9764 OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
9766 dnl Check this output. Only one reply must be there
9767 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
9768 NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=106 ct_state=est|rpl|trk,ct_nw_src=10.1.1.1,ct_nw_dst=10.1.1.2,ct_nw_proto=17,ct_tp_src=1,ct_tp_dst=2,ip,in_port=2 (via action) data_len=106 (unbuffered)
9769 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:553
9771 OFPT_ECHO_REQUEST (xid=0x0): 0 bytes of payload
9777 AT_SETUP([ofproto-dpif - conntrack - untrackable traffic])
9780 add_of_ports br0 1 2
9782 AT_CHECK([ovs-appctl vlog/set dpif_netdev:dbg vconn:info ofproto_dpif:info])
9784 AT_DATA([flows.txt], [dnl
9785 ipv6,ct_state=-trk,action=ct(table=0,zone=0)
9786 ct_state=+trk,action=controller
9789 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
9791 AT_CAPTURE_FILE([ofctl_monitor.log])
9792 AT_CHECK([ovs-ofctl monitor br0 65534 invalid_ttl -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
9794 AT_CHECK([ovs-appctl time/stop])
9796 AT_CHECK([ovs-appctl netdev-dummy/receive p2 '0060970769ea0000860580da86dd6000000000203afffe80000000000000020086fffe0580dafe80000000000000026097fffe0769ea870068bd00000000fe80000000000000026097fffe0769ea01010000860580da'])
9798 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 1])
9799 OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
9801 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
9802 NXT_PACKET_IN (xid=0x0): cookie=0x0 total_len=86 ct_state=inv|trk,ipv6,in_port=2 (via action) data_len=86 (unbuffered)
9803 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
9809 AT_SETUP([ofproto-dpif - conntrack - zones])
9812 add_of_ports br0 1 2 3 4
9814 AT_CHECK([ovs-appctl vlog/set dpif_netdev:dbg vconn:info ofproto_dpif:info])
9816 dnl Allow new connections on p1->p2 or p3->p4.
9817 dnl Allow only established connections p2->p1 and p4->p3
9818 dnl p1,p2 and p3,p4 are on different zones
9819 AT_DATA([flows.txt], [dnl
9822 table=0,priority=100,arp,action=normal
9823 table=0,priority=10,in_port=1,udp,action=ct(commit,zone=0),controller
9824 table=0,priority=10,in_port=2,udp,action=ct(table=1,zone=0)
9825 table=0,priority=10,in_port=3,udp,action=ct(commit,zone=1),controller
9826 table=0,priority=10,in_port=4,udp,action=ct(table=1,zone=1)
9827 table=0,priority=1,action=drop
9831 table=1,priority=10,in_port=2,ct_state=+trk+est-new,udp,action=controller
9832 table=1,priority=10,in_port=4,ct_state=+trk+est-new,udp,action=controller
9833 table=1,priority=1,action=drop
9836 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
9838 AT_CAPTURE_FILE([ofctl_monitor.log])
9839 AT_CHECK([ovs-ofctl monitor br0 65534 invalid_ttl -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
9841 dnl Basic "only established" test on ports 1,2
9843 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)'])
9844 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)'])
9845 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)'])
9847 dnl Now use the same 5-tuples but on ports 3,4
9849 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)'])
9850 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)'])
9851 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)'])
9853 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 8])
9854 OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
9856 dnl Check this output. We only see the latter two packets (for each zone), not the first.
9857 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
9858 NXT_PACKET_IN (xid=0x0): cookie=0x0 total_len=106 in_port=1 (via action) data_len=106 (unbuffered)
9859 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:553
9861 NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=106 ct_state=est|rpl|trk,ct_nw_src=10.1.1.1,ct_nw_dst=10.1.1.2,ct_nw_proto=17,ct_tp_src=1,ct_tp_dst=2,ip,in_port=2 (via action) data_len=106 (unbuffered)
9862 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:553
9864 NXT_PACKET_IN (xid=0x0): cookie=0x0 total_len=106 in_port=3 (via action) data_len=106 (unbuffered)
9865 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:553
9867 NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=106 ct_state=est|rpl|trk,ct_zone=1,ct_nw_src=10.1.1.1,ct_nw_dst=10.1.1.2,ct_nw_proto=17,ct_tp_src=1,ct_tp_dst=2,ip,in_port=4 (via action) data_len=106 (unbuffered)
9868 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:553
9874 AT_SETUP([ofproto-dpif - conntrack - recirc,commit])
9877 add_of_ports br0 1 2
9879 AT_CHECK([ovs-appctl vlog/set dpif_netdev:dbg vconn:info ofproto_dpif:info])
9881 dnl Allow new connections on p1->p2. Allow only established connections p2->p1
9882 AT_DATA([flows.txt], [dnl
9885 table=0,priority=100,arp,action=normal
9886 table=0,priority=10,udp,action=ct(table=1,zone=0)
9887 table=0,priority=1,action=drop
9891 table=1,priority=10,in_port=1,ct_state=+trk+new,udp,action=ct(commit,zone=0),controller
9892 table=1,priority=10,ct_state=+trk+est,udp,action=controller
9893 table=1,priority=1,action=drop
9896 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
9898 AT_CAPTURE_FILE([ofctl_monitor.log])
9899 AT_CHECK([ovs-ofctl monitor br0 65534 invalid_ttl -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
9901 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)'])
9903 dnl OK, now start a new connection from port 1.
9904 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)'])
9906 dnl Now try a reply from port 2.
9907 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)'])
9909 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 4])
9910 OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
9912 dnl Check this output. We only see the latter two packets, not the first.
9913 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
9914 NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=106 in_port=1 (via action) data_len=106 (unbuffered)
9915 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:553
9917 NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=106 ct_state=est|rpl|trk,ct_nw_src=10.1.1.1,ct_nw_dst=10.1.1.2,ct_nw_proto=17,ct_tp_src=1,ct_tp_dst=2,ip,in_port=2 (via action) data_len=106 (unbuffered)
9918 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:553
9924 AT_SETUP([ofproto-dpif - conntrack - ICMP related])
9927 add_of_ports br0 1 2
9929 dnl Allow any traffic from ns0->ns1. Only allow nd, return traffic from ns1->ns0.
9930 AT_DATA([flows.txt], [dnl
9933 table=0,priority=100,arp,action=normal
9934 table=0,priority=10,ip,in_port=1,udp,action=ct(commit,table=1)
9935 table=0,priority=10,ip,in_port=2,action=ct(table=1)
9936 table=0,priority=1,action=drop
9940 table=1,priority=10,in_port=1,ct_state=+trk,action=controller
9941 table=1,priority=10,in_port=2,ct_state=+trk-inv-new,action=controller
9942 table=1,priority=1,action=drop
9945 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
9947 AT_CAPTURE_FILE([ofctl_monitor.log])
9948 AT_CHECK([ovs-ofctl monitor br0 65534 invalid_ttl -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
9950 dnl 1. Send an ICMP port unreach reply for port 8738, without any previous request
9951 AT_CHECK([ovs-ofctl -O OpenFlow13 packet-out br0 2 ct\(table=1\) 'f64c473528c9c6f54ecb72db080045c0003d2e8700004001f351ac100004ac1000030303553f0000000045000021317040004011b138ac100003ac10000411112222000da5a06369616f0a'])
9953 dnl 2. Send and UDP packet to port 5555
9954 AT_CHECK([ovs-ofctl -O OpenFlow13 packet-out br0 1 ct\(commit,table=1\) 'c6f94ecb72dbe64c473528c9080045000021317040004011b138ac100001ac100002a28e15b3000d20966369616f0a'])
9956 dnl 3. Send an ICMP port unreach reply for port 5555, related to the first packet
9957 AT_CHECK([ovs-ofctl -O OpenFlow13 packet-out br0 2 ct\(table=1\) 'e64c473528c9c6f94ecb72db080045c0003d2e8700004001f355ac100002ac1000010303553f0000000045000021317040004011b138ac100001ac100002a28e15b3000d20966369616f0a'])
9959 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 4])
9960 OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
9962 dnl Check this output. We only see the first and the last packet
9963 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
9964 NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=47 ct_state=new|trk,ct_nw_src=172.16.0.1,ct_nw_dst=172.16.0.2,ct_nw_proto=17,ct_tp_src=41614,ct_tp_dst=5555,ip,in_port=1 (via action) data_len=47 (unbuffered)
9965 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
9967 NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=75 ct_state=rel|rpl|trk,ct_nw_src=172.16.0.1,ct_nw_dst=172.16.0.2,ct_nw_proto=17,ct_tp_src=41614,ct_tp_dst=5555,ip,in_port=2 (via action) data_len=75 (unbuffered)
9968 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
9974 AT_SETUP([ofproto-dpif - conntrack - ct_mark])
9977 add_of_ports br0 1 2
9979 AT_CHECK([ovs-appctl vlog/set dpif_netdev:dbg vconn:info ofproto_dpif:info])
9981 dnl Allow new connections on p1->p2. Allow only established connections p2->p1
9982 AT_DATA([flows.txt], [dnl
9985 table=0,arp,action=normal
9986 table=0,ip,in_port=1,udp,tp_src=1,action=ct(commit,exec(set_field:1->ct_mark)),controller
9987 table=0,ip,in_port=1,udp,tp_src=3,action=ct(commit,exec(set_field:3->ct_mark)),controller
9988 table=0,ip,in_port=1,udp,tp_src=5,action=ct(commit,exec(set_field:5->ct_mark)),controller
9989 table=0,ip,in_port=2,actions=ct(table=1)
9990 table=0,priority=0,action=drop
9994 table=1,priority=100,ct_state=+trk+rpl,ct_mark=0/4,actions=controller
9995 table=1,priority=1,action=drop
9998 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
10000 AT_CAPTURE_FILE([ofctl_monitor.log])
10001 AT_CHECK([ovs-ofctl monitor br0 65534 invalid_ttl -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
10003 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)'])
10004 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)'])
10005 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)'])
10007 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)'])
10008 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)'])
10009 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)'])
10011 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 10])
10012 OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
10014 dnl Check this output.
10015 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
10016 NXT_PACKET_IN (xid=0x0): cookie=0x0 total_len=106 in_port=1 (via action) data_len=106 (unbuffered)
10017 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:553
10019 NXT_PACKET_IN (xid=0x0): cookie=0x0 total_len=106 in_port=1 (via action) data_len=106 (unbuffered)
10020 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:54f
10022 NXT_PACKET_IN (xid=0x0): cookie=0x0 total_len=106 in_port=1 (via action) data_len=106 (unbuffered)
10023 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:54b
10025 NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=106 ct_state=est|rpl|trk,ct_mark=0x1,ct_nw_src=10.1.1.1,ct_nw_dst=10.1.1.2,ct_nw_proto=17,ct_tp_src=1,ct_tp_dst=2,ip,in_port=2 (via action) data_len=106 (unbuffered)
10026 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:553
10028 NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=106 ct_state=est|rpl|trk,ct_mark=0x3,ct_nw_src=10.1.1.1,ct_nw_dst=10.1.1.2,ct_nw_proto=17,ct_tp_src=3,ct_tp_dst=4,ip,in_port=2 (via action) data_len=106 (unbuffered)
10029 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:54f
10035 AT_SETUP([ofproto-dpif - conntrack - ct_label])
10038 add_of_ports br0 1 2
10040 AT_CHECK([ovs-appctl vlog/set dpif_netdev:dbg vconn:info ofproto_dpif:info])
10042 dnl Allow new connections on p1->p2. Allow only established connections p2->p1
10043 AT_DATA([flows.txt], [dnl
10046 table=0,arp,action=normal
10047 table=0,ip,in_port=1,udp,tp_src=1,action=ct(commit,exec(set_field:000000000000000001->ct_label))
10048 table=0,ip,in_port=1,udp,tp_src=3,action=ct(commit,exec(set_field:000000000000000002->ct_label))
10049 table=0,ip,in_port=2,actions=ct(table=1)
10053 table=1,priority=10,ct_state=+trk+rpl,actions=controller
10054 table=1,priority=1,action=drop
10057 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
10059 AT_CAPTURE_FILE([ofctl_monitor.log])
10060 AT_CHECK([ovs-ofctl monitor br0 65534 invalid_ttl -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
10062 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)'])
10063 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)'])
10065 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)'])
10066 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)'])
10068 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 4])
10069 OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
10071 dnl Check this output.
10072 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
10073 NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=106 ct_state=est|rpl|trk,ct_label=0x1,ct_nw_src=10.1.1.1,ct_nw_dst=10.1.1.2,ct_nw_proto=17,ct_tp_src=1,ct_tp_dst=2,ip,in_port=2 (via action) data_len=106 (unbuffered)
10074 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:553
10076 NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=106 ct_state=est|rpl|trk,ct_label=0x2,ct_nw_src=10.1.1.1,ct_nw_dst=10.1.1.2,ct_nw_proto=17,ct_tp_src=3,ct_tp_dst=4,ip,in_port=2 (via action) data_len=106 (unbuffered)
10077 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:54f
10083 AT_SETUP([ofproto-dpif - conntrack - ct_label datapath flow])
10086 add_of_ports br0 1 2
10088 AT_CHECK([ovs-appctl vlog/set dpif_netdev:dbg vconn:info ofproto_dpif:info])
10090 dnl Allow new connections on p1->p2. Allow only established connections p2->p1
10091 AT_DATA([flows.txt], [dnl
10092 dnl The flows are in two separate tables for two reasons:
10093 dnl * To make the pipeline more clear.
10094 dnl * To make megaflows more consistent (we check megaflows below). The
10095 dnl unwildcarding in megaflows depends on the internal ordering of the
10096 dnl subtables, which are sorted using the system qsort(). qsort()
10097 dnl is provided by libc and may or may not be stable, so we can't rely
10098 dnl on that. By having separate tables we have more control over which
10099 dnl subtables are visited, meaning consistent megaflows.
10103 table=0,arp,action=normal
10104 table=0,ip,in_port=1,udp,tp_src=1,action=ct(commit,exec(set_field:1->ct_label)),2
10105 table=0,ip,in_port=2,actions=ct(table=1)
10106 table=0,priority=0,action=drop
10110 table=1,priority=10,ct_state=+trk+rpl,ct_label=0x1,actions=1
10111 table=1,priority=1,action=drop
10114 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
10116 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)'])
10117 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)'])
10119 # Give time for logs to appear.
10120 ovs-appctl revalidator/wait
10122 AT_CHECK([cat ovs-vswitchd.log | strip_ufid | filter_flow_install], [0], [dnl
10123 ct_state(+rpl+trk),ct_label(0x1),recirc_id(0x1),in_port(2),packet_type(ns=0,id=0),eth_type(0x0800),ipv4(frag=no), actions:1
10124 recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth_type(0x0800),ipv4(proto=17,frag=no),udp(src=1), actions:ct(commit,label=0x1),2
10125 recirc_id(0),in_port(2),packet_type(ns=0,id=0),eth_type(0x0800),ipv4(frag=no), actions:ct,recirc(0x1)
10131 AT_SETUP([ofproto-dpif - conntrack - no output])
10136 AT_CHECK([ovs-appctl vlog/set dpif_netdev:dbg vconn:info ofproto_dpif:info])
10138 dnl Allow new connections on p1->p2. Allow only established connections p2->p1
10139 AT_DATA([flows.txt], [dnl
10140 in_port=1,udp,action=ct(commit,zone=0)
10143 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
10145 dnl Start a new connection from port 1.
10146 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)'])
10148 AT_CHECK([cat ovs-vswitchd.log | strip_ufid | filter_flow_install], [0], [dnl
10149 recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth_type(0x0800),ipv4(proto=17,frag=no), actions:ct(commit)
10155 AT_SETUP([ofproto-dpif - conntrack - tcp port reuse])
10158 add_of_ports br0 1 2
10160 AT_CHECK([ovs-appctl vlog/set dpif_netdev:dbg vconn:info ofproto_dpif:info])
10162 dnl Allow new connections on p1->p2. Allow only established connections p2->p1
10163 AT_DATA([flows.txt], [dnl
10166 table=0,priority=100,arp,action=normal
10167 table=0,priority=10,in_port=1,ip,action=ct(commit,table=1)
10168 table=0,priority=10,in_port=2,ip,action=ct(table=1)
10169 table=0,priority=1,action=drop
10173 dnl The following two flows are separated to explicitly count the packets
10174 dnl that create a new connection
10175 table=1,priority=100,cookie=0x1,in_port=1,ip,ct_state=+trk+new-inv-rpl,action=2
10176 table=1,priority=100,in_port=1,ip,ct_state=+trk-new-inv-rpl,action=2
10178 table=1,priority=100,in_port=2,ip,ct_state=+trk+est+rpl-new-inv,action=1
10179 table=1,ip,ct_state=+trk+inv,action=drop
10182 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
10184 AT_CHECK([ovs-appctl netdev-dummy/receive p1 '50540000000a50540000000908004500002ca4e5400040067fe20a0101010a0101020001000259b5d93f0000000060027210dd190000020405b4'])
10185 AT_CHECK([ovs-appctl netdev-dummy/receive p2 '50540000000950540000000a08004500002c00004000400624c80a0101020a010101000200017c35468459b5d940601272101a4f0000020405b4'])
10186 AT_CHECK([ovs-appctl netdev-dummy/receive p1 '50540000000a505400000009080045000028a4e6400040067fe50a0101010a0101020001000259b5d9407c35468550107210320c0000'])
10187 AT_CHECK([ovs-appctl netdev-dummy/receive p2 '50540000000950540000000a0800450000303b5f40004006e9640a0101020a010101000200017c35468559b5d9405018721074c200007061796c6f61640a'])
10188 AT_CHECK([ovs-appctl netdev-dummy/receive p1 '50540000000a505400000009080045000028a4e7400040067fe40a0101010a0101020001000259b5d9407c35468d5010721032040000'])
10189 AT_CHECK([ovs-appctl netdev-dummy/receive p2 '50540000000950540000000a0800450000283b6040004006e96b0a0101020a010101000200017c35468d59b5d9405011721032030000'])
10190 AT_CHECK([ovs-appctl netdev-dummy/receive p1 '50540000000a505400000009080045000028a4e8400040067fe30a0101010a0101020001000259b5d9407c35468e5010721032030000'])
10191 AT_CHECK([ovs-appctl netdev-dummy/receive p1 '50540000000a505400000009080045000028a4e9400040067fe20a0101010a0101020001000259b5d9407c35468e5011721032020000'])
10192 AT_CHECK([ovs-appctl netdev-dummy/receive p2 '50540000000950540000000a0800450000283b6140004006e96a0a0101020a010101000200017c35468e59b5d9415010721032020000'])
10194 AT_CHECK([ovs-appctl revalidator/purge])
10195 AT_CHECK([ovs-ofctl dump-flows br0 | grep cookie=0x1 | grep -o "n_packets=[[0-9]]*"], [0], [dnl
10196 dnl Only one new connection
10200 AT_CHECK([ovs-appctl netdev-dummy/receive p1 '50540000000a50540000000908004500002cc0a74000400664200a0101010a010102000100025b7dbf1f0000000060027210f5710000020405b4'])
10201 AT_CHECK([ovs-appctl netdev-dummy/receive p2 '50540000000950540000000a08004500002c00004000400624c80a0101020a010101000200017c36468f5b7dbf2060127210329b0000020405b4'])
10202 AT_CHECK([ovs-appctl netdev-dummy/receive p1 '50540000000a505400000009080045000028c0a84000400664230a0101010a010102000100025b7dbf207c364690501072104a580000'])
10203 AT_CHECK([ovs-appctl netdev-dummy/receive p2 '50540000000950540000000a080045000030392840004006eb9b0a0101020a010101000200017c3646905b7dbf20501872108d0e00007061796c6f61640a'])
10204 AT_CHECK([ovs-appctl netdev-dummy/receive p1 '50540000000a505400000009080045000028c0a94000400664220a0101010a010102000100025b7dbf207c364698501072104a500000'])
10205 AT_CHECK([ovs-appctl netdev-dummy/receive p2 '50540000000950540000000a080045000028392940004006eba20a0101020a010101000200017c3646985b7dbf20501172104a4f0000'])
10206 AT_CHECK([ovs-appctl netdev-dummy/receive p1 '50540000000a505400000009080045000028c0aa4000400664210a0101010a010102000100025b7dbf207c364699501072104a4f0000'])
10207 AT_CHECK([ovs-appctl netdev-dummy/receive p1 '50540000000a505400000009080045000028c0ab4000400664200a0101010a010102000100025b7dbf207c364699501172104a4e0000'])
10208 AT_CHECK([ovs-appctl netdev-dummy/receive p2 '50540000000950540000000a080045000028392a40004006eba10a0101020a010101000200017c3646995b7dbf21501072104a4e0000'])
10210 AT_CHECK([ovs-appctl revalidator/purge])
10211 AT_CHECK([ovs-ofctl dump-flows br0 | grep cookie=0x1 | grep -o "n_packets=[[0-9]]*"], [0], [dnl
10212 dnl Two new connections
10219 AT_SETUP([ofproto-dpif - conntrack - tcp pick up])
10222 add_of_ports br0 1 2
10224 AT_CHECK([ovs-appctl vlog/set dpif_netdev:dbg vconn:info ofproto_dpif:info])
10226 dnl Allow new connections on p1->p2. Allow only established connections p2->p1
10227 AT_DATA([flows.txt], [dnl
10230 table=0,priority=100,arp,action=normal
10231 table=0,priority=10,in_port=1,tcp,action=ct(commit,table=1)
10232 table=0,priority=10,in_port=2,tcp,action=ct(table=1)
10233 table=0,priority=1,action=drop
10237 table=1,priority=10,cookie=0x1,ip,ct_state=+trk+inv,action=controller
10238 table=1,priority=1,action=drop
10241 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
10243 AT_CHECK([ovs-appctl revalidator/purge])
10244 AT_CHECK([ovs-ofctl dump-flows br0 | grep cookie=0x1 | grep -o "n_packets=[[0-9]]*"], [0], [dnl
10245 dnl No dropped packets
10249 AT_CAPTURE_FILE([ofctl_monitor.log])
10250 AT_CHECK([ovs-ofctl monitor br0 65534 invalid_ttl -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
10252 dnl The first two packets (SYN, SYN|ACK) are commented out. We're making
10253 dnl sure that the connection tracker is able to pick up already established
10254 dnl connections that use window scaling.
10256 dnl AT_CHECK([ovs-appctl netdev-dummy/receive p1 '50540000000950540000000a080045000030fc2540004006289e0a0101020a01010100020001396bb359000000007002008080cc0000020405b401030307'])
10257 dnl AT_CHECK([ovs-appctl netdev-dummy/receive p2 '50540000000a50540000000908004500003000004000400624c40a0101010a010102000100028cadbdb3396bb35a70120080365a0000020405b401030307'])
10258 AT_CHECK([ovs-appctl netdev-dummy/receive p1 '50540000000950540000000a080045000028fc264000400628a50a0101020a01010100020001396bb35a8cadbdb45010000a629b0000'])
10259 AT_CHECK([ovs-appctl netdev-dummy/receive p1 '50540000000950540000000a080045000029fc274000400628a30a0101020a01010100020001396bb35a8cadbdb45018000a589200000a'])
10260 AT_CHECK([ovs-appctl netdev-dummy/receive p2 '50540000000a505400000009080045000028f2c84000400632030a0101010a010102000100028cadbdb4396bb35b5010000a629a0000'])
10261 AT_CHECK([ovs-appctl netdev-dummy/receive p1 '50540000000950540000000a08004500022afc284000400626a10a0101020a01010100020001396bb35b8cadbdb45018000a941f0000 dnl
10262 666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666 dnl
10263 666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666 dnl
10264 666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666 dnl
10265 666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666 dnl
10266 666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666 dnl
10267 666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666 dnl
10268 666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666 dnl
10269 666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666 dnl
10270 666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666 dnl
10271 6666666666666666666666666666666666666666666666666666660a'])
10272 AT_CHECK([ovs-appctl netdev-dummy/receive p2 '50540000000a505400000009080045000028f2c94000400632020a0101010a010102000100028cadbdb4396bb55d5010000a60980000'])
10273 AT_CHECK([ovs-appctl netdev-dummy/receive p2 '50540000000a5054000000090800450001fdf2ca40004006302c0a0101010a010102000100028cadbdb4396bb55d5018000aa60c0000 dnl
10274 656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565 dnl
10275 656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565 dnl
10276 656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565 dnl
10277 656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565 dnl
10278 656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565 dnl
10279 656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565 dnl
10280 656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565 dnl
10281 656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565656565 dnl
10282 6565656565656565656565656565656565656565656565656565656565656565656565650a'])
10283 AT_CHECK([ovs-appctl netdev-dummy/receive p1 '50540000000950540000000a080045000028fc294000400628a20a0101020a01010100020001396bb55d8cadbf895010000a5ec30000'])
10284 AT_CHECK([ovs-appctl netdev-dummy/receive p1 '50540000000950540000000a080045000028fc2a4000400628a10a0101020a01010100020001396bb55d8cadbf895011000a5ec20000'])
10285 AT_CHECK([ovs-appctl netdev-dummy/receive p2 '50540000000a505400000009080045000028f2cb4000400632000a0101010a010102000100028cadbf89396bb55e5010000a5ec20000'])
10286 AT_CHECK([ovs-appctl netdev-dummy/receive p2 '50540000000a505400000009080045000028f2cc4000400631ff0a0101010a010102000100028cadbf89396bb55e5011000a5ec10000'])
10287 AT_CHECK([ovs-appctl netdev-dummy/receive p1 '50540000000950540000000a080045000028258e40004006ff3d0a0101020a01010100020001396bb55e8cadbf8a5010000a5ec10000'])
10289 AT_CHECK([ovs-appctl revalidator/purge])
10291 OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
10293 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
10296 AT_CHECK([ovs-ofctl dump-flows br0 | grep cookie=0x1 | grep -o "n_packets=[[0-9]]*"], [0], [dnl
10297 dnl No dropped packets
10304 dnl This is a truncated version of "ofproto-dpif - conntrack - controller",
10305 dnl with extra send-to-controller actions following ct_clear to show that
10306 dnl the connection tracking data has been cleared.
10307 AT_SETUP([ofproto-dpif - conntrack - ct_clear])
10310 add_of_ports br0 1 2
10312 AT_CHECK([ovs-appctl vlog/set dpif_netdev:dbg vconn:info ofproto_dpif:info])
10314 dnl Allow new connections on p1->p2, but not on p2->p1.
10315 AT_DATA([flows.txt], [dnl
10318 table=0,priority=100,arp,action=normal
10319 table=0,priority=10,in_port=1,udp,action=ct(commit,zone=0),controller,ct_clear,controller
10320 table=0,priority=10,in_port=2,udp,action=ct(table=1,zone=0)
10321 table=0,priority=1,action=drop
10325 table=1,priority=10,in_port=2,ct_state=+trk+est-new,udp,action=controller,ct_clear,controller
10326 table=1,priority=1,action=drop
10329 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
10331 AT_CAPTURE_FILE([ofctl_monitor.log])
10332 AT_CHECK([ovs-ofctl monitor br0 65534 invalid_ttl -P nxt_packet_in --detach --no-chdir --pidfile 2> ofctl_monitor.log])
10334 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)'])
10336 dnl OK, now start a new connection from port 1.
10337 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)'])
10339 dnl Now try a reply from port 2.
10340 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)'])
10342 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 8])
10343 OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
10345 dnl Check this output. We only see the latter two packets, not the first.
10346 dnl Note that the first packet doesn't have the ct_state bits set. This
10347 dnl happens because the ct_state field is available only after recirc.
10348 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
10349 NXT_PACKET_IN (xid=0x0): cookie=0x0 total_len=106 in_port=1 (via action) data_len=106 (unbuffered)
10350 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:553
10352 NXT_PACKET_IN (xid=0x0): cookie=0x0 total_len=106 in_port=1 (via action) data_len=106 (unbuffered)
10353 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:553
10355 NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=106 ct_state=est|rpl|trk,ct_nw_src=10.1.1.1,ct_nw_dst=10.1.1.2,ct_nw_proto=17,ct_tp_src=1,ct_tp_dst=2,ip,in_port=2 (via action) data_len=106 (unbuffered)
10356 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:553
10358 NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=106 in_port=2 (via action) data_len=106 (unbuffered)
10359 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:553
10364 AT_SETUP([ofproto-dpif - conntrack - ofproto/trace])
10367 add_of_ports br0 1 2 3 4
10369 AT_DATA([flows.txt], [dnl
10372 table=0,priority=100,arp,action=normal
10373 table=0,priority=10,udp,action=ct(table=1,zone=0)
10374 table=0,priority=10,tcp,action=ct(table=2,zone=1)
10375 table=0,priority=1,action=drop
10379 table=1,priority=10,in_port=1,ct_zone=0,ct_state=+trk+new,udp,action=ct(commit,zone=0),2
10380 table=1,priority=10,in_port=1,ct_zone=0,ct_state=+trk+est,udp,action=2
10381 table=1,priority=10,in_port=2,ct_zone=0,ct_state=+trk+est,udp,action=1
10382 table=1,priority=1,action=drop
10386 table=2,priority=10,in_port=1,tcp,ct_zone=1,ct_state=+trk+new,tcp,action=ct(commit,zone=1),ct(table=3,zone=2)
10387 table=2,priority=10,in_port=1,tcp,ct_zone=1,ct_state=+trk+est,tcp,action=ct(table=3,zone=2)
10388 table=2,priority=1,action=drop
10392 table=3,priority=10,in_port=1,tcp,ct_zone=2,ct_state=+trk+new,tcp,action=ct(commit,zone=2),4
10393 table=3,priority=10,in_port=1,tcp,ct_zone=2,ct_state=+trk+est,tcp,action=3
10394 table=2,priority=1,action=drop
10397 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
10399 AT_CHECK([ovs-appctl ofproto/trace br0 'in_port=2,udp'], [0], [stdout])
10400 AT_CHECK([tail -1 stdout], [0],
10401 [Datapath actions: drop
10404 AT_CHECK([ovs-appctl ofproto/trace br0 'in_port=1,udp'], [0], [stdout])
10405 AT_CHECK([tail -1 stdout], [0],
10406 [Datapath actions: ct(commit),2
10409 AT_CHECK([ovs-appctl ofproto/trace br0 'in_port=1,tcp'], [0], [stdout])
10410 AT_CHECK([tail -1 stdout], [0],
10411 [Datapath actions: ct(commit,zone=2),4
10414 AT_CHECK([ovs-appctl ofproto/trace br0 'in_port=1,tcp' --ct-next 'trk,est' --ct-next 'trk,est' ], [0], [stdout])
10415 AT_CHECK([tail -1 stdout], [0],
10416 [Datapath actions: 3
10422 AT_SETUP([ofproto - set mtu])
10427 # Check that initial MTU is 1500 for 'br0' and 'p1'.
10428 AT_CHECK([ovs-vsctl get Interface br0 mtu], [0], [dnl
10431 AT_CHECK([ovs-vsctl get Interface p1 mtu], [0], [dnl
10435 # Request new MTU for 'p1'
10436 AT_CHECK([ovs-vsctl set Interface p1 mtu_request=1600])
10438 # Check that the new MTU is applied
10439 AT_CHECK([ovs-vsctl --timeout=10 wait-until Interface p1 mtu=1600])
10440 # The internal port 'br0' should have the same MTU value as p1, becase it's
10441 # the new bridge minimum.
10442 AT_CHECK([ovs-vsctl --timeout=10 wait-until Interface br0 mtu=1600])
10444 AT_CHECK([ovs-vsctl del-port br0 p1])
10446 # When 'p1' is deleted, the internal port should return to the default MTU
10447 AT_CHECK([ovs-vsctl --timeout=10 wait-until Interface br0 mtu=1500])
10449 # New port with 'mtu_request' in the same transaction.
10450 AT_CHECK([ovs-vsctl add-port br0 p2 -- set int p2 type=dummy mtu_request=1600])
10451 AT_CHECK([ovs-vsctl --timeout=10 wait-until Interface p2 mtu=1600])
10452 AT_CHECK([ovs-vsctl --timeout=10 wait-until Interface br0 mtu=1600])
10454 # Explicitly set mtu_request on the internal interface. This should prevent
10455 # the MTU from being overriden.
10456 AT_CHECK([ovs-vsctl set int br0 mtu_request=1700])
10457 AT_CHECK([ovs-vsctl --timeout=10 wait-until Interface br0 mtu=1700])
10459 # The new MTU on p2 should not affect br0.
10460 AT_CHECK([ovs-vsctl set int p2 mtu_request=1400])
10461 AT_CHECK([ovs-vsctl --timeout=10 wait-until Interface p2 mtu=1400])
10462 AT_CHECK([ovs-vsctl --timeout=10 wait-until Interface br0 mtu=1700])
10464 # Remove explicit mtu_request from br0. Now it should track the bridge
10466 AT_CHECK([ovs-vsctl set int br0 mtu_request=[[]]])
10467 AT_CHECK([ovs-vsctl --timeout=10 wait-until Interface br0 mtu=1400])
10472 AT_SETUP([ofproto - fragment prerequisites])
10475 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
10479 AT_DATA([flows.txt], [dnl
10480 priority=10,in_port=1,udp,tp_src=67,tp_dst=68,action=drop
10481 priority=1,in_port=1,udp,action=drop
10484 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
10486 AT_CHECK([ovs-vsctl set Open_vSwitch . other_config:max-idle=10000])
10488 ovs-appctl time/stop
10489 AT_CHECK([ovs-appctl netdev-dummy/receive p1 'recirc_id(0),in_port(1),eth_type(0x0800),ipv4(proto=17,frag=later)'])
10490 ovs-appctl time/warp 5000
10492 AT_CHECK([strip_ufid < ovs-vswitchd.log | filter_flow_install | strip_used], [0], [dnl
10493 recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth_type(0x0800),ipv4(proto=17,frag=later), actions:drop
10496 dnl Change the flow table. This will trigger revalidation of all the flows.
10497 AT_CHECK([ovs-ofctl add-flow br0 priority=5,in_port=1,action=drop])
10498 AT_CHECK([ovs-appctl revalidator/wait], [0])
10500 dnl We don't want revalidators to delete any flow. If the flow has been
10501 dnl deleted it means that there's some inconsistency with the revalidation.
10502 AT_CHECK([grep flow_del ovs-vswitchd.log], [1])