]> git.proxmox.com Git - mirror_ovs.git/blame_incremental - tests/ofproto-dpif.at
openvswitch.spec: Remove dependency with openvswitch-kmod.
[mirror_ovs.git] / tests / ofproto-dpif.at
... / ...
CommitLineData
1AT_BANNER([ofproto-dpif])
2
3AT_SETUP([ofproto-dpif - revalidator/wait])
4OVS_VSWITCHD_START
5AT_CHECK([ovs-appctl revalidator/wait])
6OVS_VSWITCHD_STOP
7AT_CLEANUP
8
9AT_SETUP([ofproto-dpif, active-backup bonding])
10# Create br0 with interfaces p1, p2 and p7, creating bond0 with p1 and p2
11# and br1 with interfaces p3, p4 and p8.
12# toggle p1,p2 of bond0 up and down to test bonding in active-backup mode.
13OVS_VSWITCHD_START(
14 [add-bond br0 bond0 p1 p2 bond_mode=active-backup --\
15 set interface p1 type=dummy options:pstream=punix:$OVS_RUNDIR/p1.sock ofport_request=1 -- \
16 set interface p2 type=dummy options:pstream=punix:$OVS_RUNDIR/p2.sock ofport_request=2 -- \
17 add-port br0 p7 -- set interface p7 ofport_request=7 type=dummy -- \
18 add-br br1 -- \
19 set bridge br1 other-config:hwaddr=aa:66:aa:66:00:00 -- \
20 set bridge br1 datapath-type=dummy other-config:datapath-id=1234 \
21 fail-mode=secure -- \
22 add-port br1 p3 -- set interface p3 type=dummy options:stream=unix:$OVS_RUNDIR/p1.sock ofport_request=3 -- \
23 add-port br1 p4 -- set interface p4 type=dummy options:stream=unix:$OVS_RUNDIR/p2.sock ofport_request=4 -- \
24 add-port br1 p8 -- set interface p8 ofport_request=8 type=dummy --])
25WAIT_FOR_DUMMY_PORTS([p3], [p4])
26AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
27
28AT_CHECK([ovs-ofctl add-flow br0 action=normal])
29AT_CHECK([ovs-ofctl add-flow br1 action=normal])
30ovs-appctl netdev-dummy/set-admin-state up
31ovs-appctl time/warp 100
32ovs-appctl netdev-dummy/set-admin-state p2 down
33ovs-appctl time/stop
34ovs-appctl time/warp 100
35AT_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)'])
36AT_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)'])
37ovs-appctl time/warp 100
38ovs-appctl netdev-dummy/set-admin-state p2 up
39ovs-appctl netdev-dummy/set-admin-state p1 down
40ovs-appctl time/warp 100
41AT_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)'])
42AT_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)'])
43ovs-appctl time/warp 200 100
44sleep 1
45AT_CHECK([cat ovs-vswitchd.log | grep 'in_port=[[348]]' | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl
46recirc_id=0,ip,in_port=3,vlan_tci=0x0000/0x1fff,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,nw_frag=no, actions: <del>
47recirc_id=0,ip,in_port=3,vlan_tci=0x0000/0x1fff,dl_src=50:54:00:00:00:0b,dl_dst=50:54:00:00:00:0c,nw_frag=no, actions: <del>
48recirc_id=0,ip,in_port=4,vlan_tci=0x0000/0x1fff,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0d,nw_frag=no, actions: <del>
49recirc_id=0,ip,in_port=4,vlan_tci=0x0000/0x1fff,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0e,nw_frag=no, actions: <del>
50recirc_id=0,rarp,in_port=4,vlan_tci=0x0000/0x1fff,dl_src=50:54:00:00:00:09,dl_dst=ff:ff:ff:ff:ff:ff, actions: <del>
51recirc_id=0,rarp,in_port=4,vlan_tci=0x0000/0x1fff,dl_src=50:54:00:00:00:0b,dl_dst=ff:ff:ff:ff:ff:ff, actions: <del>
52])
53OVS_VSWITCHD_STOP
54AT_CLEANUP
55
56AT_SETUP([ofproto-dpif, balance-slb bonding])
57# Create br0 with interfaces bond0(p1, p2, p3) and p7,
58# and br1 with interfaces p4, p5, p6 and p8.
59# p1 <-> p4, p2 <-> p5, p3 <-> p6
60# Send some traffic, make sure the traffic are spread based on source mac.
61OVS_VSWITCHD_START(
62 [add-bond br0 bond0 p1 p2 p3 bond_mode=balance-slb --\
63 set interface p1 type=dummy options:pstream=punix:$OVS_RUNDIR/p1.sock ofport_request=1 -- \
64 set interface p2 type=dummy options:pstream=punix:$OVS_RUNDIR/p2.sock ofport_request=2 -- \
65 set interface p3 type=dummy options:pstream=punix:$OVS_RUNDIR/p3.sock ofport_request=3 -- \
66 add-port br0 p7 -- set interface p7 ofport_request=7 type=dummy -- \
67 add-br br1 -- \
68 set bridge br1 other-config:hwaddr=aa:66:aa:66:00:00 -- \
69 set bridge br1 datapath-type=dummy other-config:datapath-id=1234 \
70 fail-mode=secure -- \
71 add-port br1 p4 -- set interface p4 type=dummy options:stream=unix:$OVS_RUNDIR/p1.sock ofport_request=4 -- \
72 add-port br1 p5 -- set interface p5 type=dummy options:stream=unix:$OVS_RUNDIR/p2.sock ofport_request=5 -- \
73 add-port br1 p6 -- set interface p6 type=dummy options:stream=unix:$OVS_RUNDIR/p3.sock ofport_request=6 -- \
74 add-port br1 p8 -- set interface p8 ofport_request=8 type=dummy --])
75WAIT_FOR_DUMMY_PORTS([p4], [p5], [p6])
76AT_CHECK([ovs-ofctl add-flow br0 action=normal])
77AT_CHECK([ovs-ofctl add-flow br1 action=normal])
78AT_CHECK([ovs-appctl netdev-dummy/set-admin-state up], 0, [OK
79])
80ovs-appctl time/stop
81ovs-appctl time/warp 100
82(
83for i in `seq 0 100 |xargs printf '%02x\n'`;
84 do
85 pkt="in_port(7),eth(src=50:54:00:00:00:$i,dst=50:54:00:00:01:00),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)"
86 AT_CHECK([ovs-appctl netdev-dummy/receive p7 $pkt])
87 done
88)
89ovs-appctl time/warp 100
90AT_CHECK([ovs-appctl dpif/dump-flows br1 > br1_flows.txt])
91# Make sure there is resonable distribution to all three ports.
92# We don't want to make this check precise, in case hash function changes.
93AT_CHECK([test `egrep 'in_port\(4\)' br1_flows.txt |wc -l` -gt 3])
94AT_CHECK([test `egrep 'in_port\(5\)' br1_flows.txt |wc -l` -gt 3])
95AT_CHECK([test `egrep 'in_port\(6\)' br1_flows.txt |wc -l` -gt 3])
96OVS_VSWITCHD_STOP
97AT_CLEANUP
98
99AT_SETUP([ofproto-dpif, balance-tcp bonding])
100# Create br0 with interfaces bond0(p1, p2, p3) and p7,
101# and br1 with interfaces bond1(p4, p5, p6) and p8.
102# bond0 <-> bond1
103# Send some traffic, make sure the traffic are spread based on L4 headers.
104OVS_VSWITCHD_START(
105 [add-bond br0 bond0 p1 p2 p3 bond_mode=balance-tcp lacp=active \
106 other-config:lacp-time=fast other-config:bond-rebalance-interval=0 --\
107 set interface p1 type=dummy options:pstream=punix:$OVS_RUNDIR/p1.sock ofport_request=1 -- \
108 set interface p2 type=dummy options:pstream=punix:$OVS_RUNDIR/p2.sock ofport_request=2 -- \
109 set interface p3 type=dummy options:pstream=punix:$OVS_RUNDIR/p3.sock ofport_request=3 -- \
110 add-port br0 p7 -- set interface p7 ofport_request=7 type=dummy -- \
111 add-br br1 -- \
112 set bridge br1 other-config:hwaddr=aa:66:aa:66:00:00 -- \
113 set bridge br1 datapath-type=dummy other-config:datapath-id=1234 \
114 fail-mode=secure -- \
115 add-bond br1 bond1 p4 p5 p6 bond_mode=balance-tcp lacp=active \
116 other-config:lacp-time=fast other-config:bond-rebalance-interval=0 --\
117 set interface p4 type=dummy options:stream=unix:$OVS_RUNDIR/p1.sock ofport_request=4 -- \
118 set interface p5 type=dummy options:stream=unix:$OVS_RUNDIR/p2.sock ofport_request=5 -- \
119 set interface p6 type=dummy options:stream=unix:$OVS_RUNDIR/p3.sock ofport_request=6 -- \
120 add-port br1 p8 -- set interface p8 ofport_request=8 type=dummy --])
121AT_CHECK([ovs-appctl netdev-dummy/set-admin-state up], 0, [OK
122])
123AT_CHECK([ovs-ofctl add-flow br0 action=normal])
124AT_CHECK([ovs-ofctl add-flow br1 action=normal])
125AT_CHECK([ovs-appctl upcall/disable-megaflows], [0], [megaflows disabled
126], [])
127OVS_WAIT_WHILE([ovs-appctl bond/show | grep "may_enable: false"])
128ovs-appctl time/stop
129ovs-appctl time/warp 100
130ovs-appctl lacp/show > lacp.txt
131ovs-appctl bond/show > bond.txt
132(
133for i in `seq 0 255` ;
134 do
135 pkt="in_port(7),eth(src=50:54:00:00:00:05,dst=50:54:00:00:01:00),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=6,tos=0,ttl=64,frag=no),tcp(src=8,dst=$i),tcp_flags(ack)"
136 AT_CHECK([ovs-appctl netdev-dummy/receive p7 $pkt])
137 done
138)
139ovs-appctl time/warp 300 100
140AT_CHECK([ovs-appctl dpif/dump-flows br0 |grep tcp > br0_flows.txt])
141AT_CHECK([ovs-appctl dpif/dump-flows br1 |grep tcp > br1_flows.txt])
142# Make sure there is resonable distribution to all three ports.
143# We don't want to make this check precise, in case hash function changes.
144AT_CHECK([test `grep in_port.4 br1_flows.txt |wc -l` -gt 24])
145AT_CHECK([test `grep in_port.5 br1_flows.txt |wc -l` -gt 24])
146AT_CHECK([test `grep in_port.6 br1_flows.txt |wc -l` -gt 24])
147OVS_VSWITCHD_STOP()
148AT_CLEANUP
149
150AT_SETUP([ofproto-dpif - resubmit])
151OVS_VSWITCHD_START
152ADD_OF_PORTS([br0], [1], [10], [11], [12], [13], [14], [15],
153 [16], [17], [18], [19], [20], [21])
154AT_DATA([flows.txt], [dnl
155table=0 in_port=1 priority=1000 icmp actions=output(10),resubmit(2),output(19),resubmit(3),output(21)
156table=0 in_port=2 priority=1500 icmp actions=output(11),resubmit(,1),output(16),resubmit(2,1),output(18)
157table=0 in_port=3 priority=2000 icmp actions=output(20)
158table=1 in_port=1 priority=1000 icmp actions=output(12),resubmit(4,1),output(13),resubmit(3),output(15)
159table=1 in_port=2 priority=1500 icmp actions=output(17),resubmit(,2)
160table=1 in_port=3 priority=1500 icmp actions=output(14),resubmit(,2)
161])
162AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
163AT_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])
164AT_CHECK([tail -1 stdout], [0],
165 [Datapath actions: 10,11,12,13,14,15,16,17,18,19,20,21
166])
167OVS_VSWITCHD_STOP
168AT_CLEANUP
169
170AT_SETUP([ofproto-dpif - goto table])
171OVS_VSWITCHD_START
172ADD_OF_PORTS([br0], [1], [10], [11])
173echo "table=0 in_port=1 actions=output(10),goto_table(1)" > flows.txt
174for i in `seq 1 63`; do echo "table=$i actions=goto_table($(($i+1)))"; done >> flows.txt
175echo "table=64 actions=output(11)" >> flows.txt
176AT_CHECK([ovs-ofctl -O OpenFlow12 add-flows br0 flows.txt])
177AT_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])
178AT_CHECK([tail -1 stdout], [0],
179 [Datapath actions: 10,11
180])
181OVS_VSWITCHD_STOP
182AT_CLEANUP
183
184AT_SETUP([ofproto-dpif - write actions])
185OVS_VSWITCHD_START
186ADD_OF_PORTS([br0], [1], [10], [11], [12], [13])
187AT_DATA([flows.txt], [dnl
188table=0 in_port=1,ip actions=output(10),write_actions(set_field:192.168.3.90->ip_src,output(12)),goto_table(1)
189table=1 ip actions=write_actions(output(13)),goto_table(2)
190table=2 ip actions=set_field:192.168.3.91->ip_src,output(11)
191])
192AT_CHECK([ovs-ofctl -O OpenFlow12 add-flows br0 flows.txt])
193AT_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])
194AT_CHECK([tail -2 stdout], [0],
195 [Megaflow: recirc_id=0,ip,in_port=1,nw_src=192.168.0.1,nw_frag=no
196Datapath actions: 10,set(ipv4(src=192.168.3.91)),11,set(ipv4(src=192.168.3.90)),13
197])
198OVS_VSWITCHD_STOP
199AT_CLEANUP
200
201AT_SETUP([ofproto-dpif - clear actions])
202OVS_VSWITCHD_START
203ADD_OF_PORTS([br0], [1], [10], [11], [12])
204AT_DATA([flows.txt], [dnl
205table=0 in_port=1,ip actions=output(10),write_actions(set_field:192.168.3.90->ip_src,output(12)),goto_table(1)
206table=1 tcp actions=set_field:91->tp_src,output(11),clear_actions
207])
208AT_CHECK([ovs-ofctl -O OpenFlow12 add-flows br0 flows.txt])
209AT_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])
210AT_CHECK([tail -2 stdout], [0],
211 [Megaflow: recirc_id=0,tcp,in_port=1,nw_frag=no,tp_src=8
212Datapath actions: 10,set(tcp(src=91)),11
213])
214OVS_VSWITCHD_STOP
215AT_CLEANUP
216
217AT_SETUP([ofproto-dpif - group chaining not supported])
218OVS_VSWITCHD_START
219ADD_OF_PORTS([br0], [1], [10], [11])
220AT_CHECK([ovs-ofctl -O OpenFlow12 add-group br0 'group_id=1234,type=all,bucket=output:10,set_field:192.168.3.90->ip_src,group:123,bucket=output:11'],
221 [1], [], [stderr])
222AT_CHECK([STRIP_XIDS stderr | sed 1q], [0],
223 [OFPT_ERROR (OF1.2): OFPGMFC_CHAINING_UNSUPPORTED
224])
225OVS_VSWITCHD_STOP
226AT_CLEANUP
227
228AT_SETUP([ofproto-dpif - all group in action list])
229OVS_VSWITCHD_START
230ADD_OF_PORTS([br0], [1], [10], [11])
231AT_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'])
232AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 'ip actions=group:1234'])
233AT_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])
234# Must match on the source address to be able to restore it's value for
235# the second bucket
236AT_CHECK([tail -2 stdout], [0],
237 [Megaflow: recirc_id=0,ip,in_port=1,nw_src=192.168.0.1,nw_frag=no
238Datapath actions: set(ipv4(src=192.168.3.90)),10,set(ipv4(src=192.168.0.1)),11
239])
240OVS_VSWITCHD_STOP
241AT_CLEANUP
242
243AT_SETUP([ofproto-dpif - indirect group in action list])
244OVS_VSWITCHD_START
245ADD_OF_PORTS([br0], [1], [10])
246AT_CHECK([ovs-ofctl -O OpenFlow12 add-group br0 group_id=1234,type=indirect,bucket=output:10])
247AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 'ip actions=group:1234'])
248AT_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])
249AT_CHECK([tail -1 stdout], [0],
250 [Datapath actions: 10
251])
252OVS_VSWITCHD_STOP
253AT_CLEANUP
254
255AT_SETUP([ofproto-dpif - all group in action set])
256OVS_VSWITCHD_START
257ADD_OF_PORTS([br0], [1], [10], [11])
258AT_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'])
259AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 'ip actions=write_actions(group:1234)'])
260AT_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])
261# Must match on the source address to be able to restore it's value for
262# the third bucket
263AT_CHECK([tail -2 stdout], [0],
264 [Megaflow: recirc_id=0,ip,in_port=1,nw_src=192.168.0.1,nw_frag=no
265Datapath actions: set(ipv4(src=192.168.3.90)),10,set(ipv4(src=192.168.0.1)),11
266])
267OVS_VSWITCHD_STOP
268AT_CLEANUP
269
270AT_SETUP([ofproto-dpif - indirect group in action set])
271OVS_VSWITCHD_START
272ADD_OF_PORTS([br0], [1], [10])
273AT_CHECK([ovs-ofctl -O OpenFlow12 add-group br0 group_id=1234,type=indirect,bucket=output:10])
274AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 'ip actions=write_actions(group:1234)'])
275AT_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])
276AT_CHECK([tail -1 stdout], [0],
277 [Datapath actions: 10
278])
279OVS_VSWITCHD_STOP
280AT_CLEANUP
281
282AT_SETUP([ofproto-dpif - select group])
283OVS_VSWITCHD_START
284ADD_OF_PORTS([br0], [1], [10], [11])
285AT_CHECK([ovs-ofctl -O OpenFlow12 add-group br0 'group_id=1234,type=select,bucket=output:10,bucket=output:11'])
286AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 'ip actions=write_actions(group:1234)'])
287
288# Try a bunch of different flows and make sure that they get distributed
289# at least somewhat.
290for d in 0 1 2 3 4 5 6 7 8 9 a b c d e f; do
291 AT_CHECK([ovs-appctl ofproto/trace br0 "in_port=1,dl_src=50:54:00:00:00:07,dl_dst=50:54:00:00:00:0$d,dl_type=0x0800,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=1,nw_tos=0,nw_ttl=128,icmp_type=8,icmp_code=0"], [0], [stdout])
292 tail -1 stdout >> results
293done
294sort results | uniq -c
295AT_CHECK([sort results | uniq], [0],
296 [Datapath actions: 10
297Datapath actions: 11
298])
299OVS_VSWITCHD_STOP
300AT_CLEANUP
301
302AT_SETUP([ofproto-dpif - select group with watch port])
303OVS_VSWITCHD_START
304ADD_OF_PORTS([br0], [1], [10], [11])
305AT_CHECK([ovs-ofctl -O OpenFlow12 add-group br0 'group_id=1234,type=select,bucket=watch_port:10,output:10,bucket=output:11'])
306AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 'ip actions=write_actions(group:1234)'])
307AT_CHECK([ovs-appctl ofproto/trace br0 'in_port=1,dl_src=50:54:00:00:00:07,dl_dst=50:54:00:00:00:07,dl_type=0x0800,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=1,nw_tos=0,nw_ttl=128,icmp_type=8,icmp_code=0'], [0], [stdout])
308AT_CHECK([tail -1 stdout], [0],
309 [Datapath actions: 11
310])
311OVS_VSWITCHD_STOP
312AT_CLEANUP
313
314AT_SETUP([ofproto-dpif - select group with weight])
315OVS_VSWITCHD_START
316ADD_OF_PORTS([br0], [1], [10], [11], [12])
317AT_CHECK([ovs-ofctl -O OpenFlow12 add-group br0 'group_id=1234,type=select,bucket=output:10,bucket=output:11,weight=2000,bucket=output:12,weight=0'])
318AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 'ip actions=write_actions(group:1234)'])
319AT_CHECK([ovs-appctl ofproto/trace br0 'in_port=1,dl_src=50:54:00:00:00:07,dl_dst=50:54:00:00:00:07,dl_type=0x0800,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=1,nw_tos=0,nw_ttl=128,icmp_type=8,icmp_code=0'], [0], [stdout])
320AT_CHECK([tail -1 stdout], [0],
321 [Datapath actions: 11
322])
323OVS_VSWITCHD_STOP
324AT_CLEANUP
325
326AT_SETUP([ofproto-dpif - fast failover group])
327OVS_VSWITCHD_START
328ADD_OF_PORTS([br0], [1], [10], [11])
329AT_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'])
330AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 'ip actions=write_actions(group:1234)'])
331AT_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])
332AT_CHECK([tail -1 stdout], [0],
333 [Datapath actions: drop
334])
335OVS_VSWITCHD_STOP
336AT_CLEANUP
337
338AT_SETUP([ofproto-dpif - group stats single bucket])
339OVS_VSWITCHD_START
340ADD_OF_PORTS([br0], [1], [10], [11])
341AT_CHECK([ovs-ofctl -O OpenFlow12 add-group br0 'group_id=1234,type=select,bucket=output:10,weight=2000,bucket=output:11,weight=0'])
342AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 'ip actions=write_actions(group:1234)'])
343(
344for i in `seq 0 2`;
345 do
346 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)"
347 AT_CHECK([ovs-appctl netdev-dummy/receive p1 $pkt])
348 done
349)
350ovs-appctl time/warp 100
351ovs-appctl revalidator/wait
352AT_CHECK([ovs-ofctl -O OpenFlow12 -vwarn dump-group-stats br0], [0], [stdout])
353AT_CHECK([STRIP_XIDS stdout | sort], [0], [dnl
354 group_id=1234,ref_count=0,packet_count=3,byte_count=180,bucket0:packet_count=3,byte_count=180,bucket1:packet_count=0,byte_count=0
355OFPST_GROUP reply (OF1.2):
356])
357OVS_VSWITCHD_STOP
358AT_CLEANUP
359
360AT_SETUP([ofproto-dpif - group stats all buckets])
361OVS_VSWITCHD_START
362ADD_OF_PORTS([br0], [1], [10], [11])
363AT_CHECK([ovs-ofctl -O OpenFlow12 add-group br0 'group_id=1234,type=all,bucket=output:10,bucket=output:11'])
364AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 'ip actions=write_actions(group:1234)'])
365(
366for i in `seq 0 2`;
367 do
368 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)"
369 AT_CHECK([ovs-appctl netdev-dummy/receive p1 $pkt])
370 done
371)
372ovs-appctl time/warp 100
373ovs-appctl revalidator/wait
374AT_CHECK([ovs-ofctl -O OpenFlow12 -vwarn dump-group-stats br0], [0], [stdout])
375AT_CHECK([STRIP_XIDS stdout | sort], [0], [dnl
376 group_id=1234,ref_count=0,packet_count=3,byte_count=180,bucket0:packet_count=3,byte_count=180,bucket1:packet_count=3,byte_count=180
377OFPST_GROUP reply (OF1.2):
378])
379OVS_VSWITCHD_STOP
380AT_CLEANUP
381
382AT_SETUP([ofproto-dpif - registers])
383OVS_VSWITCHD_START
384ADD_OF_PORTS([br0], [20], [21], [22], [33], [90])
385AT_DATA([flows.txt], [dnl
386in_port=90 actions=resubmit:2,resubmit:3,resubmit:4,resubmit:91
387in_port=91 actions=resubmit:5,resubmit:6,resubmit:7,resubmit:92
388in_port=92 actions=resubmit:8,resubmit:9,resubmit:10,resubmit:11,resubmit:93
389in_port=93 actions=resubmit:12,resubmit:13,resubmit:14,resubmit:15
390
391in_port=2 actions=load:0x000db000->NXM_NX_REG0[[]]
392in_port=3 actions=load:0xdea->NXM_NX_REG0[[20..31]]
393in_port=4 actions=load:0xeef->NXM_NX_REG0[[0..11]]
394in_port=5 actions=move:NXM_NX_REG0[[]]->NXM_NX_REG1[[]]
395in_port=6 actions=load:0x22222222->NXM_NX_REG2[[]]
396in_port=7 actions=move:NXM_NX_REG1[[20..31]]->NXM_NX_REG2[[0..11]]
397in_port=8 actions=move:NXM_NX_REG1[[0..11]]->NXM_NX_REG2[[20..31]]
398in_port=9,reg0=0xdeadbeef actions=output:20
399in_port=10,reg1=0xdeadbeef actions=output:21
400in_port=11,reg2=0xeef22dea actions=output:22
401
402dnl Sanilty check all registers
403in_port=12 actions=load:0x10->NXM_NX_REG0[[]],load:0x11->NXM_NX_REG1[[]],load:0x12->NXM_NX_REG2[[]]
404in_port=13 actions=load:0x13->NXM_NX_REG3[[]],load:0x14->NXM_NX_REG4[[]],load:0x15->NXM_NX_REG5[[]]
405in_port=14 actions=load:0x16->NXM_NX_REG6[[]],load:0x17->NXM_NX_REG7[[]]
406in_port=15,reg0=0x10,reg1=0x11,reg2=0x12,reg3=0x13,reg4=0x14,reg5=0x15,reg6=0x16,reg7=0x17 actions=output:33
407
408])
409AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
410AT_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])
411AT_CHECK([tail -1 stdout], [0],
412 [Datapath actions: 20,21,22,33
413])
414OVS_VSWITCHD_STOP
415AT_CLEANUP
416
417dnl Tests that the standardized xregs are mapped onto the legacy OVS registers
418dnl in the manner documented in ovs-ofctl(8).
419AT_SETUP([ofproto-dpif - extended registers])
420OVS_VSWITCHD_START
421ADD_OF_PORTS([br0], [1], [2], [3])
422AT_DATA([flows.txt], [dnl
423table=0 actions=load:0xfedcba9876543210->OXM_OF_PKT_REG1[[]],resubmit(,1)
424table=1,reg2=0xfedcba98,reg3=0x76543210 actions=2
425
426# These low-priority rules shouldn't match. They're here only to make really
427# sure that the test fails if either of the above rules fails to match.
428table=0,priority=0 actions=3
429table=1,priority=0 actions=3
430])
431AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
432AT_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])
433AT_CHECK([tail -1 stdout], [0], [Datapath actions: 2
434])
435OVS_VSWITCHD_STOP
436AT_CLEANUP
437
438AT_SETUP([ofproto-dpif - load and move order])
439OVS_VSWITCHD_START
440ADD_OF_PORTS([br0], [1], [10], [11])
441AT_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'])
442AT_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)'])
443AT_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])
444AT_CHECK([tail -2 stdout], [0],
445 [Megaflow: recirc_id=0,ip,in_port=1,nw_src=192.168.0.1,nw_frag=no
446Datapath actions: set(ipv4(src=255.255.255.255)),10,set(ipv4(src=192.168.0.1)),11
447])
448OVS_VSWITCHD_STOP
449AT_CLEANUP
450
451dnl Tests that 1.5 copy-field can copy into the standardized xregs.
452AT_SETUP([ofproto-dpif - copy-field into extended registers])
453OVS_VSWITCHD_START
454ADD_OF_PORTS([br0], [1], [2], [3])
455AT_DATA([flows.txt], [dnl
456table=0 actions=move:OXM_OF_ETH_SRC[[0..47]]->OXM_OF_PKT_REG0[[0..47]],goto_table(1)
457table=1,xreg0=0x0000505400000005 actions=2
458
459# These low-priority rules shouldn't match. They're here only to make really
460# sure that the test fails if either of the above rules fails to match.
461table=0,priority=0 actions=3
462table=1,priority=0 actions=3
463])
464AT_CHECK([ovs-ofctl -O OpenFlow15 add-flows br0 flows.txt])
465AT_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])
466AT_CHECK([tail -1 stdout], [0], [Datapath actions: 2
467])
468OVS_VSWITCHD_STOP
469AT_CLEANUP
470
471AT_SETUP([ofproto-dpif - push-pop])
472OVS_VSWITCHD_START
473ADD_OF_PORTS([br0], [20], [21], [22], [33], [90])
474AT_DATA([flows.txt], [dnl
475in_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
476in_port=2 actions=pop:NXM_NX_REG0[[0..7]],output:NXM_NX_REG0[[]]
477in_port=3 actions=pop:NXM_NX_REG1[[0..7]],output:NXM_NX_REG1[[]]
478in_port=4 actions=pop:NXM_NX_REG2[[0..15]],output:NXM_NX_REG2[[]]
479in_port=5 actions=pop:NXM_NX_REG3[[]],output:NXM_NX_REG3[[]]
480
481])
482AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
483AT_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])
484AT_CHECK([tail -1 stdout], [0],
485 [Datapath actions: 33,22,21,20
486])
487OVS_VSWITCHD_STOP
488AT_CLEANUP
489
490AT_SETUP([ofproto-dpif - output])
491OVS_VSWITCHD_START
492ADD_OF_PORTS([br0], [1], [9], [10], [11], [55], [66], [77], [88])
493AT_DATA([flows.txt], [dnl
494in_port=1 actions=resubmit:2,resubmit:3,resubmit:4,resubmit:5,resubmit:6,resubmit:7,resubmit:8
495in_port=2 actions=output:9
496in_port=3 actions=load:55->NXM_NX_REG0[[]],output:NXM_NX_REG0[[]],load:66->NXM_NX_REG1[[]]
497in_port=4 actions=output:10,output:NXM_NX_REG0[[]],output:NXM_NX_REG1[[]],output:11
498in_port=5 actions=load:77->NXM_NX_REG0[[0..15]],load:88->NXM_NX_REG0[[16..31]]
499in_port=6 actions=output:NXM_NX_REG0[[0..15]],output:NXM_NX_REG0[[16..31]]
500in_port=7 actions=load:0x110000ff->NXM_NX_REG0[[]],output:NXM_NX_REG0[[]]
501in_port=8 actions=1,9,load:9->NXM_OF_IN_PORT[[]],1,9
502])
503AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
504AT_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])
505AT_CHECK([tail -1 stdout], [0],
506 [Datapath actions: 9,55,10,55,66,11,77,88,9,1
507])
508OVS_VSWITCHD_STOP
509AT_CLEANUP
510
511AT_SETUP([ofproto-dpif - dec_ttl])
512OVS_VSWITCHD_START
513ADD_OF_PORTS([br0], [1], [2], [3], [4])
514AT_DATA([flows.txt], [dnl
515table=0 in_port=1 action=dec_ttl,output:2,resubmit(1,1),output:4
516table=1 in_port=1 action=dec_ttl,output:3
517])
518AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
519AT_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])
520AT_CHECK([tail -4 stdout], [0],
521 [Megaflow: recirc_id=0,ip,in_port=1,nw_ttl=2,nw_frag=no
522Datapath actions: set(ipv4(ttl=1)),2,4
523This flow is handled by the userspace slow path because it:
524 - Sends "packet-in" messages to the OpenFlow controller.
525])
526AT_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])
527AT_CHECK([tail -2 stdout], [0],
528 [Megaflow: recirc_id=0,ip,in_port=1,nw_ttl=3,nw_frag=no
529Datapath actions: set(ipv4(ttl=2)),2,set(ipv4(ttl=1)),3,4
530])
531AT_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])
532AT_CHECK([tail -2 stdout], [0],
533 [Megaflow: recirc_id=0,ipv6,in_port=1,nw_ttl=128,nw_frag=no
534Datapath actions: set(ipv6(hlimit=127)),2,set(ipv6(hlimit=126)),3,4
535])
536
537AT_CAPTURE_FILE([ofctl_monitor.log])
538AT_CHECK([ovs-ofctl monitor br0 65534 invalid_ttl --detach --no-chdir --pidfile 2> ofctl_monitor.log])
539AT_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])
540OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
541AT_CHECK([cat ofctl_monitor.log], [0], [dnl
542NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=34 in_port=1 (via invalid_ttl) data_len=34 (unbuffered)
543ip,metadata=0,in_port=0,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
544])
545OVS_VSWITCHD_STOP
546AT_CLEANUP
547
548dnl A dec_ttl action at offset 32 in ofpacts will cause the ofpacts
549dnl buffer to be resized just before pushing the id of the dec_ttl action.
550dnl Thus the implementation must account for this by using the
551dnl reallocated buffer rather than the original buffer.
552dnl
553dnl A number of similar rules are added to try and exercise
554dnl xrealloc sufficiently that it returns a different base pointer
555AT_SETUP([ofproto-dpif - dec_ttl without arguments at offset 32 in ofpacts])
556OVS_VSWITCHD_START
557ADD_OF_PORTS([br0], [1])
558(for i in `seq 0 255`; do
559 printf "dl_src=10:11:11:11:11:%02x actions=output:1,output:1,output:1,dec_ttl,controller\n" $i
560 done) > flows.txt
561AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
562OVS_VSWITCHD_STOP
563AT_CLEANUP
564
565dnl A dec_ttl action at offset 32 in ofpacts will cause the ofpacts
566dnl buffer to be resized just before pushing the id of the dec_ttl action.
567dnl Thus the implementation must account for this by using the
568dnl reallocated buffer rather than the original buffer.
569dnl
570dnl A number of similar rules are added to try and exercise
571dnl xrealloc sufficiently that it returns a different base pointer
572AT_SETUP([ofproto-dpif - dec_ttl with arguments at offset 32 in ofpacts])
573OVS_VSWITCHD_START
574ADD_OF_PORTS([br0], [1])
575(for i in `seq 0 255`; do
576 printf "dl_src=10:11:11:11:11:%02x actions=output:1,output:1,output:1,dec_ttl(1),controller\n" $i
577 done) > flows.txt
578AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
579OVS_VSWITCHD_STOP
580AT_CLEANUP
581
582dnl A note action at offset 24 in ofpacts will cause the ofpacts
583dnl buffer to be resized just before pushing the id of the dec_ttl action.
584dnl Thus the implementation must account for this by using the
585dnl reallocated buffer rather than the original buffer.
586dnl
587dnl A number of similar rules are added to try and exercise
588dnl xrealloc sufficiently that it returns a different base pointer
589AT_SETUP([ofproto-dpif - note at offset 24 in ofpacts])
590OVS_VSWITCHD_START
591ADD_OF_PORTS([br0], [1])
592(for i in `seq 0 255`; do
593 printf "dl_src=10:11:11:11:11:%02x actions=output:1,output:1,note:ff,controller\n" $i
594 done) > flows.txt
595AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
596OVS_VSWITCHD_STOP
597AT_CLEANUP
598
599AT_SETUP([ofproto-dpif - output, OFPP_NONE ingress port])
600OVS_VSWITCHD_START
601ADD_OF_PORTS([br0], [1], [2])
602
603AT_CHECK([ovs-ofctl add-flow br0 action=normal])
604
605# "in_port" defaults to OFPP_NONE if it's not specified.
606flow="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"
607AT_CHECK([ovs-appctl ofproto/trace br0 "$flow"], [0], [stdout])
608AT_CHECK([tail -1 stdout | sed 's/Datapath actions: //' | tr "," "\n" | sort -n], [0], [dnl
6091
6102
611100
612])
613
614OVS_VSWITCHD_STOP
615AT_CLEANUP
616
617AT_SETUP([ofproto-dpif - DSCP])
618OVS_VSWITCHD_START([add-port br0 p1 -- set Interface p1 type=dummy])
619ADD_OF_PORTS([br0], [9])
620AT_DATA([flows.txt], [dnl
621actions=output:LOCAL,enqueue:1:1,enqueue:1:2,enqueue:1:2,enqueue:1:1,output:1,mod_nw_tos:0,output:1,output:LOCAL
622])
623AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
624AT_CHECK([ovs-vsctl -- \
625 set Port p1 qos=@newqos --\
626 --id=@newqos create QoS type=linux-htb queues=1=@q1,2=@q2 --\
627 --id=@q1 create Queue dscp=1 --\
628 --id=@q2 create Queue dscp=2], [0], [ignore])
629AT_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])
630AT_CHECK([tail -2 stdout], [0],
631 [Megaflow: recirc_id=0,skb_priority=0,ip,in_port=9,nw_tos=252,nw_frag=no
632Datapath actions: dnl
633100,dnl
634set(ipv4(tos=0x4/0xfc)),set(skb_priority(0x1)),1,dnl
635set(ipv4(tos=0x8/0xfc)),set(skb_priority(0x2)),1,dnl
6361,dnl
637set(ipv4(tos=0x4/0xfc)),set(skb_priority(0x1)),1,dnl
638set(ipv4(tos=0xfc/0xfc)),set(skb_priority(0)),1,dnl
639set(ipv4(tos=0/0xfc)),1,100
640])
641OVS_VSWITCHD_STOP
642AT_CLEANUP
643
644AT_SETUP([ofproto-dpif - output/flood flags])
645OVS_VSWITCHD_START
646ADD_OF_PORTS([br0], [1], [2], [3], [4], [5], [6], [7])
647
648AT_DATA([flows.txt], [dnl
649in_port=local actions=local,flood
650in_port=1 actions=flood
651in_port=2 actions=all
652in_port=3 actions=output:LOCAL,output:1,output:2,output:3,output:4,output:5,output:6,output:7
653in_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
654])
655AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
656AT_CHECK([ovs-ofctl mod-port br0 5 noforward])
657AT_CHECK([ovs-ofctl mod-port br0 6 noflood])
658
659AT_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])
660AT_CHECK([tail -1 stdout \
661| sed -e 's/Datapath actions: //' | tr ',' '\n' | sort], [0], [dnl
6621
6632
6643
6654
6667
667])
668
669AT_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])
670AT_CHECK([tail -1 stdout \
671| sed -e 's/Datapath actions: //' | tr ',' '\n' | sort], [0], [dnl
672100
6732
6743
6754
6767
677])
678
679AT_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])
680AT_CHECK([tail -1 stdout \
681| sed -e 's/Datapath actions: //' | tr ',' '\n' | sort], [0], [dnl
6821
683100
6843
6854
6866
6877
688])
689
690AT_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])
691AT_CHECK([tail -1 stdout], [0],
692 [Datapath actions: 100,1,2,4,6,7
693])
694
695AT_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])
696AT_CHECK([tail -1 stdout], [0],
697 [Datapath actions: set(skb_priority(0x1)),100,1,2,set(skb_priority(0x2)),3,set(skb_priority(0x1)),6,7
698])
699OVS_VSWITCHD_STOP
700AT_CLEANUP
701
702AT_SETUP([ofproto-dpif - Default Table Miss - OF1.0 (OFPTC_TABLE_MISS_CONTROLLER)])
703OVS_VSWITCHD_START([dnl
704 add-port br0 p1 -- set Interface p1 type=dummy
705])
706ON_EXIT([kill `cat ovs-ofctl.pid`])
707
708AT_CAPTURE_FILE([ofctl_monitor.log])
709
710AT_CHECK([ovs-ofctl monitor br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
711
712for i in 1 2 3 ; do
713 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)'
714done
715OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
716OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
717AT_CHECK([cat ofctl_monitor.log], [0], [dnl
718NXT_PACKET_IN (xid=0x0): cookie=0x0 total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
719tcp,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=syn tcp_csum:0
720dnl
721NXT_PACKET_IN (xid=0x0): cookie=0x0 total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
722tcp,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=syn tcp_csum:0
723dnl
724NXT_PACKET_IN (xid=0x0): cookie=0x0 total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
725tcp,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=syn tcp_csum:0
726])
727
728AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
729AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
730NXST_FLOW reply:
731])
732
733OVS_VSWITCHD_STOP
734AT_CLEANUP
735
736AT_SETUP([ofproto-dpif - Default Table Miss - OF1.3 (OFPTC_TABLE_MISS_DROP)])
737OVS_VSWITCHD_START([dnl
738 add-port br0 p1 -- set Interface p1 type=dummy
739])
740ON_EXIT([kill `cat ovs-ofctl.pid`])
741
742AT_CAPTURE_FILE([ofctl_monitor.log])
743AT_CHECK([ovs-ofctl del-flows br0])
744
745AT_CHECK([ovs-ofctl monitor -OOpenFlow13 -P openflow10 br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
746
747dnl Test that missed packets are droped
748for i in 1 2 3 ; do
749 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)'
750done
751OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
752
753AT_CHECK([cat ofctl_monitor.log], [0], [dnl
754])
755
756AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
757AT_CHECK([ovs-ofctl -OOpenFlow13 dump-flows br0 | ofctl_strip | sort], [0], [dnl
758OFPST_FLOW reply (OF1.3):
759])
760
761OVS_VSWITCHD_STOP
762AT_CLEANUP
763
764AT_SETUP([ofproto-dpif - Table Miss - goto table and OFPTC_TABLE_MISS_CONTROLLER])
765OVS_VSWITCHD_START([dnl
766 add-port br0 p1 -- set Interface p1 type=dummy
767])
768ON_EXIT([kill `cat ovs-ofctl.pid`])
769
770AT_CAPTURE_FILE([ofctl_monitor.log])
771AT_CHECK([ovs-ofctl -OOpenFlow12 add-flow br0 'table=0 actions=goto_table(1)'])
772
773AT_CHECK([ovs-ofctl monitor -P openflow10 br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
774
775for i in 1 2 3 ; do
776 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)'
777done
778OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
779OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
780AT_CHECK([cat ofctl_monitor.log], [0], [dnl
781OFPT_PACKET_IN (xid=0x0): total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
782tcp,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=rst|urg tcp_csum:0
783dnl
784OFPT_PACKET_IN (xid=0x0): total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
785tcp,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=rst|urg tcp_csum:0
786dnl
787OFPT_PACKET_IN (xid=0x0): total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
788tcp,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=rst|urg tcp_csum:0
789])
790
791AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
792ovs-appctl revalidator/wait
793AT_CHECK([ovs-ofctl -OOpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
794 n_packets=3, n_bytes=180, actions=goto_table:1
795OFPST_FLOW reply (OF1.2):
796])
797
798OVS_VSWITCHD_STOP
799AT_CLEANUP
800
801AT_SETUP([ofproto-dpif - Table Miss - resubmit and OFPTC_TABLE_MISS_CONTROLLER])
802OVS_VSWITCHD_START([dnl
803 add-port br0 p1 -- set Interface p1 type=dummy
804])
805ON_EXIT([kill `cat ovs-ofctl.pid`])
806
807AT_CAPTURE_FILE([ofctl_monitor.log])
808AT_CHECK([ovs-ofctl -OOpenFlow12 add-flow br0 'table=0 actions=resubmit(1,1)'])
809
810AT_CHECK([ovs-ofctl monitor -P openflow10 br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
811
812for i in 1 2 3 ; do
813 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)'
814done
815
816OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
817AT_CHECK([cat ofctl_monitor.log], [0], [dnl
818])
819
820AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
821ovs-appctl revalidator/wait
822AT_CHECK([ovs-ofctl -OOpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
823 n_packets=3, n_bytes=180, actions=resubmit(1,1)
824OFPST_FLOW reply (OF1.2):
825])
826
827OVS_VSWITCHD_STOP
828AT_CLEANUP
829
830AT_SETUP([ofproto-dpif - Table Miss - OFPTC_TABLE_MISS_CONTINUE])
831OVS_VSWITCHD_START([dnl
832 add-port br0 p1 -- set Interface p1 type=dummy
833])
834ON_EXIT([kill `cat ovs-ofctl.pid`])
835
836AT_CAPTURE_FILE([ofctl_monitor.log])
837AT_CHECK([ovs-ofctl add-flow br0 'table=1 dl_src=10:11:11:11:11:11 actions=controller'])
838AT_CHECK([ovs-ofctl -OOpenFlow11 mod-table br0 all continue])
839
840dnl Miss table 0, Hit table 1
841AT_CHECK([ovs-ofctl monitor br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
842
843for i in 1 2 3 ; do
844 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)'
845done
846OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
847OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
848
849AT_CHECK([cat ofctl_monitor.log], [0], [dnl
850NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
851tcp,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=ack tcp_csum:0
852dnl
853NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
854tcp,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=ack tcp_csum:0
855dnl
856NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
857tcp,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=ack tcp_csum:0
858])
859
860dnl Hit table 0, Miss all other tables, sent to controller
861AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --no-chdir --pidfile 2> ofctl_monitor.log])
862
863for i in 1 2 3 ; do
864 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)'
865done
866OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
867OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
868
869AT_CHECK([cat ofctl_monitor.log], [0], [dnl
870NXT_PACKET_IN (xid=0x0): table_id=253 cookie=0x0 total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
871tcp,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=ack tcp_csum:0
872dnl
873NXT_PACKET_IN (xid=0x0): table_id=253 cookie=0x0 total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
874tcp,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=ack tcp_csum:0
875dnl
876NXT_PACKET_IN (xid=0x0): table_id=253 cookie=0x0 total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
877tcp,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=ack tcp_csum:0
878])
879
880AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
881ovs-appctl revalidator/wait
882AT_CHECK([ovs-ofctl -OOpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
883 table=1, n_packets=3, n_bytes=180, dl_src=10:11:11:11:11:11 actions=CONTROLLER:65535
884OFPST_FLOW reply (OF1.2):
885])
886
887OVS_VSWITCHD_STOP
888AT_CLEANUP
889
890AT_SETUP([ofproto-dpif - Table Miss - goto table and OFPTC_TABLE_MISS_CONTINUE])
891OVS_VSWITCHD_START([dnl
892 add-port br0 p1 -- set Interface p1 type=dummy
893])
894ON_EXIT([kill `cat ovs-ofctl.pid`])
895
896AT_CAPTURE_FILE([ofctl_monitor.log])
897AT_DATA([flows.txt], [dnl
898table=0 actions=goto_table(1)
899table=2 dl_src=10:11:11:11:11:11 actions=controller
900])
901AT_CHECK([ovs-ofctl -OOpenFlow12 add-flows br0 flows.txt])
902AT_CHECK([ovs-ofctl -OOpenFlow11 mod-table br0 all continue])
903
904dnl Hit table 0, Miss table 1, Hit table 2
905AT_CHECK([ovs-ofctl monitor br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
906
907for i in 1 2 3 ; do
908 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)'
909done
910OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
911OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
912
913AT_CHECK([cat ofctl_monitor.log], [0], [dnl
914NXT_PACKET_IN (xid=0x0): table_id=2 cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
915tcp,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=ack tcp_csum:0
916dnl
917NXT_PACKET_IN (xid=0x0): table_id=2 cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
918tcp,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=ack tcp_csum:0
919dnl
920NXT_PACKET_IN (xid=0x0): table_id=2 cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
921tcp,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=ack tcp_csum:0
922])
923
924dnl Hit table 1, Miss all other tables, sent to controller
925AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --no-chdir --pidfile 2> ofctl_monitor.log])
926
927for i in 1 2 3 ; do
928 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)'
929done
930OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
931OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
932
933AT_CHECK([cat ofctl_monitor.log], [0], [dnl
934NXT_PACKET_IN (xid=0x0): table_id=253 cookie=0x0 total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
935tcp,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=ack tcp_csum:0
936dnl
937NXT_PACKET_IN (xid=0x0): table_id=253 cookie=0x0 total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
938tcp,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=ack tcp_csum:0
939dnl
940NXT_PACKET_IN (xid=0x0): table_id=253 cookie=0x0 total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
941tcp,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=ack tcp_csum:0
942])
943
944AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
945ovs-appctl revalidator/wait
946AT_CHECK([ovs-ofctl -OOpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
947 n_packets=6, n_bytes=360, actions=goto_table:1
948 table=2, n_packets=3, n_bytes=180, dl_src=10:11:11:11:11:11 actions=CONTROLLER:65535
949OFPST_FLOW reply (OF1.2):
950])
951
952OVS_VSWITCHD_STOP
953AT_CLEANUP
954
955AT_SETUP([ofproto-dpif - Table Miss - resubmit and OFPTC_TABLE_MISS_CONTINUE])
956OVS_VSWITCHD_START([dnl
957 add-port br0 p1 -- set Interface p1 type=dummy
958])
959ON_EXIT([kill `cat ovs-ofctl.pid`])
960
961AT_CAPTURE_FILE([ofctl_monitor.log])
962AT_DATA([flows.txt], [dnl
963table=0 actions=resubmit(1,1)
964table=2 dl_src=10:11:11:11:11:11 actions=controller
965])
966AT_CHECK([ovs-ofctl -OOpenFlow12 add-flows br0 flows.txt])
967AT_CHECK([ovs-ofctl -OOpenFlow11 mod-table br0 all continue])
968
969dnl Hit table 0, Miss table 1, Dropped
970AT_CHECK([ovs-ofctl monitor br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
971
972for i in 1 2 3 ; do
973 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)'
974done
975OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
976
977AT_CHECK([cat ofctl_monitor.log], [0], [dnl
978])
979
980dnl Hit table 1, Dropped
981AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --no-chdir --pidfile 2> ofctl_monitor.log])
982
983for i in 1 2 3 ; do
984 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)'
985done
986OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
987
988AT_CHECK([cat ofctl_monitor.log], [0], [dnl
989])
990
991AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
992ovs-appctl revalidator/wait
993AT_CHECK([ovs-ofctl -OOpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
994 n_packets=6, n_bytes=360, actions=resubmit(1,1)
995 table=2, dl_src=10:11:11:11:11:11 actions=CONTROLLER:65535
996OFPST_FLOW reply (OF1.2):
997])
998
999OVS_VSWITCHD_STOP
1000AT_CLEANUP
1001
1002AT_SETUP([ofproto-dpif - Table Miss - OFPTC_TABLE_MISS_DROP])
1003OVS_VSWITCHD_START([dnl
1004 add-port br0 p1 -- set Interface p1 type=dummy
1005])
1006ON_EXIT([kill `cat ovs-ofctl.pid`])
1007
1008AT_CAPTURE_FILE([ofctl_monitor.log])
1009AT_CHECK([ovs-ofctl -OOpenFlow11 mod-table br0 all drop])
1010
1011AT_CHECK([ovs-ofctl monitor -P openflow10 br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
1012
1013dnl Test that missed packets are droped
1014for i in 1 2 3 ; do
1015 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)'
1016done
1017OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
1018
1019AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1020])
1021
1022AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
1023AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1024NXST_FLOW reply:
1025])
1026
1027OVS_VSWITCHD_STOP
1028AT_CLEANUP
1029
1030AT_SETUP([ofproto-dpif - Table Miss - goto table and OFPTC_TABLE_MISS_DROP])
1031OVS_VSWITCHD_START([dnl
1032 add-port br0 p1 -- set Interface p1 type=dummy
1033])
1034ON_EXIT([kill `cat ovs-ofctl.pid`])
1035
1036AT_CAPTURE_FILE([ofctl_monitor.log])
1037AT_CHECK([ovs-ofctl del-flows br0])
1038AT_CHECK([ovs-ofctl -OOpenFlow12 add-flow br0 'table=0 actions=goto_table(1)'])
1039AT_CHECK([ovs-ofctl -OOpenFlow11 mod-table br0 all drop])
1040
1041AT_CHECK([ovs-ofctl monitor -P openflow10 br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
1042
1043dnl Test that missed packets are droped
1044for i in 1 2 3 ; do
1045 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)'
1046done
1047OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
1048
1049AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1050])
1051
1052AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
1053ovs-appctl revalidator/wait
1054AT_CHECK([ovs-ofctl -OOpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1055 n_packets=3, n_bytes=180, actions=goto_table:1
1056OFPST_FLOW reply (OF1.2):
1057])
1058
1059OVS_VSWITCHD_STOP
1060AT_CLEANUP
1061
1062AT_SETUP([ofproto-dpif - Table Miss - resubmit and OFPTC_TABLE_MISS_DROP])
1063OVS_VSWITCHD_START([dnl
1064 add-port br0 p1 -- set Interface p1 type=dummy
1065])
1066ON_EXIT([kill `cat ovs-ofctl.pid`])
1067
1068AT_CAPTURE_FILE([ofctl_monitor.log])
1069AT_CHECK([ovs-ofctl del-flows br0])
1070AT_CHECK([ovs-ofctl -OOpenFlow12 add-flow br0 'table=0 actions=resubmit(1,1)'])
1071AT_CHECK([ovs-ofctl -OOpenFlow11 mod-table br0 all drop])
1072
1073AT_CHECK([ovs-ofctl monitor -P openflow10 br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
1074
1075dnl Test that missed packets are droped
1076for i in 1 2 3 ; do
1077 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)'
1078done
1079OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
1080
1081AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1082])
1083
1084AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
1085ovs-appctl revalidator/wait
1086AT_CHECK([ovs-ofctl -OOpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1087 n_packets=3, n_bytes=180, actions=resubmit(1,1)
1088OFPST_FLOW reply (OF1.2):
1089])
1090
1091OVS_VSWITCHD_STOP
1092AT_CLEANUP
1093
1094AT_SETUP([ofproto-dpif - controller])
1095OVS_VSWITCHD_START([dnl
1096 add-port br0 p1 -- set Interface p1 type=dummy
1097])
1098ON_EXIT([kill `cat ovs-ofctl.pid`])
1099
1100AT_CAPTURE_FILE([ofctl_monitor.log])
1101AT_DATA([flows.txt], [dnl
1102cookie=0x0 dl_src=10:11:11:11:11:11 actions=controller
1103cookie=0x1 dl_src=20:22:22:22:22:22 actions=controller,resubmit(80,1)
1104cookie=0x2 dl_src=30:33:33:33:33:33 actions=mod_vlan_vid:15,controller
1105
1106cookie=0x3 table=1 in_port=80 actions=load:1->NXM_NX_REG0[[]],mod_vlan_vid:80,controller,resubmit(81,2)
1107cookie=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)
1108cookie=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)
1109cookie=0x6 table=4 in_port=83 actions=load:4->NXM_NX_REG3[[]],mod_nw_src:83.83.83.83,controller,resubmit(84,5)
1110cookie=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)
1111cookie=0x8 table=6 in_port=85 actions=mod_tp_src:85,controller,resubmit(86,7)
1112cookie=0x9 table=7 in_port=86 actions=mod_tp_dst:86,controller,controller
1113cookie=0xa dl_src=40:44:44:44:44:41 actions=mod_vlan_vid:99,mod_vlan_pcp:1,controller
1114cookie=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
1115])
1116AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
1117
1118dnl Flow miss.
1119AT_CHECK([ovs-ofctl monitor -P openflow10 br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
1120
1121for i in 1 2 3 ; do
1122 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)'
1123done
1124OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1125OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1126
1127AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1128OFPT_PACKET_IN (xid=0x0): total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
1129tcp,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=ack tcp_csum:0
1130dnl
1131OFPT_PACKET_IN (xid=0x0): total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
1132tcp,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=ack tcp_csum:0
1133dnl
1134OFPT_PACKET_IN (xid=0x0): total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
1135tcp,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=9,tcp_flags=ack tcp_csum:0
1136])
1137
1138dnl Singleton controller action.
1139AT_CHECK([ovs-ofctl monitor -P openflow10 br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
1140
1141for i in 1 2 3 ; do
1142 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)'
1143done
1144OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1145OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1146
1147AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1148OFPT_PACKET_IN (xid=0x0): total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
1149tcp,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:0
1150dnl
1151OFPT_PACKET_IN (xid=0x0): total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
1152tcp,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:0
1153dnl
1154OFPT_PACKET_IN (xid=0x0): total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
1155tcp,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:0
1156])
1157
1158dnl Modified controller action.
1159AT_CHECK([ovs-ofctl monitor -P openflow10 br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
1160
1161for i in 1 2 3 ; do
1162 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)'
1163done
1164OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1165OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1166
1167AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1168OFPT_PACKET_IN (xid=0x0): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1169tcp,metadata=0,in_port=0,dl_vlan=15,dl_vlan_pcp=0,dl_src=30:33:33:33:33:33,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=fin tcp_csum:0
1170dnl
1171OFPT_PACKET_IN (xid=0x0): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1172tcp,metadata=0,in_port=0,dl_vlan=15,dl_vlan_pcp=0,dl_src=30:33:33:33:33:33,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=fin tcp_csum:0
1173dnl
1174OFPT_PACKET_IN (xid=0x0): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1175tcp,metadata=0,in_port=0,dl_vlan=15,dl_vlan_pcp=0,dl_src=30:33:33:33:33:33,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=fin tcp_csum:0
1176])
1177
1178dnl Modified VLAN controller action.
1179AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
1180
1181for i in 1 2 3; do
1182 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)'
1183done
1184OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1185OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1186
1187AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1188NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1189ip,metadata=0,in_port=0,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:44:41,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=16,nw_tos=0,nw_ecn=0,nw_ttl=64
1190dnl
1191NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1192ip,metadata=0,in_port=0,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:44:41,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=16,nw_tos=0,nw_ecn=0,nw_ttl=64
1193dnl
1194NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1195ip,metadata=0,in_port=0,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:44:41,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=16,nw_tos=0,nw_ecn=0,nw_ttl=64
1196])
1197
1198dnl Checksum TCP.
1199AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --no-chdir --pidfile 2> ofctl_monitor.log])
1200
1201for i in 1 ; do
1202 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)'
1203done
1204OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 18])
1205ovs-appctl -t ovs-ofctl exit
1206
1207AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1208NXT_PACKET_IN (xid=0x0): cookie=0x1 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
1209tcp,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=20:22:22:22:22:22,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=11,tcp_flags=fin tcp_csum:0
1210dnl
1211NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x3 total_len=64 in_port=1 reg0=0x1 (via action) data_len=64 (unbuffered)
1212tcp,metadata=0,in_port=0,dl_vlan=80,dl_vlan_pcp=0,dl_src=20:22:22:22:22:22,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=11,tcp_flags=fin tcp_csum:0
1213dnl
1214NXT_PACKET_IN (xid=0x0): table_id=2 cookie=0x4 total_len=64 in_port=1 reg0=0x1 reg1=0x2 (via action) data_len=64 (unbuffered)
1215tcp,metadata=0,in_port=0,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=11,tcp_flags=fin tcp_csum:0
1216dnl
1217NXT_PACKET_IN (xid=0x0): table_id=3 cookie=0x5 total_len=64 in_port=1 reg0=0x1 reg1=0x2 reg2=0x3 (via action) data_len=64 (unbuffered)
1218tcp,metadata=0,in_port=0,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=11,tcp_flags=fin tcp_csum:0
1219dnl
1220NXT_PACKET_IN (xid=0x0): table_id=4 cookie=0x6 total_len=64 in_port=1 reg0=0x1 reg1=0x2 reg2=0x3 reg3=0x4 (via action) data_len=64 (unbuffered)
1221tcp,metadata=0,in_port=0,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=83.83.83.83,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=11,tcp_flags=fin tcp_csum:1a03
1222dnl
1223NXT_PACKET_IN (xid=0x0): table_id=5 cookie=0x7 total_len=64 in_port=1 tun_id=0x6 reg0=0x1 reg1=0x2 reg2=0x3 reg3=0x4 reg4=0x5 (via action) data_len=64 (unbuffered)
1224tcp,metadata=0,in_port=0,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=83.83.83.83,nw_dst=84.84.84.84,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=11,tcp_flags=fin tcp_csum:3205
1225dnl
1226NXT_PACKET_IN (xid=0x0): table_id=6 cookie=0x8 total_len=64 in_port=1 tun_id=0x6 reg0=0x1 reg1=0x2 reg2=0x3 reg3=0x4 reg4=0x5 (via action) data_len=64 (unbuffered)
1227tcp,metadata=0,in_port=0,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=83.83.83.83,nw_dst=84.84.84.84,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=85,tp_dst=11,tcp_flags=fin tcp_csum:31b8
1228dnl
1229NXT_PACKET_IN (xid=0x0): table_id=7 cookie=0x9 total_len=64 in_port=1 tun_id=0x6 reg0=0x1 reg1=0x2 reg2=0x3 reg3=0x4 reg4=0x5 (via action) data_len=64 (unbuffered)
1230tcp,metadata=0,in_port=0,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=83.83.83.83,nw_dst=84.84.84.84,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=85,tp_dst=86,tcp_flags=fin tcp_csum:316d
1231dnl
1232NXT_PACKET_IN (xid=0x0): table_id=7 cookie=0x9 total_len=64 in_port=1 tun_id=0x6 reg0=0x1 reg1=0x2 reg2=0x3 reg3=0x4 reg4=0x5 (via action) data_len=64 (unbuffered)
1233tcp,metadata=0,in_port=0,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=83.83.83.83,nw_dst=84.84.84.84,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=85,tp_dst=86,tcp_flags=fin tcp_csum:316d
1234])
1235
1236dnl Checksum UDP.
1237AT_CHECK([ovs-ofctl monitor br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
1238
1239for i in 1 ; do
1240 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'
1241done
1242OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 18])
1243ovs-appctl -t ovs-ofctl exit
1244
1245AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1246NXT_PACKET_IN (xid=0x0): cookie=0x1 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
1247udp,metadata=0,in_port=0,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
1248dnl
1249NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x3 total_len=64 in_port=1 reg0=0x1 (via action) data_len=64 (unbuffered)
1250udp,metadata=0,in_port=0,dl_vlan=80,dl_vlan_pcp=0,dl_src=20:22:22:22:22:22,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=8,tp_dst=11 udp_csum:1234
1251dnl
1252NXT_PACKET_IN (xid=0x0): table_id=2 cookie=0x4 total_len=64 in_port=1 reg0=0x1 reg1=0x2 (via action) data_len=64 (unbuffered)
1253udp,metadata=0,in_port=0,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=8,tp_dst=11 udp_csum:1234
1254dnl
1255NXT_PACKET_IN (xid=0x0): table_id=3 cookie=0x5 total_len=64 in_port=1 reg0=0x1 reg1=0x2 reg2=0x3 (via action) data_len=64 (unbuffered)
1256udp,metadata=0,in_port=0,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=8,tp_dst=11 udp_csum:1234
1257dnl
1258NXT_PACKET_IN (xid=0x0): table_id=4 cookie=0x6 total_len=64 in_port=1 reg0=0x1 reg1=0x2 reg2=0x3 reg3=0x4 (via action) data_len=64 (unbuffered)
1259udp,metadata=0,in_port=0,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=83.83.83.83,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=8,tp_dst=11 udp_csum:2c37
1260dnl
1261NXT_PACKET_IN (xid=0x0): table_id=5 cookie=0x7 total_len=64 in_port=1 tun_id=0x6 reg0=0x1 reg1=0x2 reg2=0x3 reg3=0x4 reg4=0x5 (via action) data_len=64 (unbuffered)
1262udp,metadata=0,in_port=0,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=83.83.83.83,nw_dst=84.84.84.84,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=8,tp_dst=11 udp_csum:4439
1263dnl
1264NXT_PACKET_IN (xid=0x0): table_id=6 cookie=0x8 total_len=64 in_port=1 tun_id=0x6 reg0=0x1 reg1=0x2 reg2=0x3 reg3=0x4 reg4=0x5 (via action) data_len=64 (unbuffered)
1265udp,metadata=0,in_port=0,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=83.83.83.83,nw_dst=84.84.84.84,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=85,tp_dst=11 udp_csum:43ec
1266dnl
1267NXT_PACKET_IN (xid=0x0): table_id=7 cookie=0x9 total_len=64 in_port=1 tun_id=0x6 reg0=0x1 reg1=0x2 reg2=0x3 reg3=0x4 reg4=0x5 (via action) data_len=64 (unbuffered)
1268udp,metadata=0,in_port=0,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=83.83.83.83,nw_dst=84.84.84.84,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=85,tp_dst=86 udp_csum:43a1
1269dnl
1270NXT_PACKET_IN (xid=0x0): table_id=7 cookie=0x9 total_len=64 in_port=1 tun_id=0x6 reg0=0x1 reg1=0x2 reg2=0x3 reg3=0x4 reg4=0x5 (via action) data_len=64 (unbuffered)
1271udp,metadata=0,in_port=0,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=83.83.83.83,nw_dst=84.84.84.84,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=85,tp_dst=86 udp_csum:43a1
1272])
1273
1274dnl Modified ARP controller action.
1275AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
1276
1277for i in 1 2 3; do
1278 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)'
1279done
1280
1281OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 18])
1282OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
1283AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1284NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
1285arp,metadata=0,in_port=0,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
1286NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
1287arp,metadata=0,in_port=0,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
1288NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
1289arp,metadata=0,in_port=0,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
1290NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
1291arp,metadata=0,in_port=0,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
1292NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
1293arp,metadata=0,in_port=0,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
1294NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
1295arp,metadata=0,in_port=0,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
1296NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
1297arp,metadata=0,in_port=0,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
1298NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
1299arp,metadata=0,in_port=0,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
1300NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
1301arp,metadata=0,in_port=0,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
1302])
1303
1304AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
1305
1306dnl Checksum SCTP.
1307AT_CHECK([ovs-ofctl monitor br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
1308
1309for i in 1 ; do
1310 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'
1311done
1312
1313AT_CHECK([ovs-appctl time/warp 1000], [0], [ignore])
1314OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 18])
1315OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
1316AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1317NXT_PACKET_IN (xid=0x0): cookie=0x1 total_len=98 in_port=1 (via action) data_len=98 (unbuffered)
1318sctp,metadata=0,in_port=0,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
1319dnl
1320NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x3 total_len=102 in_port=1 reg0=0x1 (via action) data_len=102 (unbuffered)
1321sctp,metadata=0,in_port=0,dl_vlan=80,dl_vlan_pcp=0,dl_src=20:22:22:22:22:22,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=1112,tp_dst=2223 sctp_csum:d9d79157
1322dnl
1323NXT_PACKET_IN (xid=0x0): table_id=2 cookie=0x4 total_len=102 in_port=1 reg0=0x1 reg1=0x2 (via action) data_len=102 (unbuffered)
1324sctp,metadata=0,in_port=0,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=1112,tp_dst=2223 sctp_csum:d9d79157
1325dnl
1326NXT_PACKET_IN (xid=0x0): table_id=3 cookie=0x5 total_len=102 in_port=1 reg0=0x1 reg1=0x2 reg2=0x3 (via action) data_len=102 (unbuffered)
1327sctp,metadata=0,in_port=0,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=1112,tp_dst=2223 sctp_csum:d9d79157
1328dnl
1329NXT_PACKET_IN (xid=0x0): table_id=4 cookie=0x6 total_len=102 in_port=1 reg0=0x1 reg1=0x2 reg2=0x3 reg3=0x4 (via action) data_len=102 (unbuffered)
1330sctp,metadata=0,in_port=0,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=83.83.83.83,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=1112,tp_dst=2223 sctp_csum:d9d79157
1331dnl
1332NXT_PACKET_IN (xid=0x0): table_id=5 cookie=0x7 total_len=102 in_port=1 tun_id=0x6 reg0=0x1 reg1=0x2 reg2=0x3 reg3=0x4 reg4=0x5 (via action) data_len=102 (unbuffered)
1333sctp,metadata=0,in_port=0,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=83.83.83.83,nw_dst=84.84.84.84,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=1112,tp_dst=2223 sctp_csum:d9d79157
1334dnl
1335NXT_PACKET_IN (xid=0x0): table_id=6 cookie=0x8 total_len=102 in_port=1 tun_id=0x6 reg0=0x1 reg1=0x2 reg2=0x3 reg3=0x4 reg4=0x5 (via action) data_len=102 (unbuffered)
1336sctp,metadata=0,in_port=0,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=83.83.83.83,nw_dst=84.84.84.84,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=85,tp_dst=2223 sctp_csum:7f12662e
1337dnl
1338NXT_PACKET_IN (xid=0x0): table_id=7 cookie=0x9 total_len=102 in_port=1 tun_id=0x6 reg0=0x1 reg1=0x2 reg2=0x3 reg3=0x4 reg4=0x5 (via action) data_len=102 (unbuffered)
1339sctp,metadata=0,in_port=0,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=83.83.83.83,nw_dst=84.84.84.84,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=85,tp_dst=86 sctp_csum:a7e86f67
1340dnl
1341NXT_PACKET_IN (xid=0x0): table_id=7 cookie=0x9 total_len=102 in_port=1 tun_id=0x6 reg0=0x1 reg1=0x2 reg2=0x3 reg3=0x4 reg4=0x5 (via action) data_len=102 (unbuffered)
1342sctp,metadata=0,in_port=0,dl_vlan=80,dl_vlan_pcp=0,dl_src=80:81:81:81:81:81,dl_dst=82:82:82:82:82:82,nw_src=83.83.83.83,nw_dst=84.84.84.84,nw_tos=0,nw_ecn=0,nw_ttl=0,tp_src=85,tp_dst=86 sctp_csum:a7e86f67
1343])
1344
1345AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1346 cookie=0x1, n_packets=3, n_bytes=218, dl_src=20:22:22:22:22:22 actions=CONTROLLER:65535,resubmit(80,1)
1347 cookie=0x2, n_packets=3, n_bytes=180, dl_src=30:33:33:33:33:33 actions=mod_vlan_vid:15,CONTROLLER:65535
1348 cookie=0x3, table=1, n_packets=3, n_bytes=218, in_port=80 actions=load:0x1->NXM_NX_REG0[[]],mod_vlan_vid:80,CONTROLLER:65535,resubmit(81,2)
1349 cookie=0x4, table=2, n_packets=3, n_bytes=218, in_port=81 actions=load:0x2->NXM_NX_REG1[[]],mod_dl_src:80:81:81:81:81:81,CONTROLLER:65535,resubmit(82,3)
1350 cookie=0x5, table=3, n_packets=3, n_bytes=218, in_port=82 actions=load:0x3->NXM_NX_REG2[[]],mod_dl_dst:82:82:82:82:82:82,CONTROLLER:65535,resubmit(83,4)
1351 cookie=0x6, table=4, n_packets=3, n_bytes=218, in_port=83 actions=load:0x4->NXM_NX_REG3[[]],mod_nw_src:83.83.83.83,CONTROLLER:65535,resubmit(84,5)
1352 cookie=0x7, table=5, n_packets=3, n_bytes=218, in_port=84 actions=load:0x5->NXM_NX_REG4[[]],load:0x6->NXM_NX_TUN_ID[[]],mod_nw_dst:84.84.84.84,CONTROLLER:65535,resubmit(85,6)
1353 cookie=0x8, table=6, n_packets=3, n_bytes=218, in_port=85 actions=mod_tp_src:85,CONTROLLER:65535,resubmit(86,7)
1354 cookie=0x9, table=7, n_packets=3, n_bytes=218, in_port=86 actions=mod_tp_dst:86,CONTROLLER:65535,CONTROLLER:65535
1355 cookie=0xa, n_packets=3, n_bytes=180, dl_src=40:44:44:44:44:41 actions=mod_vlan_vid:99,mod_vlan_pcp:1,CONTROLLER:65535
1356 cookie=0xd, n_packets=3, n_bytes=180, arp,dl_src=80:88:88:88:88:88 actions=load:0x2->NXM_OF_ARP_OP[[]],CONTROLLER:65535,load:0xc0a88001->NXM_OF_ARP_SPA[[]],CONTROLLER:65535,load:0x404444444441->NXM_NX_ARP_THA[[]],load:0x1010101->NXM_OF_ARP_SPA[[]],load:0x2020202->NXM_OF_ARP_TPA[[]],CONTROLLER:65535
1357 n_packets=3, n_bytes=180, dl_src=10:11:11:11:11:11 actions=CONTROLLER:65535
1358NXST_FLOW reply:
1359])
1360
1361OVS_VSWITCHD_STOP
1362AT_CLEANUP
1363
1364AT_SETUP([ofproto-dpif - MPLS handling])
1365OVS_VSWITCHD_START([dnl
1366 add-port br0 p1 -- set Interface p1 type=dummy
1367])
1368ON_EXIT([kill `cat ovs-ofctl.pid`])
1369
1370AT_CAPTURE_FILE([ofctl_monitor.log])
1371AT_DATA([flows.txt], [dnl
1372cookie=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
1373cookie=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
1374cookie=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
1375cookie=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
1376cookie=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
1377cookie=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
1378cookie=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
1379cookie=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
1380cookie=0xa mpls,dl_src=40:44:44:44:44:49 actions=push_mpls:0x8848,load:10->OXM_OF_MPLS_LABEL[[]],CONTROLLER:65535
1381cookie=0xb dl_src=50:55:55:55:55:55 dl_type=0x8847 actions=load:1000->OXM_OF_MPLS_LABEL[[]],controller
1382cookie=0xd dl_src=60:66:66:66:66:66 actions=pop_mpls:0x0800,controller
1383cookie=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
1384
1385cookie=0xd dl_src=60:66:66:66:00:01 actions=pop_mpls:0x0800,dec_ttl,controller
1386cookie=0xd dl_src=60:66:66:66:00:02 actions=pop_mpls:0x0800,load:0xa000001->OXM_OF_IPV4_DST[[]],controller
1387cookie=0xd dl_src=60:66:66:66:00:03 actions=pop_mpls:0x0800,move:OXM_OF_IPV4_DST[[]]->OXM_OF_IPV4_SRC[[]],controller
1388cookie=0xd dl_src=60:66:66:66:00:04 actions=pop_mpls:0x0800,push:OXM_OF_IPV4_DST[[]],pop:OXM_OF_IPV4_SRC[[]],controller
1389cookie=0xd dl_src=60:66:66:66:00:05 actions=pop_mpls:0x0800,multipath(eth_src,50,modulo_n,256,0,OXM_OF_IPV4_SRC[[0..7]]),controller
1390cookie=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
1391cookie=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
1392
1393cookie=0xd dl_src=60:66:66:66:00:08 actions=pop_mpls:0x0806,resubmit(1,1)
1394cookie=0xd table=1 arp actions=controller
1395
1396cookie=0xd dl_src=60:66:66:66:00:09 actions=pop_mpls:0x0800,mod_nw_tos:48,controller
1397cookie=0xd dl_src=60:66:66:66:00:0a actions=pop_mpls:0x0800,mod_nw_dst:10.0.0.1,controller
1398cookie=0xd dl_src=60:66:66:66:00:0b actions=pop_mpls:0x0800,mod_nw_src:10.0.0.1,controller
1399
1400cookie=0xd dl_src=60:66:66:66:01:00 actions=pop_mpls:0x8848,controller
1401cookie=0xd dl_src=60:66:66:66:01:01 actions=pop_mpls:0x8847,dec_mpls_ttl,controller
1402cookie=0xd dl_src=60:66:66:66:01:02 actions=pop_mpls:0x8848,load:3->OXM_OF_MPLS_TC[[]],controller
1403
1404cookie=0xd dl_src=60:66:66:66:02:00 actions=pop_mpls:0x8847,pop_mpls:0x0800,controller
1405cookie=0xd dl_src=60:66:66:66:02:01 actions=pop_mpls:0x8848,pop_mpls:0x0800,dec_ttl,controller
1406cookie=0xd dl_src=60:66:66:66:02:10 actions=pop_mpls:0x8847,dec_mpls_ttl,pop_mpls:0x0800,dec_ttl,controller
1407
1408cookie=0xd dl_src=60:66:66:66:03:00 actions=pop_mpls:0x8848,pop_mpls:0x8848,controller
1409cookie=0xd dl_src=60:66:66:66:03:01 actions=pop_mpls:0x8847,pop_mpls:0x8847,dec_mpls_ttl,controller
1410cookie=0xd dl_src=60:66:66:66:03:10 actions=pop_mpls:0x8848,dec_mpls_ttl,pop_mpls:0x8848,dec_mpls_ttl,controller
1411
1412cookie=0xd dl_src=60:66:66:66:04:00 actions=pop_mpls:0x0800,push_mpls:0x8847,controller
1413cookie=0xd dl_src=60:66:66:66:04:01 actions=pop_mpls:0x0800,push_mpls:0x8848,dec_mpls_ttl,controller
1414cookie=0xd dl_src=60:66:66:66:04:10 actions=pop_mpls:0x0800,dec_ttl,push_mpls:0x8848,dec_mpls_ttl,controller
1415
1416cookie=0xd dl_src=60:66:66:66:05:00 actions=push_mpls:0x8848,pop_mpls:0x8847,controller
1417cookie=0xd dl_src=60:66:66:66:05:01 actions=push_mpls:0x8847,pop_mpls:0x8848,dec_mpls_ttl,controller
1418cookie=0xd dl_src=60:66:66:66:05:10 actions=push_mpls:0x8848,dec_mpls_ttl,pop_mpls:0x8847,dec_mpls_ttl,controller
1419])
1420AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
1421
1422dnl Modified MPLS controller action.
1423AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
1424
1425for i in 1 2 3; do
1426 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)'
1427done
1428OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1429OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1430
1431AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1432NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1433mpls,metadata=0,in_port=0,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
1434dnl
1435NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1436mpls,metadata=0,in_port=0,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
1437dnl
1438NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1439mpls,metadata=0,in_port=0,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
1440])
1441
1442dnl Modified MPLS controller action.
1443AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
1444
1445for i in 1 2 3; do
1446 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)'
1447done
1448OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1449OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1450
1451AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1452NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
1453ip,metadata=0,in_port=0,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
1454dnl
1455NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
1456ip,metadata=0,in_port=0,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
1457dnl
1458NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
1459ip,metadata=0,in_port=0,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
1460])
1461
1462dnl Modified MPLS controller action.
1463AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
1464
1465dnl 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)
1466
1467for i in 1 2 3; do
1468 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)'
1469done
1470OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1471OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1472
1473AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1474NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1475mpls,metadata=0,in_port=0,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
1476dnl
1477NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1478mpls,metadata=0,in_port=0,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
1479dnl
1480NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1481mpls,metadata=0,in_port=0,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
1482])
1483
1484dnl Modified MPLS controller action.
1485AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
1486
1487for i in 1 2 3; do
1488 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))'
1489done
1490OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1491OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1492
1493AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1494NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1495mpls,metadata=0,in_port=0,dl_vlan=99,dl_vlan_pcp=7,dl_src=40:44:44:44:44:44,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=64,mpls_bos=1
1496dnl
1497NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1498mpls,metadata=0,in_port=0,dl_vlan=99,dl_vlan_pcp=7,dl_src=40:44:44:44:44:44,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=64,mpls_bos=1
1499dnl
1500NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1501mpls,metadata=0,in_port=0,dl_vlan=99,dl_vlan_pcp=7,dl_src=40:44:44:44:44:44,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=3,mpls_ttl=64,mpls_bos=1
1502])
1503
1504dnl Modified MPLS controller action.
1505AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
1506
1507for i in 1 2 3; do
1508 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)'
1509done
1510OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1511OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1512
1513AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1514NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1515mpls,metadata=0,in_port=0,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
1516dnl
1517NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1518mpls,metadata=0,in_port=0,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
1519dnl
1520NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1521mpls,metadata=0,in_port=0,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
1522])
1523
1524dnl Modified MPLS controller action.
1525AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
1526
1527for i in 1 2 3; do
1528 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)'
1529done
1530OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1531OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1532
1533AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1534NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1535mpls,metadata=0,in_port=0,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
1536dnl
1537NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1538mpls,metadata=0,in_port=0,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
1539dnl
1540NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1541mpls,metadata=0,in_port=0,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
1542])
1543
1544dnl Modified MPLS controller action.
1545AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
1546
1547for i in 1 2 3; do
1548 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)'
1549done
1550OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1551OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1552
1553AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1554NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1555mpls,metadata=0,in_port=0,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
1556dnl
1557NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1558mpls,metadata=0,in_port=0,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
1559dnl
1560NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1561mpls,metadata=0,in_port=0,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
1562])
1563
1564AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
1565
1566dnl Modified MPLS controller action.
1567AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
1568
1569for i in 1 2 3; do
1570 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)'
1571done
1572OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1573ovs-appctl -t ovs-ofctl exit
1574
1575AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1576NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1577mplsm,metadata=0,in_port=0,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
1578dnl
1579NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1580mplsm,metadata=0,in_port=0,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
1581dnl
1582NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1583mplsm,metadata=0,in_port=0,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
1584])
1585
1586AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
1587
1588dnl Modified MPLS controller action.
1589AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
1590
1591for i in 1 2 3; do
1592 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)'
1593done
1594OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1595OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1596
1597AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1598NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1599mpls,metadata=0,in_port=0,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
1600dnl
1601NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1602mpls,metadata=0,in_port=0,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
1603dnl
1604NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1605mpls,metadata=0,in_port=0,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
1606])
1607
1608dnl Modified MPLS actions.
1609AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
1610
1611for i in 1 2 3; do
1612 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)'
1613done
1614OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1615OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1616
1617AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1618NXT_PACKET_IN (xid=0x0): cookie=0xb total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
1619mpls,metadata=0,in_port=0,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
1620dnl
1621NXT_PACKET_IN (xid=0x0): cookie=0xb total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
1622mpls,metadata=0,in_port=0,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
1623dnl
1624NXT_PACKET_IN (xid=0x0): cookie=0xb total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
1625mpls,metadata=0,in_port=0,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
1626])
1627
1628dnl Modified MPLS ipv6 controller action.
1629AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
1630
1631for i in 1 2 3; do
1632 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)'
1633done
1634OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1635OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1636
1637AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1638NXT_PACKET_IN (xid=0x0): cookie=0xc total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1639mplsm,metadata=0,in_port=0,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
1640dnl
1641NXT_PACKET_IN (xid=0x0): cookie=0xc total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1642mplsm,metadata=0,in_port=0,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
1643dnl
1644NXT_PACKET_IN (xid=0x0): cookie=0xc total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1645mplsm,metadata=0,in_port=0,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
1646])
1647
1648
1649dnl Modified MPLS pop action.
1650dnl The input is a frame with two MPLS headers which tcpdump -vve shows as:
1651dnl 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)
1652dnl (tos 0x0, ttl 64, id 0, offset 0, flags [none], proto TCP (6), length 44)
1653
1654AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
1655
1656for i in 1 2 3; do
1657 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'
1658done
1659#for i in 2 3; do
1660# 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)'
1661#done
1662OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1663OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1664
1665AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1666NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
1667tcp,metadata=0,in_port=0,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
1668dnl
1669NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
1670tcp,metadata=0,in_port=0,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
1671dnl
1672NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
1673tcp,metadata=0,in_port=0,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
1674])
1675
1676AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
1677
1678dnl Modified MPLS pop action.
1679dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as:
1680dnl 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)
1681dnl (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44)
1682dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4
1683AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
1684
1685for i in 1 2 3; do
1686 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'
1687done
1688OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1689OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1690
1691AT_CHECK([STRIP_METADATA ofctl_monitor.log], [0], [dnl
1692NXT_PACKET_IN (xid=0x0): table_id=254 cookie=0x0 total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
1693tcp,metadata=0,in_port=0,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
1694dnl
1695NXT_PACKET_IN (xid=0x0): table_id=254 cookie=0x0 total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
1696tcp,metadata=0,in_port=0,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
1697dnl
1698NXT_PACKET_IN (xid=0x0): table_id=254 cookie=0x0 total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
1699tcp,metadata=0,in_port=0,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
1700])
1701
1702AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
1703
1704dnl Modified MPLS pop action.
1705dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as:
1706dnl 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)
1707dnl (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44)
1708dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4
1709AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
1710
1711for i in 1 2 3; do
1712 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'
1713done
1714OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1715OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1716
1717AT_CHECK([STRIP_METADATA ofctl_monitor.log], [0], [dnl
1718NXT_PACKET_IN (xid=0x0): table_id=254 cookie=0x0 total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
1719tcp,metadata=0,in_port=0,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
1720dnl
1721NXT_PACKET_IN (xid=0x0): table_id=254 cookie=0x0 total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
1722tcp,metadata=0,in_port=0,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
1723dnl
1724NXT_PACKET_IN (xid=0x0): table_id=254 cookie=0x0 total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
1725tcp,metadata=0,in_port=0,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
1726])
1727
1728AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
1729
1730dnl Modified MPLS pop action.
1731dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as:
1732dnl 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)
1733dnl (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44)
1734dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4
1735AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
1736
1737for i in 1 2 3; do
1738 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'
1739done
1740OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1741OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1742
1743AT_CHECK([STRIP_METADATA ofctl_monitor.log], [0], [dnl
1744NXT_PACKET_IN (xid=0x0): table_id=254 cookie=0x0 total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
1745tcp,metadata=0,in_port=0,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
1746dnl
1747NXT_PACKET_IN (xid=0x0): table_id=254 cookie=0x0 total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
1748tcp,metadata=0,in_port=0,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
1749dnl
1750NXT_PACKET_IN (xid=0x0): table_id=254 cookie=0x0 total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
1751tcp,metadata=0,in_port=0,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
1752])
1753
1754AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
1755
1756dnl Modified MPLS pop action.
1757dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as:
1758dnl 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)
1759dnl (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44)
1760dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4
1761AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
1762
1763for i in 1 2 3; do
1764 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'
1765done
1766OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1767OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1768
1769AT_CHECK([STRIP_METADATA ofctl_monitor.log], [0], [dnl
1770NXT_PACKET_IN (xid=0x0): table_id=254 cookie=0x0 total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
1771tcp,metadata=0,in_port=0,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
1772dnl
1773NXT_PACKET_IN (xid=0x0): table_id=254 cookie=0x0 total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
1774tcp,metadata=0,in_port=0,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
1775dnl
1776NXT_PACKET_IN (xid=0x0): table_id=254 cookie=0x0 total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
1777tcp,metadata=0,in_port=0,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
1778])
1779
1780AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
1781
1782dnl Modified MPLS pop action.
1783dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as:
1784dnl 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)
1785dnl (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44)
1786dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4
1787AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
1788
1789for i in 1 2 3; do
1790 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'
1791done
1792OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1793OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1794
1795AT_CHECK([STRIP_METADATA ofctl_monitor.log], [0], [dnl
1796NXT_PACKET_IN (xid=0x0): table_id=254 cookie=0x0 total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
1797tcp,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.106,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:76db
1798dnl
1799NXT_PACKET_IN (xid=0x0): table_id=254 cookie=0x0 total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
1800tcp,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.106,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:76db
1801dnl
1802NXT_PACKET_IN (xid=0x0): table_id=254 cookie=0x0 total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
1803tcp,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.106,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:76db
1804])
1805
1806AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
1807
1808dnl Modified MPLS pop action.
1809dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as:
1810dnl 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)
1811dnl (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44)
1812dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4
1813AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
1814
1815for i in 1 2 3; do
1816 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'
1817done
1818OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1819OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1820
1821AT_CHECK([STRIP_METADATA ofctl_monitor.log], [0], [dnl
1822NXT_PACKET_IN (xid=0x0): table_id=254 cookie=0x0 total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
1823tcp,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:00:06,dl_dst=50:54:00:00:00:07,nw_src=192.168.255.255,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7745
1824dnl
1825NXT_PACKET_IN (xid=0x0): table_id=254 cookie=0x0 total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
1826tcp,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:00:06,dl_dst=50:54:00:00:00:07,nw_src=192.168.255.255,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7745
1827dnl
1828NXT_PACKET_IN (xid=0x0): table_id=254 cookie=0x0 total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
1829tcp,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=60:66:66:66:00:06,dl_dst=50:54:00:00:00:07,nw_src=192.168.255.255,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=255,tp_src=80,tp_dst=0,tcp_flags=0 tcp_csum:7745
1830])
1831
1832AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
1833
1834dnl Modified MPLS pop action.
1835dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as:
1836dnl 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)
1837dnl (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44)
1838dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4
1839AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
1840
1841for i in 1 2 3; do
1842 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'
1843done
1844OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1845OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1846
1847AT_CHECK([STRIP_METADATA ofctl_monitor.log], [0], [dnl
1848NXT_PACKET_IN (xid=0x0): table_id=254 cookie=0x0 total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
1849tcp,metadata=0,in_port=0,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
1850dnl
1851NXT_PACKET_IN (xid=0x0): table_id=254 cookie=0x0 total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
1852tcp,metadata=0,in_port=0,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
1853dnl
1854NXT_PACKET_IN (xid=0x0): table_id=254 cookie=0x0 total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
1855tcp,metadata=0,in_port=0,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
1856])
1857
1858AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
1859
1860dnl Modified MPLS pop action.
1861dnl The input is an ARP frame with a single MPLS label stack entry which tcpdump -vve shows as:
1862dnl 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)
1863AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
1864
1865for i in 1 2 3; do
1866 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'
1867done
1868OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1869OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1870
1871AT_CHECK([STRIP_METADATA ofctl_monitor.log], [0], [dnl
1872NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0xd total_len=56 in_port=1 (via action) data_len=56 (unbuffered)
1873arp,metadata=0,in_port=0,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
1874dnl
1875NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0xd total_len=56 in_port=1 (via action) data_len=56 (unbuffered)
1876arp,metadata=0,in_port=0,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
1877dnl
1878NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0xd total_len=56 in_port=1 (via action) data_len=56 (unbuffered)
1879arp,metadata=0,in_port=0,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
1880])
1881
1882AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
1883
1884dnl Modified MPLS pop action.
1885dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as:
1886dnl 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)
1887dnl (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44)
1888dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4
1889AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
1890
1891for i in 1 2 3; do
1892 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'
1893done
1894OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1895OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1896
1897AT_CHECK([STRIP_METADATA ofctl_monitor.log], [0], [dnl
1898NXT_PACKET_IN (xid=0x0): table_id=254 cookie=0x0 total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
1899tcp,metadata=0,in_port=0,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
1900dnl
1901NXT_PACKET_IN (xid=0x0): table_id=254 cookie=0x0 total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
1902tcp,metadata=0,in_port=0,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
1903dnl
1904NXT_PACKET_IN (xid=0x0): table_id=254 cookie=0x0 total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
1905tcp,metadata=0,in_port=0,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
1906])
1907
1908AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
1909
1910dnl Modified MPLS pop action.
1911dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as:
1912dnl 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)
1913dnl (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44)
1914dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4
1915AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
1916
1917for i in 1 2 3; do
1918 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'
1919done
1920OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1921OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1922
1923AT_CHECK([STRIP_METADATA ofctl_monitor.log], [0], [dnl
1924NXT_PACKET_IN (xid=0x0): table_id=254 cookie=0x0 total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
1925tcp,metadata=0,in_port=0,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
1926dnl
1927NXT_PACKET_IN (xid=0x0): table_id=254 cookie=0x0 total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
1928tcp,metadata=0,in_port=0,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
1929dnl
1930NXT_PACKET_IN (xid=0x0): table_id=254 cookie=0x0 total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
1931tcp,metadata=0,in_port=0,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
1932])
1933
1934AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
1935
1936dnl Modified MPLS pop action.
1937dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as:
1938dnl 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)
1939dnl (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44)
1940dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4
1941AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
1942
1943for i in 1 2 3; do
1944 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'
1945done
1946OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1947OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1948
1949AT_CHECK([STRIP_METADATA ofctl_monitor.log], [0], [dnl
1950NXT_PACKET_IN (xid=0x0): table_id=254 cookie=0x0 total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
1951tcp,metadata=0,in_port=0,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
1952dnl
1953NXT_PACKET_IN (xid=0x0): table_id=254 cookie=0x0 total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
1954tcp,metadata=0,in_port=0,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
1955dnl
1956NXT_PACKET_IN (xid=0x0): table_id=254 cookie=0x0 total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
1957tcp,metadata=0,in_port=0,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
1958])
1959
1960AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
1961
1962dnl Modified MPLS pop action.
1963dnl The input is a frame with two MPLS label stack entries which tcpdump -vve shows as:
1964dnl 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)
1965dnl (label 20, exp 0, [S], ttl 31)
1966dnl (tos 0x0, ttl 254, id 0, offset 0, flags [none], proto TCP (6), length 44)
1967dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x7744 (correct), seq 42:46, win 10000, length 4
1968AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
1969
1970for i in 1 2 3; do
1971 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'
1972done
1973OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1974OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1975
1976AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1977NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
1978mplsm,metadata=0,in_port=0,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
1979dnl
1980NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
1981mplsm,metadata=0,in_port=0,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
1982dnl
1983NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
1984mplsm,metadata=0,in_port=0,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
1985])
1986
1987AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
1988
1989dnl Modified MPLS pop action.
1990dnl The input is a frame with two MPLS label stack entries which tcpdump -vve shows as:
1991dnl 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)
1992dnl (label 20, exp 0, [S], ttl 31)
1993dnl (tos 0x0, ttl 254, id 0, offset 0, flags [none], proto TCP (6), length 44)
1994dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x7744 (correct), seq 42:46, win 10000, length 4
1995AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
1996
1997for i in 1 2 3; do
1998 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'
1999done
2000OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2001OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2002
2003AT_CHECK([cat ofctl_monitor.log], [0], [dnl
2004NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2005mpls,metadata=0,in_port=0,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
2006dnl
2007NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2008mpls,metadata=0,in_port=0,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
2009dnl
2010NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2011mpls,metadata=0,in_port=0,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
2012])
2013
2014AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2015
2016dnl Modified MPLS pop action.
2017dnl The input is a frame with two MPLS label stack entries which tcpdump -vve shows as:
2018dnl 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)
2019dnl (label 20, exp 0, [S], ttl 31)
2020dnl (tos 0x0, ttl 254, id 0, offset 0, flags [none], proto TCP (6), length 44)
2021dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x7744 (correct), seq 42:46, win 10000, length 4
2022AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
2023
2024for i in 1 2 3; do
2025 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'
2026done
2027OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2028OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2029
2030AT_CHECK([cat ofctl_monitor.log], [0], [dnl
2031NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2032mplsm,metadata=0,in_port=0,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
2033dnl
2034NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2035mplsm,metadata=0,in_port=0,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
2036dnl
2037NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2038mplsm,metadata=0,in_port=0,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
2039])
2040
2041AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2042
2043dnl Modified MPLS pop action.
2044dnl The input is a frame with two MPLS label stack entries which tcpdump -vve shows as:
2045dnl 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)
2046dnl (label 20, exp 0, [S], ttl 31)
2047dnl (tos 0x0, ttl 254, id 0, offset 0, flags [none], proto TCP (6), length 44)
2048dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x7744 (correct), seq 42:46, win 10000, length 4
2049AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
2050
2051for i in 1 2 3; do
2052 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'
2053done
2054OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2055OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2056
2057AT_CHECK([cat ofctl_monitor.log], [0], [dnl
2058NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2059tcp,metadata=0,in_port=0,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
2060dnl
2061NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2062tcp,metadata=0,in_port=0,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
2063dnl
2064NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2065tcp,metadata=0,in_port=0,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
2066])
2067
2068AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2069
2070dnl Modified MPLS pop action.
2071dnl The input is a frame with two MPLS label stack entries which tcpdump -vve shows as:
2072dnl 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)
2073dnl (label 20, exp 0, [S], ttl 31)
2074dnl (tos 0x0, ttl 254, id 0, offset 0, flags [none], proto TCP (6), length 44)
2075dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x7744 (correct), seq 42:46, win 10000, length 4
2076AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
2077
2078for i in 1 2 3; do
2079 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'
2080done
2081OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2082OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2083
2084AT_CHECK([STRIP_METADATA ofctl_monitor.log], [0], [dnl
2085NXT_PACKET_IN (xid=0x0): table_id=254 cookie=0x0 total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2086tcp,metadata=0,in_port=0,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
2087dnl
2088NXT_PACKET_IN (xid=0x0): table_id=254 cookie=0x0 total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2089tcp,metadata=0,in_port=0,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
2090dnl
2091NXT_PACKET_IN (xid=0x0): table_id=254 cookie=0x0 total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2092tcp,metadata=0,in_port=0,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
2093])
2094
2095AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2096
2097dnl Modified MPLS pop action.
2098dnl The input is a frame with two MPLS label stack entries which tcpdump -vve shows as:
2099dnl 60:66:66:66:02:10 > 50:54:00:00:02:10, ethertype MPLS unicast (0x8847), length 66: MPLS (label 20, exp 0, ttl 32)
2100dnl (label 20, exp 0, [S], ttl 31)
2101dnl (tos 0x0, ttl 254, id 0, offset 0, flags [none], proto TCP (6), length 44)
2102dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x7744 (correct), seq 42:46, win 10000, length 4
2103AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
2104
2105for i in 1 2 3; do
2106 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'
2107done
2108OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2109OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2110
2111AT_CHECK([STRIP_METADATA ofctl_monitor.log], [0], [dnl
2112NXT_PACKET_IN (xid=0x0): table_id=254 cookie=0x0 total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2113tcp,metadata=0,in_port=0,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
2114dnl
2115NXT_PACKET_IN (xid=0x0): table_id=254 cookie=0x0 total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2116tcp,metadata=0,in_port=0,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
2117dnl
2118NXT_PACKET_IN (xid=0x0): table_id=254 cookie=0x0 total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2119tcp,metadata=0,in_port=0,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
2120])
2121
2122AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2123
2124dnl Modified MPLS pop action.
2125dnl The input is a frame with three MPLS label stack entries which tcpdump -vve shows as:
2126dnl 60:66:66:66:03:00 > 50:54:00:00:00:00, ethertype MPLS unicast (0x8847), length 66: MPLS (label 20, exp 0, ttl 32)
2127dnl (label 20, exp 0, ttl 31)
2128dnl (label 20, exp 0, [S], ttl 30)
2129dnl (tos 0x0, ttl 254, id 0, offset 0, flags [none], proto TCP (6), length 44)
2130dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x7744 (correct), seq 42:46, win 10000, length 4
2131AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
2132
2133for i in 1 2 3; do
2134 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'
2135done
2136OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2137OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2138
2139AT_CHECK([cat ofctl_monitor.log], [0], [dnl
2140NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2141mplsm,metadata=0,in_port=0,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
2142dnl
2143NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2144mplsm,metadata=0,in_port=0,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
2145dnl
2146NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2147mplsm,metadata=0,in_port=0,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
2148])
2149
2150AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2151
2152dnl Modified MPLS pop action.
2153dnl The input is a frame with three MPLS label stack entries which tcpdump -vve shows as:
2154dnl 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)
2155dnl (label 20, exp 0, ttl 31)
2156dnl (label 20, exp 0, [S], ttl 30)
2157dnl (tos 0x0, ttl 254, id 0, offset 0, flags [none], proto TCP (6), length 44)
2158dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x7744 (correct), seq 42:46, win 10000, length 4
2159AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
2160
2161for i in 1 2 3; do
2162 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'
2163done
2164OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2165OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2166
2167AT_CHECK([cat ofctl_monitor.log], [0], [dnl
2168NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2169mpls,metadata=0,in_port=0,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
2170dnl
2171NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2172mpls,metadata=0,in_port=0,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
2173dnl
2174NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2175mpls,metadata=0,in_port=0,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
2176])
2177
2178AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2179
2180dnl Modified MPLS pop action.
2181dnl The input is a frame with three MPLS label stack entries which tcpdump -vve shows as:
2182dnl 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)
2183dnl (label 20, exp 0, ttl 31)
2184dnl (label 20, exp 0, [S], ttl 30)
2185dnl (tos 0x0, ttl 254, id 0, offset 0, flags [none], proto TCP (6), length 44)
2186dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x7744 (correct), seq 42:46, win 10000, length 4
2187AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
2188
2189for i in 1 2 3; do
2190 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'
2191done
2192OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2193OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2194
2195AT_CHECK([cat ofctl_monitor.log], [0], [dnl
2196NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2197mplsm,metadata=0,in_port=0,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
2198dnl
2199NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2200mplsm,metadata=0,in_port=0,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
2201dnl
2202NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2203mplsm,metadata=0,in_port=0,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
2204])
2205
2206AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2207
2208dnl Modified MPLS pop action.
2209dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as:
2210dnl 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)
2211dnl (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44)
2212dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4
2213AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
2214
2215for i in 1 2 3; do
2216 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'
2217done
2218OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2219OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2220
2221AT_CHECK([STRIP_METADATA ofctl_monitor.log], [0], [dnl
2222NXT_PACKET_IN (xid=0x0): table_id=254 cookie=0x0 total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2223mpls,metadata=0,in_port=0,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
2224dnl
2225NXT_PACKET_IN (xid=0x0): table_id=254 cookie=0x0 total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2226mpls,metadata=0,in_port=0,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
2227dnl
2228NXT_PACKET_IN (xid=0x0): table_id=254 cookie=0x0 total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2229mpls,metadata=0,in_port=0,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
2230])
2231
2232AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2233
2234dnl Modified MPLS pop action.
2235dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as:
2236dnl 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)
2237dnl (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44)
2238dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4
2239AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
2240
2241for i in 1 2 3; do
2242 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'
2243done
2244OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2245OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2246
2247AT_CHECK([STRIP_METADATA ofctl_monitor.log], [0], [dnl
2248NXT_PACKET_IN (xid=0x0): table_id=254 cookie=0x0 total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2249mplsm,metadata=0,in_port=0,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
2250dnl
2251NXT_PACKET_IN (xid=0x0): table_id=254 cookie=0x0 total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2252mplsm,metadata=0,in_port=0,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
2253dnl
2254NXT_PACKET_IN (xid=0x0): table_id=254 cookie=0x0 total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2255mplsm,metadata=0,in_port=0,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
2256])
2257
2258AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2259
2260dnl Modified MPLS pop action.
2261dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as:
2262dnl 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)
2263dnl (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44)
2264dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4
2265AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
2266
2267for i in 1 2 3; do
2268 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'
2269done
2270OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2271OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2272
2273AT_CHECK([STRIP_METADATA ofctl_monitor.log], [0], [dnl
2274NXT_PACKET_IN (xid=0x0): table_id=254 cookie=0x0 total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2275mplsm,metadata=0,in_port=0,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
2276dnl
2277NXT_PACKET_IN (xid=0x0): table_id=254 cookie=0x0 total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2278mplsm,metadata=0,in_port=0,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
2279dnl
2280NXT_PACKET_IN (xid=0x0): table_id=254 cookie=0x0 total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2281mplsm,metadata=0,in_port=0,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
2282])
2283
2284AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2285
2286dnl Modified MPLS pop action.
2287dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as:
2288dnl 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)
2289dnl (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44)
2290dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4
2291AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
2292
2293for i in 1 2 3; do
2294 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'
2295done
2296OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2297OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2298
2299AT_CHECK([cat ofctl_monitor.log], [0], [dnl
2300NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2301mpls,metadata=0,in_port=0,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
2302dnl
2303NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2304mpls,metadata=0,in_port=0,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
2305dnl
2306NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2307mpls,metadata=0,in_port=0,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
2308])
2309
2310AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2311
2312dnl Modified MPLS pop action.
2313dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as:
2314dnl 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)
2315dnl (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44)
2316dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4
2317AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
2318
2319for i in 1 2 3; do
2320 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'
2321done
2322OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2323OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2324
2325AT_CHECK([cat ofctl_monitor.log], [0], [dnl
2326NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2327mplsm,metadata=0,in_port=0,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
2328dnl
2329NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2330mplsm,metadata=0,in_port=0,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
2331dnl
2332NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2333mplsm,metadata=0,in_port=0,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
2334])
2335
2336AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2337
2338dnl Modified MPLS pop action.
2339dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as:
2340dnl 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)
2341dnl (tos 0x0, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44)
2342dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4
2343AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
2344
2345for i in 1 2 3; do
2346 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'
2347done
2348OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2349OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2350
2351AT_CHECK([cat ofctl_monitor.log], [0], [dnl
2352NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2353mpls,metadata=0,in_port=0,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
2354dnl
2355NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2356mpls,metadata=0,in_port=0,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
2357dnl
2358NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=62 in_port=1 (via action) data_len=62 (unbuffered)
2359mpls,metadata=0,in_port=0,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
2360])
2361
2362AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2363AT_CHECK([ovs-appctl revalidator/wait], [0], [ignore])
2364
2365AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
2366 cookie=0xa, n_packets=3, n_bytes=180, dl_src=40:44:44:44:44:42 actions=push_mpls:0x8847,load:0xa->OXM_OF_MPLS_LABEL[[]],load:0x3->OXM_OF_MPLS_TC[[]],CONTROLLER:65535
2367 cookie=0xa, n_packets=3, n_bytes=180, dl_src=40:44:44:44:44:43 actions=push_mpls:0x8847,load:0xa->OXM_OF_MPLS_LABEL[[]],load:0x3->OXM_OF_MPLS_TC[[]],CONTROLLER:65535
2368 cookie=0xa, n_packets=3, n_bytes=180, dl_src=40:44:44:44:44:44 actions=push_mpls:0x8847,load:0xa->OXM_OF_MPLS_LABEL[[]],load:0x3->OXM_OF_MPLS_TC[[]],CONTROLLER:65535
2369 cookie=0xa, n_packets=3, n_bytes=180, dl_src=40:44:44:44:44:45 actions=push_mpls:0x8847,load:0xa->OXM_OF_MPLS_LABEL[[]],load:0x3->OXM_OF_MPLS_TC[[]],dec_mpls_ttl,CONTROLLER:65535
2370 cookie=0xa, n_packets=3, n_bytes=180, dl_src=40:44:44:44:44:46 actions=push_mpls:0x8847,load:0xa->OXM_OF_MPLS_LABEL[[]],load:0x3->OXM_OF_MPLS_TC[[]],set_mpls_ttl(10),CONTROLLER:65535
2371 cookie=0xa, n_packets=3, n_bytes=180, dl_src=40:44:44:44:44:47 actions=push_mpls:0x8847,load:0xa->OXM_OF_MPLS_LABEL[[]],load:0x3->OXM_OF_MPLS_TC[[]],dec_mpls_ttl,set_mpls_ttl(10),CONTROLLER:65535
2372 cookie=0xa, n_packets=3, n_bytes=180, dl_src=40:44:44:44:44:48 actions=push_mpls:0x8847,load:0xa->OXM_OF_MPLS_LABEL[[]],load:0x3->OXM_OF_MPLS_TC[[]],set_mpls_ttl(10),dec_mpls_ttl,CONTROLLER:65535
2373 cookie=0xa, n_packets=3, n_bytes=180, dl_src=41:44:44:44:44:42 actions=push_mpls:0x8847,load:0xa->OXM_OF_MPLS_LABEL[[]],load:0x3->OXM_OF_MPLS_TC[[]],pop_mpls:0x0800,CONTROLLER:65535
2374 cookie=0xa, n_packets=3, n_bytes=180, mpls,dl_src=40:44:44:44:44:49 actions=push_mpls:0x8848,load:0xa->OXM_OF_MPLS_LABEL[[]],CONTROLLER:65535
2375 cookie=0xb, n_packets=3, n_bytes=180, mpls,dl_src=50:55:55:55:55:55 actions=load:0x3e8->OXM_OF_MPLS_LABEL[[]],CONTROLLER:65535
2376 cookie=0xc, n_packets=3, n_bytes=180, dl_src=70:77:77:77:77:77 actions=push_mpls:0x8848,load:0x3e8->OXM_OF_MPLS_LABEL[[]],load:0x7->OXM_OF_MPLS_TC[[]],CONTROLLER:65535
2377 cookie=0xd, n_packets=3, n_bytes=180, dl_src=60:66:66:66:00:08 actions=pop_mpls:0x0806,resubmit(1,1)
2378 cookie=0xd, n_packets=3, n_bytes=186, dl_src=60:66:66:66:00:01 actions=pop_mpls:0x0800,dec_ttl,CONTROLLER:65535
2379 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
2380 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
2381 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
2382 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,256,0,NXM_OF_IP_SRC[[0..7]]),CONTROLLER:65535
2383 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
2384 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
2385 cookie=0xd, n_packets=3, n_bytes=186, dl_src=60:66:66:66:00:09 actions=pop_mpls:0x0800,mod_nw_tos:48,CONTROLLER:65535
2386 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
2387 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
2388 cookie=0xd, n_packets=3, n_bytes=186, dl_src=60:66:66:66:04:00 actions=pop_mpls:0x0800,push_mpls:0x8847,CONTROLLER:65535
2389 cookie=0xd, 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
2390 cookie=0xd, 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
2391 cookie=0xd, n_packets=3, n_bytes=186, dl_src=60:66:66:66:05:00 actions=push_mpls:0x8848,pop_mpls:0x8847,CONTROLLER:65535
2392 cookie=0xd, 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
2393 cookie=0xd, 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
2394 cookie=0xd, n_packets=3, n_bytes=186, dl_src=60:66:66:66:66:66 actions=pop_mpls:0x0800,CONTROLLER:65535
2395 cookie=0xd, n_packets=3, n_bytes=198, dl_src=60:66:66:66:01:00 actions=pop_mpls:0x8848,CONTROLLER:65535
2396 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
2397 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
2398 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
2399 cookie=0xd, 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
2400 cookie=0xd, 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
2401 cookie=0xd, n_packets=3, n_bytes=210, dl_src=60:66:66:66:03:00 actions=pop_mpls:0x8848,pop_mpls:0x8848,CONTROLLER:65535
2402 cookie=0xd, 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
2403 cookie=0xd, 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
2404 cookie=0xd, table=1, n_packets=3, n_bytes=168, arp actions=CONTROLLER:65535
2405NXST_FLOW reply:
2406])
2407
2408OVS_VSWITCHD_STOP
2409AT_CLEANUP
2410
2411AT_SETUP([ofproto-dpif - MPLS handling with goto_table])
2412OVS_VSWITCHD_START([dnl
2413 add-port br0 p1 -- set Interface p1 type=dummy
2414])
2415ON_EXIT([kill `cat ovs-ofctl.pid`])
2416
2417AT_CAPTURE_FILE([ofctl_monitor.log])
2418AT_DATA([flows.txt], [dnl
2419table=0 mplsm actions=pop_mpls:0x800,goto_table(1)
2420table=1 ip,ip_dscp=8 actions=controller
2421])
2422AT_CHECK([ovs-ofctl -O OpenFlow12 add-flows br0 flows.txt])
2423
2424
2425dnl Modified MPLS pop action.
2426dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as:
2427dnl 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)
2428dnl (tos 0x20, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44)
2429dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4
2430AT_CHECK([ovs-ofctl -O OpenFlow12 monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
2431
2432for i in 1 2 3; do
2433 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'
2434done
2435OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2436OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2437
2438AT_CHECK([STRIP_METADATA ofctl_monitor.log], [0], [dnl
2439OFPT_PACKET_IN (OF1.2) (xid=0x0): table_id=1 total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2440tcp,metadata=0,in_port=0,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
2441dnl
2442OFPT_PACKET_IN (OF1.2) (xid=0x0): table_id=1 total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2443tcp,metadata=0,in_port=0,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
2444dnl
2445OFPT_PACKET_IN (OF1.2) (xid=0x0): table_id=1 total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2446tcp,metadata=0,in_port=0,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
2447])
2448
2449AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2450
2451AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
2452 n_packets=3, n_bytes=186, mplsm actions=pop_mpls:0x0800,goto_table:1
2453 table=1, n_packets=3, n_bytes=174, ip,nw_tos=32 actions=CONTROLLER:65535
2454OFPST_FLOW reply (OF1.2):
2455])
2456
2457OVS_VSWITCHD_STOP
2458AT_CLEANUP
2459
2460AT_SETUP([ofproto-dpif - MPLS handling with write_actions])
2461OVS_VSWITCHD_START([dnl
2462 add-port br0 p1 -- set Interface p1 type=dummy
2463])
2464ON_EXIT([kill `cat ovs-ofctl.pid`])
2465
2466dnl N.B: The first (and only) action that accesses L3 data after the
2467dnl pop_mpls action is present in write_actions. This exercises recirculation
2468dnl triggered in write_actions due to a previous action not in write actions.
2469AT_CAPTURE_FILE([ofctl_monitor.log])
2470AT_DATA([flows.txt], [dnl
2471mplsm actions=pop_mpls:0x800,write_actions(dec_ttl,controller)
2472])
2473AT_CHECK([ovs-ofctl -O OpenFlow12 add-flows br0 flows.txt])
2474
2475dnl Modified MPLS pop action.
2476dnl The input is a frame with a single MPLS label stack entry which tcpdump -vve shows as:
2477dnl 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)
2478dnl (tos 0x20, ttl 255, id 0, offset 0, flags [none], proto TCP (6), length 44)
2479dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x77ec (correct), seq 42:46, win 10000, length 4
2480AT_CHECK([ovs-ofctl -O OpenFlow12 monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
2481
2482for i in 1 2 3; do
2483 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'
2484done
2485OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2486OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2487
2488AT_CHECK([STRIP_METADATA ofctl_monitor.log], [0], [dnl
2489OFPT_PACKET_IN (OF1.2) (xid=0x0): table_id=254 total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2490tcp,metadata=0,in_port=0,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
2491dnl
2492OFPT_PACKET_IN (OF1.2) (xid=0x0): table_id=254 total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2493tcp,metadata=0,in_port=0,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
2494dnl
2495OFPT_PACKET_IN (OF1.2) (xid=0x0): table_id=254 total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
2496tcp,metadata=0,in_port=0,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
2497])
2498
2499AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2500
2501AT_CHECK([ovs-ofctl -O OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
2502 n_packets=3, n_bytes=186, mplsm actions=pop_mpls:0x0800,write_actions(dec_ttl,CONTROLLER:65535)
2503OFPST_FLOW reply (OF1.2):
2504])
2505
2506OVS_VSWITCHD_STOP
2507AT_CLEANUP
2508
2509AT_SETUP([ofproto-dpif - table-miss flow (OpenFlow 1.0)])
2510OVS_VSWITCHD_START([dnl
2511 add-port br0 p1 -- set Interface p1 type=dummy
2512])
2513ON_EXIT([kill `cat ovs-ofctl.pid`])
2514
2515AT_CAPTURE_FILE([ofctl_monitor.log])
2516# A table-miss flow has priority 0 and no match
2517AT_CHECK([ovs-ofctl --protocols=OpenFlow10 add-flow br0 'priority=0 actions=output:CONTROLLER'])
2518
2519dnl Singleton controller action.
2520AT_CHECK([ovs-ofctl monitor -P openflow10 --protocols=OpenFlow10 br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
2521
2522for i in 1 2 3 ; do
2523 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)'
2524done
2525OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2526ovs-appctl -t ovs-ofctl exit
2527
2528AT_CHECK([cat ofctl_monitor.log], [0], [dnl
2529OFPT_PACKET_IN (xid=0x0): total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
2530tcp,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:0
2531dnl
2532OFPT_PACKET_IN (xid=0x0): total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
2533tcp,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:0
2534dnl
2535OFPT_PACKET_IN (xid=0x0): total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
2536tcp,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:0
2537])
2538
2539AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2540AT_CHECK([ovs-appctl revalidator/wait], [0], [ignore])
2541
2542AT_CHECK([ovs-ofctl --protocols=OpenFlow10 dump-flows br0 | ofctl_strip | sort], [0], [dnl
2543 n_packets=3, n_bytes=180, priority=0 actions=CONTROLLER:65535
2544NXST_FLOW reply:
2545])
2546
2547OVS_VSWITCHD_STOP
2548AT_CLEANUP
2549
2550
2551AT_SETUP([ofproto-dpif - table-miss flow (OpenFlow 1.3)])
2552OVS_VSWITCHD_START([dnl
2553 add-port br0 p1 -- set Interface p1 type=dummy
2554])
2555ON_EXIT([kill `cat ovs-ofctl.pid`])
2556
2557AT_CAPTURE_FILE([ofctl_monitor.log])
2558# A table-miss flow has priority 0 and no match
2559AT_CHECK([ovs-ofctl --protocols=OpenFlow13 add-flow br0 'priority=0 actions=output:CONTROLLER'])
2560
2561dnl Singleton controller action.
2562AT_CHECK([ovs-ofctl monitor -P openflow10 --protocols=OpenFlow13 br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
2563
2564for i in 1 2 3 ; do
2565 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)'
2566done
2567OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
2568ovs-appctl -t ovs-ofctl exit
2569
2570AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2571
2572AT_CHECK([cat ofctl_monitor.log], [0], [dnl
2573OFPT_PACKET_IN (OF1.3) (xid=0x0): cookie=0x0 total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
2574tcp,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:0
2575dnl
2576OFPT_PACKET_IN (OF1.3) (xid=0x0): cookie=0x0 total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
2577tcp,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:0
2578dnl
2579OFPT_PACKET_IN (OF1.3) (xid=0x0): cookie=0x0 total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
2580tcp,metadata=0,in_port=0,vlan_tci=0x0000,dl_src=10:11:11:11:11:11,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=64,tp_src=8,tp_dst=10,tcp_flags=syn tcp_csum:0
2581])
2582
2583AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2584
2585AT_CHECK([ovs-ofctl --protocols=OpenFlow13 dump-flows br0 | ofctl_strip | sort], [0], [dnl
2586 n_packets=3, n_bytes=180, priority=0 actions=CONTROLLER:65535
2587OFPST_FLOW reply (OF1.3):
2588])
2589
2590OVS_VSWITCHD_STOP
2591AT_CLEANUP
2592
2593AT_SETUP([ofproto-dpif - ARP modification slow-path])
2594OVS_VSWITCHD_START
2595ADD_OF_PORTS([br0], [1], [2])
2596
2597ovs-vsctl -- set Interface p2 type=dummy options:pcap=p2.pcap
2598ovs-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'
2599
2600# Input some packets that should follow the arp modification slow-path.
2601for i in 1 2 3; do
2602 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)'
2603done
2604AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2605
2606# Check the packets that were output.
2607AT_CHECK([ovs-ofctl parse-pcap p2.pcap], [0], [dnl
2608arp,metadata=0,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
2609arp,metadata=0,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
2610arp,metadata=0,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
2611arp,metadata=0,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
2612arp,metadata=0,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
2613arp,metadata=0,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
2614arp,metadata=0,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
2615arp,metadata=0,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
2616arp,metadata=0,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
2617])
2618
2619OVS_VSWITCHD_STOP
2620AT_CLEANUP
2621
2622AT_SETUP([ofproto-dpif - VLAN handling])
2623OVS_VSWITCHD_START(
2624 [set Bridge br0 fail-mode=standalone -- \
2625 add-port br0 p1 trunks=10,12 -- \
2626 add-port br0 p2 tag=10 -- \
2627 add-port br0 p3 tag=12 \
2628 other-config:priority-tags=true -- \
2629 add-port br0 p4 tag=12 -- \
2630 add-port br0 p5 vlan_mode=native-tagged tag=10 -- \
2631 add-port br0 p6 vlan_mode=native-tagged tag=10 trunks=10,12 -- \
2632 add-port br0 p7 vlan_mode=native-untagged tag=12 -- \
2633 add-port br0 p8 vlan_mode=native-untagged tag=12 trunks=10,12 \
2634 other-config:priority-tags=true -- \
2635 set Interface p1 type=dummy -- \
2636 set Interface p2 type=dummy -- \
2637 set Interface p3 type=dummy -- \
2638 set Interface p4 type=dummy -- \
2639 set Interface p5 type=dummy -- \
2640 set Interface p6 type=dummy -- \
2641 set Interface p7 type=dummy -- \
2642 set Interface p8 type=dummy --])
2643
2644dnl Each of these specifies an in_port by number, a VLAN VID (or "none"),
2645dnl a VLAN PCP (used if the VID isn't "none") and the expected set of datapath
2646dnl actions.
2647for tuple in \
2648 "100 none 0 drop" \
2649 "100 0 0 drop" \
2650 "100 0 1 drop" \
2651 "100 10 0 1,5,6,7,8,pop_vlan,2" \
2652 "100 10 1 1,5,6,7,8,pop_vlan,2" \
2653 "100 11 0 5,7" \
2654 "100 11 1 5,7" \
2655 "100 12 0 1,5,6,pop_vlan,3,4,7,8" \
2656 "100 12 1 1,5,6,pop_vlan,4,7,push_vlan(vid=0,pcp=1),3,8" \
2657 "1 none 0 drop" \
2658 "1 0 0 drop" \
2659 "1 0 1 drop" \
2660 "1 10 0 5,6,7,8,100,pop_vlan,2" \
2661 "1 10 1 5,6,7,8,100,pop_vlan,2" \
2662 "1 11 0 drop" \
2663 "1 11 1 drop" \
2664 "1 12 0 5,6,100,pop_vlan,3,4,7,8" \
2665 "1 12 1 5,6,100,pop_vlan,4,7,push_vlan(vid=0,pcp=1),3,8" \
2666 "2 none 0 push_vlan(vid=10,pcp=0),1,5,6,7,8,100" \
2667 "2 0 0 pop_vlan,push_vlan(vid=10,pcp=0),1,5,6,7,8,100" \
2668 "2 0 1 pop_vlan,push_vlan(vid=10,pcp=1),1,5,6,7,8,100" \
2669 "2 10 0 drop" \
2670 "2 10 1 drop" \
2671 "2 11 0 drop" \
2672 "2 11 1 drop" \
2673 "2 12 0 drop" \
2674 "2 12 1 drop" \
2675 "3 none 0 4,7,8,push_vlan(vid=12,pcp=0),1,5,6,100" \
2676 "3 0 0 pop_vlan,4,7,8,push_vlan(vid=12,pcp=0),1,5,6,100" \
2677 "3 0 1 8,pop_vlan,4,7,push_vlan(vid=12,pcp=1),1,5,6,100" \
2678 "3 10 0 drop" \
2679 "3 10 1 drop" \
2680 "3 11 0 drop" \
2681 "3 11 1 drop" \
2682 "3 12 0 drop" \
2683 "3 12 1 drop" \
2684 "4 none 0 3,7,8,push_vlan(vid=12,pcp=0),1,5,6,100" \
2685 "4 0 0 pop_vlan,3,7,8,push_vlan(vid=12,pcp=0),1,5,6,100" \
2686 "4 0 1 3,8,pop_vlan,7,push_vlan(vid=12,pcp=1),1,5,6,100" \
2687 "4 10 0 drop" \
2688 "4 10 1 drop" \
2689 "4 11 0 drop" \
2690 "4 11 1 drop" \
2691 "4 12 0 drop" \
2692 "4 12 1 drop" \
2693 "5 none 0 2,push_vlan(vid=10,pcp=0),1,6,7,8,100" \
2694 "5 0 0 pop_vlan,2,push_vlan(vid=10,pcp=0),1,6,7,8,100" \
2695 "5 0 1 pop_vlan,2,push_vlan(vid=10,pcp=1),1,6,7,8,100" \
2696 "5 10 0 1,6,7,8,100,pop_vlan,2" \
2697 "5 10 1 1,6,7,8,100,pop_vlan,2" \
2698 "5 11 0 7,100" \
2699 "5 11 1 7,100" \
2700 "5 12 0 1,6,100,pop_vlan,3,4,7,8" \
2701 "5 12 1 1,6,100,pop_vlan,4,7,push_vlan(vid=0,pcp=1),3,8" \
2702 "6 none 0 2,push_vlan(vid=10,pcp=0),1,5,7,8,100" \
2703 "6 0 0 pop_vlan,2,push_vlan(vid=10,pcp=0),1,5,7,8,100" \
2704 "6 0 1 pop_vlan,2,push_vlan(vid=10,pcp=1),1,5,7,8,100" \
2705 "6 10 0 1,5,7,8,100,pop_vlan,2" \
2706 "6 10 1 1,5,7,8,100,pop_vlan,2" \
2707 "6 11 0 drop" \
2708 "6 11 1 drop" \
2709 "6 12 0 1,5,100,pop_vlan,3,4,7,8" \
2710 "6 12 1 1,5,100,pop_vlan,4,7,push_vlan(vid=0,pcp=1),3,8" \
2711 "7 none 0 3,4,8,push_vlan(vid=12,pcp=0),1,5,6,100" \
2712 "7 0 0 pop_vlan,3,4,8,push_vlan(vid=12,pcp=0),1,5,6,100" \
2713 "7 0 1 3,8,pop_vlan,4,push_vlan(vid=12,pcp=1),1,5,6,100" \
2714 "7 10 0 1,5,6,8,100,pop_vlan,2" \
2715 "7 10 1 1,5,6,8,100,pop_vlan,2" \
2716 "7 11 0 5,100" \
2717 "7 11 1 5,100" \
2718 "7 12 0 1,5,6,100,pop_vlan,3,4,8" \
2719 "7 12 1 1,5,6,100,pop_vlan,4,push_vlan(vid=0,pcp=1),3,8" \
2720 "8 none 0 3,4,7,push_vlan(vid=12,pcp=0),1,5,6,100" \
2721 "8 0 0 pop_vlan,3,4,7,push_vlan(vid=12,pcp=0),1,5,6,100" \
2722 "8 0 1 3,pop_vlan,4,7,push_vlan(vid=12,pcp=1),1,5,6,100" \
2723 "8 10 0 1,5,6,7,100,pop_vlan,2" \
2724 "8 10 1 1,5,6,7,100,pop_vlan,2" \
2725 "8 11 0 drop" \
2726 "8 11 1 drop" \
2727 "8 12 0 1,5,6,100,pop_vlan,3,4,7" \
2728 "8 12 1 1,5,6,100,pop_vlan,4,7,push_vlan(vid=0,pcp=1),3"
2729do
2730 set $tuple
2731 in_port=$1
2732 vlan=$2
2733 pcp=$3
2734 expected=$4
2735
2736 if test $vlan = none; then
2737 flow="in_port($in_port),eth(src=50:54:00:00:00:01,dst=ff:ff:ff:ff:ff:ff),eth_type(0xabcd)"
2738 else
2739 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))"
2740 fi
2741
2742 echo "----------------------------------------------------------------------"
2743 echo "in_port=$in_port vlan=$vlan pcp=$pcp"
2744
2745 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
2746 actual=`tail -1 stdout | sed 's/Datapath actions: //'`
2747
2748 AT_CHECK([ovs-dpctl normalize-actions "$flow" "$expected"], [0], [stdout])
2749 mv stdout expout
2750 AT_CHECK([ovs-dpctl normalize-actions "$flow" "$actual"], [0], [expout])
2751done
2752
2753OVS_VSWITCHD_STOP
2754AT_CLEANUP
2755
2756AT_SETUP([ofproto-dpif - MPLS handling])
2757OVS_VSWITCHD_START([dnl
2758 add-port br0 p1 -- set Interface p1 type=dummy
2759])
2760ON_EXIT([kill `cat ovs-ofctl.pid`])
2761
2762AT_CAPTURE_FILE([ofctl_monitor.log])
2763AT_DATA([flows.txt], [dnl
2764dl_src=40:44:44:44:00:00 actions=push_mpls:0x8847,controller
2765dl_src=40:44:44:44:00:01,mpls actions=push_mpls:0x8847,controller
2766dl_src=40:44:44:44:00:02,mpls actions=push_mpls:0x8848,controller
2767])
2768AT_CHECK([ovs-ofctl --protocols=OpenFlow12 add-flows br0 flows.txt])
2769
2770dnl In this test, we push an MPLS tag to an ethernet packet.
2771AT_CHECK([ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P nxm --detach --pidfile 2> ofctl_monitor.log])
2772
2773for i in 1 2 3; do
2774 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)'
2775done
2776OVS_WAIT_UNTIL([test `grep OFPT_PACKET_IN ofctl_monitor.log | wc -l` -ge 3])
2777OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2778
2779AT_CHECK([cat ofctl_monitor.log | ofctl_strip], [0], [dnl
2780OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
2781mpls,metadata=0,in_port=0,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
278200000000 50 54 00 00 00 07 40 44-44 44 00 00 88 47 00 00
278300000010 01 40 45 00 00 28 00 00-00 00 40 06 f9 7c c0 a8
278400000020 00 01 c0 a8 00 02 00 00-00 00 00 00 00 00 00 00
278500000030 00 00 50 00 00 00 00 00-00 00 00 00 00 00 00 00
2786dnl
2787OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
2788mpls,metadata=0,in_port=0,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
278900000000 50 54 00 00 00 07 40 44-44 44 00 00 88 47 00 00
279000000010 01 40 45 00 00 28 00 00-00 00 40 06 f9 7c c0 a8
279100000020 00 01 c0 a8 00 02 00 00-00 00 00 00 00 00 00 00
279200000030 00 00 50 00 00 00 00 00-00 00 00 00 00 00 00 00
2793dnl
2794OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
2795mpls,metadata=0,in_port=0,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
279600000000 50 54 00 00 00 07 40 44-44 44 00 00 88 47 00 00
279700000010 01 40 45 00 00 28 00 00-00 00 40 06 f9 7c c0 a8
279800000020 00 01 c0 a8 00 02 00 00-00 00 00 00 00 00 00 00
279900000030 00 00 50 00 00 00 00 00-00 00 00 00 00 00 00 00
2800])
2801
2802dnl In this test, we push an MPLS tag to an MPLS packet. The LSE should be
2803dnl copied exactly, except for the BOS bit.
2804AT_CHECK([ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P nxm --detach --pidfile 2> ofctl_monitor.log])
2805
2806for i in 1 2 3; do
2807 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)'
2808done
2809OVS_WAIT_UNTIL([test `grep OFPT_PACKET_IN ofctl_monitor.log | wc -l` -ge 3])
2810OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2811
2812AT_CHECK([cat ofctl_monitor.log | ofctl_strip], [0], [dnl
2813OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
2814mpls,metadata=0,in_port=0,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
281500000000 50 54 00 00 00 07 40 44-44 44 00 01 88 47 00 00
281600000010 a0 40 00 00 a1 40 00 00-00 00 00 00 00 00 00 00
281700000020 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00
281800000030 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00
2819dnl
2820OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
2821mpls,metadata=0,in_port=0,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
282200000000 50 54 00 00 00 07 40 44-44 44 00 01 88 47 00 00
282300000010 a0 40 00 00 a1 40 00 00-00 00 00 00 00 00 00 00
282400000020 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00
282500000030 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00
2826dnl
2827OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
2828mpls,metadata=0,in_port=0,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
282900000000 50 54 00 00 00 07 40 44-44 44 00 01 88 47 00 00
283000000010 a0 40 00 00 a1 40 00 00-00 00 00 00 00 00 00 00
283100000020 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00
283200000030 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00
2833])
2834
2835dnl In this test, we push an MPLS tag to an MPLS packet. The LSE should be
2836dnl copied exactly, except for the BOS bit. The ethertype should be updated
2837dnl to the MPLS ethertype of the MPLS push action which differs to that
2838dnl of the input packet.
2839AT_CHECK([ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P nxm --detach --pidfile 2> ofctl_monitor.log])
2840
2841for i in 1 2 3; do
2842 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)'
2843done
2844OVS_WAIT_UNTIL([test `grep OFPT_PACKET_IN ofctl_monitor.log | wc -l` -ge 3])
2845OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
2846
2847AT_CHECK([cat ofctl_monitor.log | ofctl_strip], [0], [dnl
2848OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
2849mplsm,metadata=0,in_port=0,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
285000000000 50 54 00 00 00 07 40 44-44 44 00 02 88 48 00 00
285100000010 a0 40 00 00 a1 40 00 00-00 00 00 00 00 00 00 00
285200000020 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00
285300000030 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00
2854dnl
2855OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
2856mplsm,metadata=0,in_port=0,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
285700000000 50 54 00 00 00 07 40 44-44 44 00 02 88 48 00 00
285800000010 a0 40 00 00 a1 40 00 00-00 00 00 00 00 00 00 00
285900000020 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00
286000000030 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00
2861dnl
2862OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
2863mplsm,metadata=0,in_port=0,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
286400000000 50 54 00 00 00 07 40 44-44 44 00 02 88 48 00 00
286500000010 a0 40 00 00 a1 40 00 00-00 00 00 00 00 00 00 00
286600000020 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00
286700000030 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00
2868])
2869
2870OVS_VSWITCHD_STOP
2871AT_CLEANUP
2872
2873AT_SETUP([ofproto-dpif - VLAN+MPLS handling])
2874OVS_VSWITCHD_START([dnl
2875 add-port br0 p1 -- set Interface p1 type=dummy
2876])
2877ON_EXIT([kill `cat ovs-ofctl.pid`])
2878
2879AT_CAPTURE_FILE([ofctl_monitor.log])
2880AT_DATA([flows.txt], [dnl
2881cookie=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
2882cookie=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
2883cookie=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
2884cookie=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
2885cookie=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
2886cookie=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
2887cookie=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
2888cookie=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
2889cookie=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
2890cookie=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
2891])
2892AT_CHECK([ovs-ofctl --protocols=OpenFlow12 add-flows br0 flows.txt])
2893
2894dnl Modified MPLS controller action.
2895dnl In this test, we push the MPLS tag before pushing a VLAN tag, so we see
2896dnl both of these in the final flow
2897AT_CHECK([ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P nxm --detach --pidfile 2> ofctl_monitor.log])
2898
2899for i in 1 2 3; do
2900 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)'
2901done
2902OVS_WAIT_UNTIL([test `grep OFPT_PACKET_IN ofctl_monitor.log | wc -l` -ge 3])
2903OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2904
2905AT_CHECK([cat ofctl_monitor.log | ofctl_strip], [0], [dnl
2906OFPT_PACKET_IN (OF1.2): total_len=68 in_port=1 (via action) data_len=68 (unbuffered)
2907mpls,metadata=0,in_port=0,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:50,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1
290800000000 50 54 00 00 00 07 40 44-44 44 54 50 81 00 20 63
290900000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
291000000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
291100000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
291200000040 00 00 00 00
2913dnl
2914OFPT_PACKET_IN (OF1.2): total_len=68 in_port=1 (via action) data_len=68 (unbuffered)
2915mpls,metadata=0,in_port=0,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:50,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1
291600000000 50 54 00 00 00 07 40 44-44 44 54 50 81 00 20 63
291700000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
291800000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
291900000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
292000000040 00 00 00 00
2921dnl
2922OFPT_PACKET_IN (OF1.2): total_len=68 in_port=1 (via action) data_len=68 (unbuffered)
2923mpls,metadata=0,in_port=0,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:50,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1
292400000000 50 54 00 00 00 07 40 44-44 44 54 50 81 00 20 63
292500000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
292600000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
292700000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
292800000040 00 00 00 00
2929])
2930
2931dnl Modified MPLS controller action.
2932dnl In this test, the input packet in vlan-tagged, which should be stripped
2933dnl before we push the MPLS and VLAN tags.
2934AT_CHECK([ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P nxm --detach --pidfile 2> ofctl_monitor.log])
2935
2936for i in 1 2 3; do
2937 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))'
2938done
2939OVS_WAIT_UNTIL([test `grep OFPT_PACKET_IN ofctl_monitor.log | wc -l` -ge 3])
2940OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2941
2942AT_CHECK([cat ofctl_monitor.log | ofctl_strip], [0], [dnl
2943OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
2944mpls,metadata=0,in_port=0,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:51,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1
294500000000 50 54 00 00 00 07 40 44-44 44 54 51 81 00 20 63
294600000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
294700000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
294800000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
2949dnl
2950OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
2951mpls,metadata=0,in_port=0,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:51,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1
295200000000 50 54 00 00 00 07 40 44-44 44 54 51 81 00 20 63
295300000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
295400000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
295500000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
2956dnl
2957OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
2958mpls,metadata=0,in_port=0,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:51,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1
295900000000 50 54 00 00 00 07 40 44-44 44 54 51 81 00 20 63
296000000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
296100000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
296200000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
2963])
2964
2965dnl Modified MPLS controller action.
2966dnl In this test, we push the MPLS tag before pushing a VLAN tag, so we see
2967dnl both of these in the final flow
2968AT_CHECK([ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P nxm --detach --pidfile 2> ofctl_monitor.log])
2969
2970for i in 1 2 3; do
2971 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)'
2972done
2973OVS_WAIT_UNTIL([test `grep OFPT_PACKET_IN ofctl_monitor.log | wc -l` -ge 3])
2974OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2975
2976AT_CHECK([cat ofctl_monitor.log | ofctl_strip], [0], [dnl
2977OFPT_PACKET_IN (OF1.2): total_len=68 in_port=1 (via action) data_len=68 (unbuffered)
2978mpls,metadata=0,in_port=0,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:52,dl_dst=52:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1
297900000000 52 54 00 00 00 07 40 44-44 44 54 52 81 00 20 63
298000000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
298100000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
298200000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
298300000040 00 00 00 00
2984dnl
2985OFPT_PACKET_IN (OF1.2): total_len=68 in_port=1 (via action) data_len=68 (unbuffered)
2986mpls,metadata=0,in_port=0,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:52,dl_dst=52:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1
298700000000 52 54 00 00 00 07 40 44-44 44 54 52 81 00 20 63
298800000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
298900000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
299000000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
299100000040 00 00 00 00
2992dnl
2993OFPT_PACKET_IN (OF1.2): total_len=68 in_port=1 (via action) data_len=68 (unbuffered)
2994mpls,metadata=0,in_port=0,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:52,dl_dst=52:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1
299500000000 52 54 00 00 00 07 40 44-44 44 54 52 81 00 20 63
299600000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
299700000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
299800000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
299900000040 00 00 00 00
3000])
3001
3002dnl Modified MPLS controller action.
3003dnl In this test, the input packet in vlan-tagged, which should be stripped
3004dnl before we push the MPLS and VLAN tags.
3005AT_CHECK([ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P nxm --detach --pidfile 2> ofctl_monitor.log])
3006
3007for i in 1 2 3; do
3008 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))'
3009done
3010OVS_WAIT_UNTIL([test `grep OFPT_PACKET_IN ofctl_monitor.log | wc -l` -ge 3])
3011OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
3012
3013AT_CHECK([cat ofctl_monitor.log | ofctl_strip], [0], [dnl
3014OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
3015mpls,metadata=0,in_port=0,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:53,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1
301600000000 50 54 00 00 00 07 40 44-44 44 54 53 81 00 20 63
301700000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
301800000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
301900000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
3020dnl
3021OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
3022mpls,metadata=0,in_port=0,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:53,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1
302300000000 50 54 00 00 00 07 40 44-44 44 54 53 81 00 20 63
302400000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
302500000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
302600000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
3027dnl
3028OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
3029mpls,metadata=0,in_port=0,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:53,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1
303000000000 50 54 00 00 00 07 40 44-44 44 54 53 81 00 20 63
303100000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
303200000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
303300000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
3034])
3035
3036dnl Modified MPLS controller action.
3037dnl In this test, we push the VLAN tag before pushing a MPLS tag, but these
3038dnl actions are reordered, so we see both of these in the final flow.
3039AT_CHECK([ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P nxm --detach --pidfile 2> ofctl_monitor.log])
3040
3041for i in 1 2 3; do
3042 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)'
3043done
3044OVS_WAIT_UNTIL([test `grep OFPT_PACKET_IN ofctl_monitor.log | wc -l` -ge 3])
3045OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
3046
3047AT_CHECK([cat ofctl_monitor.log | ofctl_strip], [0], [dnl
3048OFPT_PACKET_IN (OF1.2): total_len=68 in_port=1 (via action) data_len=68 (unbuffered)
3049mpls,metadata=0,in_port=0,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:54,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1
305000000000 50 54 00 00 00 07 40 44-44 44 54 54 81 00 20 63
305100000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
305200000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
305300000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
305400000040 00 00 00 00
3055dnl
3056OFPT_PACKET_IN (OF1.2): total_len=68 in_port=1 (via action) data_len=68 (unbuffered)
3057mpls,metadata=0,in_port=0,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:54,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1
305800000000 50 54 00 00 00 07 40 44-44 44 54 54 81 00 20 63
305900000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
306000000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
306100000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
306200000040 00 00 00 00
3063dnl
3064OFPT_PACKET_IN (OF1.2): total_len=68 in_port=1 (via action) data_len=68 (unbuffered)
3065mpls,metadata=0,in_port=0,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:54,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1
306600000000 50 54 00 00 00 07 40 44-44 44 54 54 81 00 20 63
306700000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
306800000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
306900000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
307000000040 00 00 00 00
3071])
3072
3073dnl Modified MPLS controller action.
3074dnl In this test, the input packet in vlan-tagged, which should be stripped
3075dnl before we push the MPLS and VLAN tags.
3076AT_CHECK([ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P nxm --detach --pidfile 2> ofctl_monitor.log])
3077
3078for i in 1 2 3; do
3079 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))'
3080done
3081OVS_WAIT_UNTIL([test `grep OFPT_PACKET_IN ofctl_monitor.log | wc -l` -ge 3])
3082OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
3083
3084AT_CHECK([cat ofctl_monitor.log | ofctl_strip], [0], [dnl
3085OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
3086mpls,metadata=0,in_port=0,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:55,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1
308700000000 50 54 00 00 00 07 40 44-44 44 54 55 81 00 20 63
308800000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
308900000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
309000000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
3091dnl
3092OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
3093mpls,metadata=0,in_port=0,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:55,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1
309400000000 50 54 00 00 00 07 40 44-44 44 54 55 81 00 20 63
309500000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
309600000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
309700000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
3098dnl
3099OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
3100mpls,metadata=0,in_port=0,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:55,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1
310100000000 50 54 00 00 00 07 40 44-44 44 54 55 81 00 20 63
310200000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
310300000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
310400000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
3105])
3106
3107dnl Modified MPLS controller action.
3108dnl In this test, we push the VLAN tag before pushing a MPLS tag, but these
3109dnl actions are reordered, so we see both of these in the final flow.
3110AT_CHECK([ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P nxm --detach --pidfile 2> ofctl_monitor.log])
3111
3112for i in 1 2 3; do
3113 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)'
3114done
3115OVS_WAIT_UNTIL([test `grep OFPT_PACKET_IN ofctl_monitor.log | wc -l` -ge 3])
3116OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
3117
3118AT_CHECK([cat ofctl_monitor.log | ofctl_strip], [0], [dnl
3119OFPT_PACKET_IN (OF1.2): total_len=68 in_port=1 (via action) data_len=68 (unbuffered)
3120mpls,metadata=0,in_port=0,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:56,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1
312100000000 50 54 00 00 00 07 40 44-44 44 54 56 81 00 20 63
312200000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
312300000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
312400000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
312500000040 00 00 00 00
3126dnl
3127OFPT_PACKET_IN (OF1.2): total_len=68 in_port=1 (via action) data_len=68 (unbuffered)
3128mpls,metadata=0,in_port=0,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:56,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1
312900000000 50 54 00 00 00 07 40 44-44 44 54 56 81 00 20 63
313000000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
313100000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
313200000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
313300000040 00 00 00 00
3134dnl
3135OFPT_PACKET_IN (OF1.2): total_len=68 in_port=1 (via action) data_len=68 (unbuffered)
3136mpls,metadata=0,in_port=0,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:56,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1
313700000000 50 54 00 00 00 07 40 44-44 44 54 56 81 00 20 63
313800000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
313900000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
314000000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
314100000040 00 00 00 00
3142])
3143
3144dnl Modified MPLS controller action.
3145dnl In this test, the input packet in vlan-tagged, which should be stripped
3146dnl before we push the MPLS and VLAN tags.
3147AT_CHECK([ovs-ofctl --protocols=OpenFlow12 monitor br0 -m 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
3148
3149for i in 1 2 3; do
3150 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))'
3151done
3152OVS_WAIT_UNTIL([test `grep OFPT_PACKET_IN ofctl_monitor.log | wc -l` -ge 3])
3153OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
3154
3155AT_CHECK([cat ofctl_monitor.log | ofctl_strip], [0], [dnl
3156OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
3157mpls,metadata=0,in_port=0,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:57,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1
315800000000 50 54 00 00 00 07 40 44-44 44 54 57 81 00 20 63
315900000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
316000000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
316100000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
3162dnl
3163OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
3164mpls,metadata=0,in_port=0,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:57,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1
316500000000 50 54 00 00 00 07 40 44-44 44 54 57 81 00 20 63
316600000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
316700000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
316800000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
3169dnl
3170OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
3171mpls,metadata=0,in_port=0,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:57,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1
317200000000 50 54 00 00 00 07 40 44-44 44 54 57 81 00 20 63
317300000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
317400000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
317500000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
3176])
3177
3178dnl Modified MPLS controller action.
3179dnl In this test, the input packet in vlan-tagged, which should be stripped
3180dnl before we push the MPLS and VLAN tags.
3181AT_CHECK([ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P nxm --detach --pidfile 2> ofctl_monitor.log])
3182
3183for i in 1 2 3; do
3184 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))'
3185done
3186OVS_WAIT_UNTIL([test `grep OFPT_PACKET_IN ofctl_monitor.log | wc -l` -ge 3])
3187OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
3188
3189AT_CHECK([cat ofctl_monitor.log | ofctl_strip], [0], [dnl
3190OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
3191mpls,metadata=0,in_port=0,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:58,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1
319200000000 50 54 00 00 00 07 40 44-44 44 54 58 81 00 20 63
319300000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
319400000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
319500000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
3196dnl
3197OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
3198mpls,metadata=0,in_port=0,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:58,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1
319900000000 50 54 00 00 00 07 40 44-44 44 54 58 81 00 20 63
320000000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
320100000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
320200000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
3203dnl
3204OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
3205mpls,metadata=0,in_port=0,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:58,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1
320600000000 50 54 00 00 00 07 40 44-44 44 54 58 81 00 20 63
320700000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
320800000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
320900000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
3210])
3211
3212dnl Modified MPLS controller action.
3213dnl In this test, the input packet in vlan-tagged, which should be modified
3214dnl before we push MPLS and VLAN tags.
3215AT_CHECK([ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P nxm --detach --pidfile 2> ofctl_monitor.log])
3216
3217for i in 1 2 3; do
3218 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))'
3219done
3220OVS_WAIT_UNTIL([test `grep OFPT_PACKET_IN ofctl_monitor.log | wc -l` -ge 3])
3221ovs-appctl -t ovs-ofctl exit
3222
3223AT_CHECK([cat ofctl_monitor.log | ofctl_strip], [0], [dnl
3224OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
3225mpls,metadata=0,in_port=0,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:59,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1
322600000000 50 54 00 00 00 07 40 44-44 44 54 59 81 00 20 63
322700000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
322800000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
322900000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
3230dnl
3231OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
3232mpls,metadata=0,in_port=0,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:59,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1
323300000000 50 54 00 00 00 07 40 44-44 44 54 59 81 00 20 63
323400000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
323500000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
323600000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
3237dnl
3238OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
3239mpls,metadata=0,in_port=0,dl_vlan=99,dl_vlan_pcp=1,dl_src=40:44:44:44:54:59,dl_dst=50:54:00:00:00:07,mpls_label=10,mpls_tc=0,mpls_ttl=64,mpls_bos=1
324000000000 50 54 00 00 00 07 40 44-44 44 54 59 81 00 20 63
324100000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
324200000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
324300000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
3244])
3245
3246AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
3247AT_CHECK([ovs-appctl revalidator/wait], [0], [ignore])
3248AT_CHECK([ovs-ofctl --protocols=OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
3249 cookie=0xa, n_packets=3, n_bytes=180, dl_src=40:44:44:44:54:50 actions=push_mpls:0x8847,load:0xa->OXM_OF_MPLS_LABEL[[]],push_vlan:0x8100,set_field:4195->vlan_vid,set_field:1->vlan_pcp,CONTROLLER:65535
3250 cookie=0xa, n_packets=3, n_bytes=180, dl_src=40:44:44:44:54:51 actions=push_mpls:0x8847,load:0xa->OXM_OF_MPLS_LABEL[[]],push_vlan:0x8100,set_field:4195->vlan_vid,set_field:1->vlan_pcp,CONTROLLER:65535
3251 cookie=0xa, n_packets=3, n_bytes=180, dl_src=40:44:44:44:54:52 actions=push_mpls:0x8847,load:0xa->OXM_OF_MPLS_LABEL[[]],push_vlan:0x8100,load:0x63->OXM_OF_VLAN_VID[[]],set_field:1->vlan_pcp,CONTROLLER:65535
3252 cookie=0xa, n_packets=3, n_bytes=180, dl_src=40:44:44:44:54:53 actions=push_mpls:0x8847,load:0xa->OXM_OF_MPLS_LABEL[[]],push_vlan:0x8100,load:0x63->OXM_OF_VLAN_VID[[]],set_field:1->vlan_pcp,CONTROLLER:65535
3253 cookie=0xa, n_packets=3, n_bytes=180, dl_src=40:44:44:44:54:54 actions=push_vlan:0x8100,set_field:4195->vlan_vid,set_field:1->vlan_pcp,push_mpls:0x8847,load:0xa->OXM_OF_MPLS_LABEL[[]],CONTROLLER:65535
3254 cookie=0xa, n_packets=3, n_bytes=180, dl_src=40:44:44:44:54:55 actions=push_vlan:0x8100,set_field:4195->vlan_vid,set_field:1->vlan_pcp,push_mpls:0x8847,load:0xa->OXM_OF_MPLS_LABEL[[]],CONTROLLER:65535
3255 cookie=0xa, n_packets=3, n_bytes=180, dl_src=40:44:44:44:54:56 actions=push_vlan:0x8100,load:0x63->OXM_OF_VLAN_VID[[]],set_field:1->vlan_pcp,push_mpls:0x8847,load:0xa->OXM_OF_MPLS_LABEL[[]],CONTROLLER:65535
3256 cookie=0xa, n_packets=3, n_bytes=180, dl_src=40:44:44:44:54:57 actions=push_vlan:0x8100,load:0x63->OXM_OF_VLAN_VID[[]],set_field:1->vlan_pcp,push_mpls:0x8847,load:0xa->OXM_OF_MPLS_LABEL[[]],CONTROLLER:65535
3257 cookie=0xa, n_packets=3, n_bytes=180, vlan_tci=0x1000/0x1000,dl_src=40:44:44:44:54:58 actions=load:0x63->OXM_OF_VLAN_VID[[]],set_field:1->vlan_pcp,push_mpls:0x8847,load:0xa->OXM_OF_MPLS_LABEL[[]],CONTROLLER:65535
3258 cookie=0xa, n_packets=3, n_bytes=180, vlan_tci=0x1000/0x1000,dl_src=40:44:44:44:54:59 actions=push_mpls:0x8847,load:0xa->OXM_OF_MPLS_LABEL[[]],set_field:1->vlan_pcp,load:0x63->OXM_OF_VLAN_VID[[]],CONTROLLER:65535
3259OFPST_FLOW reply (OF1.2):
3260])
3261
3262OVS_VSWITCHD_STOP
3263AT_CLEANUP
3264
3265AT_SETUP([ofproto-dpif - fragment handling])
3266OVS_VSWITCHD_START
3267ADD_OF_PORTS([br0], [1], [2], [3], [4], [5], [6], [90])
3268AT_DATA([flows.txt], [dnl
3269priority=75 tcp ip_frag=no tp_dst=80 actions=output:1
3270priority=75 tcp ip_frag=first tp_dst=80 actions=output:2
3271priority=75 tcp ip_frag=later tp_dst=80 actions=output:3
3272priority=50 tcp ip_frag=no actions=output:4
3273priority=50 tcp ip_frag=first actions=output:5
3274priority=50 tcp ip_frag=later actions=output:6
3275])
3276AT_CHECK([ovs-ofctl replace-flows br0 flows.txt])
3277
3278base_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"
3279no_flow="$base_flow,frag=no),tcp(src=12345,dst=80)"
3280first_flow="$base_flow,frag=first),tcp(src=12345,dst=80)"
3281later_flow="$base_flow,frag=later)"
3282
3283 # mode no first later
3284for tuple in \
3285 'normal 1 5 6' \
3286 'drop 1 drop drop' \
3287 'nx-match 1 2 6'
3288do
3289 set $tuple
3290 mode=$1
3291 no=$2
3292 first=$3
3293 later=$4
3294
3295 AT_CHECK([ovs-ofctl set-frags br0 $mode])
3296 for type in no first later; do
3297 eval flow=\$${type}_flow exp_output=\$$type
3298 printf "\n%s\n" "----$mode $type-----"
3299 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
3300 : > expout
3301 if test $mode = drop && test $type != no; then
3302 echo 'Packets dropped because they are IP fragments and the fragment handling mode is "drop".' >> expout
3303 fi
3304 echo "Datapath actions: $exp_output" >> expout
3305 AT_CHECK([grep 'IP fragments' stdout; tail -1 stdout], [0], [expout])
3306 done
3307done
3308OVS_VSWITCHD_STOP
3309AT_CLEANUP
3310
3311AT_SETUP([ofproto-dpif - exit])
3312OVS_VSWITCHD_START
3313ADD_OF_PORTS([br0], [1], [2], [3], [10], [11], [12], [13], [14])
3314AT_DATA([flows.txt], [dnl
3315in_port=1 actions=output:10,exit,output:11
3316in_port=2 actions=output:12,resubmit:1,output:12
3317in_port=3 actions=output:13,resubmit:2,output:14
3318])
3319AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
3320AT_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])
3321AT_CHECK([tail -1 stdout], [0],
3322 [Datapath actions: 10
3323])
3324AT_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])
3325AT_CHECK([tail -1 stdout], [0],
3326 [Datapath actions: 12,10
3327])
3328AT_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])
3329AT_CHECK([tail -1 stdout], [0],
3330 [Datapath actions: 13,12,10
3331])
3332OVS_VSWITCHD_STOP
3333AT_CLEANUP
3334
3335
3336AT_SETUP([ofproto-dpif - mirroring, select_all])
3337OVS_VSWITCHD_START
3338ADD_OF_PORTS([br0], 1, 2, 3)
3339ovs-vsctl \
3340 set Bridge br0 mirrors=@m --\
3341 --id=@p3 get Port p3 --\
3342 --id=@m create Mirror name=mymirror select_all=true output_port=@p3
3343
3344AT_DATA([flows.txt], [dnl
3345in_port=1 actions=output:2
3346in_port=2 actions=output:1
3347])
3348AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
3349
3350flow="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)"
3351AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
3352AT_CHECK_UNQUOTED([tail -1 stdout], [0],
3353 [Datapath actions: 2,3
3354])
3355
3356flow="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)"
3357AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
3358AT_CHECK_UNQUOTED([tail -1 stdout], [0],
3359 [Datapath actions: 1,3
3360])
3361
3362OVS_VSWITCHD_STOP
3363AT_CLEANUP
3364
3365
3366AT_SETUP([ofproto-dpif - mirroring, select_src])
3367OVS_VSWITCHD_START
3368ADD_OF_PORTS([br0], 1, 2, 3)
3369ovs-vsctl \
3370 set Bridge br0 mirrors=@m --\
3371 --id=@p1 get Port p1 -- --id=@p3 get Port p3 --\
3372 --id=@m create Mirror name=mymirror select_src_port=@p1 output_port=@p3
3373
3374AT_DATA([flows.txt], [dnl
3375in_port=1 actions=output:2
3376in_port=2 actions=output:1
3377])
3378AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
3379
3380flow="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)"
3381AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
3382AT_CHECK_UNQUOTED([tail -1 stdout], [0],
3383 [Datapath actions: 2,3
3384])
3385
3386flow="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)"
3387AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
3388AT_CHECK_UNQUOTED([tail -1 stdout], [0],
3389 [Datapath actions: 1
3390])
3391OVS_VSWITCHD_STOP
3392AT_CLEANUP
3393
3394AT_SETUP([ofproto-dpif - mirroring, OFPP_NONE ingress port])
3395OVS_VSWITCHD_START
3396ADD_OF_PORTS([br0], 1, 2)
3397ovs-vsctl \
3398 set Bridge br0 mirrors=@m --\
3399 --id=@p2 get Port p2 --\
3400 --id=@m create Mirror name=mymirror select_all=true output_port=@p2
3401
3402AT_CHECK([ovs-ofctl add-flow br0 action=output:1])
3403
3404# "in_port" defaults to OFPP_NONE if it's not specified.
3405flow="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"
3406AT_CHECK([ovs-appctl ofproto/trace br0 "$flow"], [0], [stdout])
3407AT_CHECK_UNQUOTED([tail -1 stdout], [0],
3408 [Datapath actions: 1,2
3409])
3410
3411OVS_VSWITCHD_STOP
3412AT_CLEANUP
3413
3414
3415AT_SETUP([ofproto-dpif - mirroring, select_dst])
3416OVS_VSWITCHD_START
3417ADD_OF_PORTS([br0], 1, 2, 3)
3418ovs-vsctl \
3419 set Bridge br0 mirrors=@m --\
3420 --id=@p2 get Port p2 -- --id=@p3 get Port p3 --\
3421 --id=@m create Mirror name=mymirror select_dst_port=@p2 output_port=@p3
3422
3423AT_DATA([flows.txt], [dnl
3424in_port=1 actions=output:2
3425in_port=2 actions=output:1
3426])
3427AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
3428
3429flow="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)"
3430AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
3431AT_CHECK_UNQUOTED([tail -1 stdout], [0],
3432 [Datapath actions: 2,3
3433])
3434
3435flow="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)"
3436AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
3437AT_CHECK_UNQUOTED([tail -1 stdout], [0],
3438 [Datapath actions: 1
3439])
3440
3441OVS_VSWITCHD_STOP
3442AT_CLEANUP
3443
3444
3445AT_SETUP([ofproto-dpif - mirroring, select_vlan])
3446OVS_VSWITCHD_START
3447ADD_OF_PORTS([br0], 1, 2, 3)
3448ovs-vsctl \
3449 set Bridge br0 mirrors=@m --\
3450 --id=@p2 get Port p2 -- --id=@p3 get Port p3 --\
3451 --id=@m create Mirror name=mymirror select_all=true select_vlan=11 output_port=@p3
3452
3453AT_DATA([flows.txt], [dnl
3454in_port=1, actions=output:2
3455])
3456AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
3457
3458flow="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)"
3459AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
3460AT_CHECK_UNQUOTED([tail -1 stdout], [0],
3461 [Datapath actions: 2
3462])
3463
3464flow="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))"
3465AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
3466AT_CHECK_UNQUOTED([tail -1 stdout], [0],
3467 [Datapath actions: 2
3468])
3469
3470flow="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))"
3471AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
3472AT_CHECK_UNQUOTED([tail -1 stdout], [0],
3473 [Datapath actions: 2,3
3474])
3475
3476OVS_VSWITCHD_STOP
3477AT_CLEANUP
3478
3479
3480AT_SETUP([ofproto-dpif - mirroring, output_port])
3481OVS_VSWITCHD_START
3482ADD_OF_PORTS([br0], 1, 2, 3)
3483ovs-vsctl \
3484 set Bridge br0 mirrors=@m --\
3485 --id=@p3 get Port p3 --\
3486 --id=@m create Mirror name=mymirror select_all=true output_port=@p3
3487
3488AT_DATA([flows.txt], [dnl
3489in_port=1 actions=mod_vlan_vid:17,output:2
3490in_port=2 actions=output:1
3491])
3492AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
3493
3494flow="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)"
3495AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
3496AT_CHECK_UNQUOTED([tail -1 stdout], [0],
3497 [Datapath actions: push_vlan(vid=17,pcp=0),2,pop_vlan,3
3498])
3499
3500flow="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)"
3501AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
3502AT_CHECK_UNQUOTED([tail -1 stdout], [0],
3503 [Datapath actions: 1,3
3504])
3505
3506OVS_VSWITCHD_STOP
3507AT_CLEANUP
3508
3509AT_SETUP([ofproto-dpif - mirroring, output_vlan])
3510OVS_VSWITCHD_START
3511ADD_OF_PORTS([br0], 1, 2)
3512ovs-vsctl \
3513 set Bridge br0 mirrors=@m --\
3514 --id=@m create Mirror name=mymirror select_all=true output_vlan=12
3515
3516AT_DATA([flows.txt], [dnl
3517in_port=1 actions=output:2
3518in_port=2 actions=mod_vlan_vid:17,output:1
3519])
3520AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
3521
3522flow="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)"
3523AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
3524actual=`tail -1 stdout | sed 's/Datapath actions: //'`
3525
3526expected="2,push_vlan(vid=12,pcp=0),1,2,100"
3527AT_CHECK([ovs-dpctl normalize-actions "$flow" "$expected"], [0], [stdout])
3528mv stdout expout
3529AT_CHECK([ovs-dpctl normalize-actions "$flow" "$actual"], [0], [expout])
3530
3531flow="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)"
3532AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
3533actual=`tail -1 stdout | sed 's/Datapath actions: //'`
3534
3535expected="push_vlan(vid=17,pcp=0),1,pop_vlan,push_vlan(vid=12,pcp=0),1,2,100"
3536AT_CHECK([ovs-dpctl normalize-actions "$flow" "$expected"], [0], [stdout])
3537mv stdout expout
3538AT_CHECK([ovs-dpctl normalize-actions "$flow" "$actual"], [0], [expout])
3539
3540OVS_VSWITCHD_STOP
3541AT_CLEANUP
3542
3543# Two testcases below are for the ofproto/trace command
3544# The first one tests all correct syntax:
3545# ofproto/trace [dp_name] odp_flow [-generate|packet]
3546# ofproto/trace br_name br_flow [-generate|packet]
3547AT_SETUP([ofproto-dpif - ofproto/trace command 1])
3548OVS_VSWITCHD_START([set bridge br0 fail-mode=standalone])
3549ADD_OF_PORTS([br0], 1, 2, 3)
3550
3551AT_DATA([flows.txt], [dnl
3552in_port=1 actions=output:2
3553in_port=2 actions=output:1
3554])
3555AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
3556
3557odp_flow="in_port(1)"
3558br_flow="in_port=1"
3559# Test command: ofproto/trace odp_flow with in_port as a name.
3560AT_CHECK([ovs-appctl ofproto/trace "$odp_flow"], [0], [stdout])
3561AT_CHECK([tail -1 stdout], [0], [dnl
3562Datapath actions: 2
3563])
3564
3565odp_flow="in_port(1)"
3566# Test command: ofproto/trace odp_flow
3567AT_CHECK([ovs-appctl ofproto/trace "$odp_flow"], [0], [stdout])
3568AT_CHECK([tail -1 stdout], [0], [dnl
3569Datapath actions: 2
3570])
3571
3572# Test command: ofproto/trace dp_name odp_flow
3573AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$odp_flow"], [0], [stdout])
3574AT_CHECK([tail -1 stdout], [0], [dnl
3575Datapath actions: 2
3576])
3577# Test commmand: ofproto/trace br_name br_flow
3578AT_CHECK([ovs-appctl ofproto/trace br0 "$br_flow"], [0], [stdout])
3579AT_CHECK([tail -1 stdout], [0], [dnl
3580Datapath actions: 2
3581])
3582
3583# Delete the inserted flows
3584AT_CHECK([ovs-ofctl del-flows br0 "in_port=1"], [0], [stdout])
3585AT_CHECK([ovs-ofctl del-flows br0 "in_port=2"], [0], [stdout])
3586
3587# This section beflow tests the [-generate] option
3588odp_flow="in_port(3),eth(src=50:54:00:00:00:05,dst=ff:ff:ff:ff:ff:ff)"
3589br_flow="arp,metadata=0,in_port=3,vlan_tci=0x0000,dl_src=50:54:00:00:00:05,dl_dst=ff:ff:ff:ff:ff:ff"
3590
3591# Test command: ofproto/trace odp_flow
3592AT_CHECK([ovs-appctl ofproto/trace "$odp_flow"], [0], [stdout])
3593# Check for no MAC learning entry
3594AT_CHECK_UNQUOTED([ovs-appctl fdb/show br0 | sed 's/[[0-9]]\{1,\}$/?/'], [0], [dnl
3595 port VLAN MAC Age
3596])
3597
3598# Test command: ofproto/trace br_name br_flow
3599AT_CHECK([ovs-appctl ofproto/trace br0 "$br_flow"], [0], [stdout])
3600# Check for no MAC learning entry
3601AT_CHECK_UNQUOTED([ovs-appctl fdb/show br0 | sed 's/[[0-9]]\{1,\}$/?/'], [0], [dnl
3602 port VLAN MAC Age
3603])
3604
3605# Test command: ofproto/trace odp_flow -generate
3606AT_CHECK([ovs-appctl ofproto/trace "$odp_flow" -generate], [0], [stdout])
3607# Check for the MAC learning entry
3608AT_CHECK_UNQUOTED([ovs-appctl fdb/show br0 | sed 's/[[0-9]]\{1,\}$/?/'], [0], [dnl
3609 port VLAN MAC Age
3610 3 0 50:54:00:00:00:05 ?
3611])
3612
3613# Test command: ofproto/trace dp_name odp_flow -generate
3614AT_CHECK([ovs-appctl ofproto/trace ovs-dummy \
3615 "in_port(1),eth(src=50:54:00:00:00:06,dst=50:54:00:00:00:05)" \
3616 -generate], [0], [stdout])
3617# Check for both MAC learning entries
3618AT_CHECK_UNQUOTED([ovs-appctl fdb/show br0 | sed 's/[[0-9]]\{1,\}$/?/'], [0], [dnl
3619 port VLAN MAC Age
3620 3 0 50:54:00:00:00:05 ?
3621 1 0 50:54:00:00:00:06 ?
3622])
3623
3624# Test command: ofproto/trace br_name br_flow -generate
3625AT_CHECK([ovs-appctl ofproto/trace br0 \
3626 "in_port=2,dl_src=50:54:00:00:00:07,dl_dst=50:54:00:00:00:06" \
3627 -generate], [0], [stdout])
3628# Check for both MAC learning entries.
3629AT_CHECK_UNQUOTED([ovs-appctl fdb/show br0 | sed 's/[[0-9]]\{1,\}$/?/'], [0], [dnl
3630 port VLAN MAC Age
3631 3 0 50:54:00:00:00:05 ?
3632 1 0 50:54:00:00:00:06 ?
3633 2 0 50:54:00:00:00:07 ?
3634])
3635
3636# This section beflow tests the [packet] option
3637# The ovs-tcpundump of packets between port1 and port2
3638pkt1to2="50540000000250540000000108064500001C000100004001F98CC0A80001C0A800020800F7FF00000000"
3639pkt2to1="50540000000150540000000208064500001C000100004001F98CC0A80002C0A800010800F7FF00000000"
3640
3641# Construct the MAC learning table
3642AT_CHECK([ovs-appctl ofproto/trace ovs-dummy \
3643 "in_port(1),eth(src=50:54:00:00:00:01,dst=ff:ff:ff:ff:ff:ff)" \
3644 -generate], [0], [stdout])
3645
3646# Construct the MAC learning table
3647AT_CHECK([ovs-appctl ofproto/trace ovs-dummy \
3648 "in_port(2),eth(src=50:54:00:00:00:02,dst=ff:ff:ff:ff:ff:ff)" \
3649 -generate], [0], [stdout])
3650
3651# Test command: ofproto/trace odp_flow packet
3652AT_CHECK([ovs-appctl ofproto/trace \
3653 "in_port(1),skb_priority(1),skb_mark(2)" "$pkt1to2"], [0], [stdout])
3654AT_CHECK([tail -1 stdout], [0], [dnl
3655Datapath actions: 2
3656])
3657AT_CHECK([head -n 2 stdout], [0], [dnl
3658Bridge: br0
3659Flow: pkt_mark=0x2,skb_priority=0x1,arp,metadata=0,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_sha=00:00:00:00:00:00,arp_tha=00:00:00:00:00:00
3660])
3661
3662# Test command: ofproto/trace dp_name odp_flow packet
3663AT_CHECK([ovs-appctl ofproto/trace ovs-dummy \
3664 "in_port(1),skb_priority(1),skb_mark(2)" "$pkt1to2"], [0], [stdout])
3665AT_CHECK([tail -1 stdout], [0], [dnl
3666Datapath actions: 2
3667])
3668AT_CHECK([head -n 2 stdout], [0], [dnl
3669Bridge: br0
3670Flow: pkt_mark=0x2,skb_priority=0x1,arp,metadata=0,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_sha=00:00:00:00:00:00,arp_tha=00:00:00:00:00:00
3671])
3672
3673# Test command: ofproto/trace br_name br_flow packet
3674AT_CHECK([ovs-appctl ofproto/trace br0 \
3675 "in_port=2,skb_priority=2,pkt_mark=1" "$pkt2to1"], [0], [stdout],[stderr])
3676AT_CHECK([tail -1 stdout], [0], [dnl
3677Datapath actions: 1
3678])
3679AT_CHECK([head -n 2 stdout], [0], [dnl
3680Bridge: br0
3681Flow: pkt_mark=0x1,skb_priority=0x2,arp,metadata=0,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_sha=00:00:00:00:00:00,arp_tha=00:00:00:00:00:00
3682])
3683
3684OVS_VSWITCHD_STOP
3685AT_CLEANUP
3686
3687# The second test tests the corner cases
3688AT_SETUP([ofproto-dpif - ofproto/trace command 2])
3689OVS_VSWITCHD_START
3690ADD_OF_PORTS([br0], 1, 2)
3691
3692# Define flows
3693odp_flow="in_port(1),eth(src=50:54:00:00:00:01,dst=50:54:00:00:00:02)"
3694br_flow="in_port=1,dl_src=50:54:00:00:00:01,dl_dst=50:54:00:00:00:02"
3695# Define options
3696generate="-generate"
3697pkt="50540000000250540000000108064500001C000100004001F98CC0A80001C0A800020800F7FF00000000"
3698
3699# Test incorrect command: ofproto/trace wrong_name odp_flow [-generate|packet]
3700m4_foreach(
3701[option],
3702[[],
3703["$generate"],
3704["$pkt"]],
3705[AT_CHECK([ovs-appctl ofproto/trace wrong_name "$odp_flow" option],
3706 [2], [], [stderr])
3707AT_CHECK([tail -2 stderr], [0], [dnl
3708Cannot find the datapath
3709ovs-appctl: ovs-vswitchd: server returned an error
3710])])
3711
3712# Test incorrect command: ofproto/trace empty_string odp_flow [-generate|packet]
3713m4_foreach(
3714[option],
3715[[],
3716["$generate"],
3717["$pkt"]],
3718[AT_CHECK([ovs-appctl ofproto/trace "" "$odp_flow" option],
3719 [2], [], [stderr])
3720AT_CHECK([tail -2 stderr], [0], [dnl
3721Cannot find the datapath
3722ovs-appctl: ovs-vswitchd: server returned an error
3723])])
3724
3725# Test incorrect command: ofproto/trace nonexist_dp_name odp_flow [-generate|packet]
3726m4_foreach(
3727[option],
3728[[],
3729["$generate"],
3730["$pkt"]],
3731[AT_CHECK([ovs-appctl ofproto/trace ovs-system "$odp_flow" option],
3732 [2], [], [stderr])
3733AT_CHECK([tail -2 stderr], [0], [dnl
3734Cannot find the datapath
3735ovs-appctl: ovs-vswitchd: server returned an error
3736])])
3737
3738# Test incorrect command: ofproto/trace br_name odp_flow [-generate|packet]
3739m4_foreach(
3740[option],
3741[[],
3742["$generate"],
3743["$pkt"]],
3744[AT_CHECK([ovs-appctl ofproto/trace br0 "$odp_flow" option],
3745 [2], [], [stderr])
3746AT_CHECK([tail -2 stderr], [0], [dnl
3747Cannot find the datapath
3748ovs-appctl: ovs-vswitchd: server returned an error
3749])])
3750
3751# Test incorrect command: ofproto/trace dp_name br_flow [-generate|packet]
3752m4_foreach(
3753[option],
3754[[],
3755["$generate"],
3756["$pkt"]],
3757[AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$br_flow" option],
3758 [2], [], [stderr])
3759AT_CHECK([tail -2 stderr], [0], [dnl
3760Unknown bridge name
3761ovs-appctl: ovs-vswitchd: server returned an error
3762])])
3763
3764# Test incorrect command: ofproto/trace br_flow [-generate|packet]
3765m4_foreach(
3766[option],
3767[[],
3768["$generate"],
3769["$pkt"]],
3770[AT_CHECK([ovs-appctl ofproto/trace "$br_flow" option],
3771 [2], [], [stderr])
3772AT_CHECK([tail -2 stderr], [0], [dnl
3773Must specify bridge name
3774ovs-appctl: ovs-vswitchd: server returned an error
3775])])
3776
3777# Test incorrect command: ofproto/trace dp_name odp_flow garbage_option
3778AT_CHECK([ovs-appctl ofproto/trace \
3779 ovs-dummy "$odp_flow" garbage_option],
3780 [2], [stdout],[stderr])
3781AT_CHECK([tail -2 stderr], [0], [dnl
3782Trailing garbage in packet data
3783ovs-appctl: ovs-vswitchd: server returned an error
3784])
3785
3786# Test incorrect command: ofproto/trace with 4 arguments
3787AT_CHECK([ovs-appctl ofproto/trace \
3788 arg1, arg2, arg3, arg4], [2], [stdout],[stderr])
3789AT_CHECK([tail -2 stderr], [0], [dnl
3790"ofproto/trace" command takes at most 3 arguments
3791ovs-appctl: ovs-vswitchd: server returned an error
3792])
3793
3794# Test incorrect command: ofproto/trace with 0 argument
3795AT_CHECK([ovs-appctl ofproto/trace ], [2], [stdout],[stderr])
3796AT_CHECK([tail -2 stderr], [0], [dnl
3797"ofproto/trace" command requires at least 1 arguments
3798ovs-appctl: ovs-vswitchd: server returned an error
3799])
3800
3801OVS_VSWITCHD_STOP
3802AT_CLEANUP
3803
3804AT_SETUP([ofproto-dpif - ofproto/trace-packet-out])
3805OVS_VSWITCHD_START
3806ADD_OF_PORTS([br0], 1, 2, 3)
3807
3808AT_DATA([flows.txt], [dnl
3809in_port=1 actions=output:2
3810in_port=2 actions=output:1
3811])
3812AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
3813
3814AT_CHECK([ovs-appctl ofproto/trace-packet-out br0 in_port=1 'mod_vlan_vid:123,resubmit(,0)'], [0], [stdout])
3815AT_CHECK([tail -1 stdout], [0], [dnl
3816Datapath actions: push_vlan(vid=123,pcp=0),2
3817])
3818
3819OVS_VSWITCHD_STOP
3820AT_CLEANUP
3821
3822
3823m4_define([OFPROTO_TRACE],
3824 [flow="$2"
3825 AT_CHECK([ovs-appctl ofproto/trace $1 "$flow" $3], [0], [stdout])
3826 actual=`tail -1 stdout | sed 's/Datapath actions: //'`
3827 expected="$4"
3828 AT_CHECK([ovs-dpctl normalize-actions "$flow" "$expected" $5],
3829 [0], [stdout])
3830 mv stdout expout
3831 AT_CHECK([ovs-dpctl normalize-actions "$flow" "$actual" $5],
3832 [0], [expout])])
3833
3834AT_SETUP([ofproto-dpif - MAC learning])
3835OVS_VSWITCHD_START([set bridge br0 fail-mode=standalone])
3836ADD_OF_PORTS([br0], 1, 2, 3)
3837
3838arp='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)'
3839
3840# Trace an ARP packet arriving on p3, to create a MAC learning entry.
3841OFPROTO_TRACE(
3842 [ovs-dummy],
3843 [in_port(3),eth(src=50:54:00:00:00:05,dst=ff:ff:ff:ff:ff:ff),$arp],
3844 [-generate],
3845 [1,2,100])
3846
3847# Check for the MAC learning entry.
3848AT_CHECK_UNQUOTED([ovs-appctl fdb/show br0 | sed 's/[[0-9]]\{1,\}$/?/'], [0], [dnl
3849 port VLAN MAC Age
3850 3 0 50:54:00:00:00:05 ?
3851])
3852
3853# Trace a packet arrival destined for the learned MAC.
3854# (This will also learn a MAC.)
3855OFPROTO_TRACE(
3856 [ovs-dummy],
3857 [in_port(1),eth(src=50:54:00:00:00:06,dst=50:54:00:00:00:05),$arp],
3858 [-generate],
3859 [3])
3860
3861# Check for both MAC learning entries.
3862AT_CHECK_UNQUOTED([ovs-appctl fdb/show br0 | sed 's/[[0-9]]\{1,\}$/?/'], [0], [dnl
3863 port VLAN MAC Age
3864 3 0 50:54:00:00:00:05 ?
3865 1 0 50:54:00:00:00:06 ?
3866])
3867
3868# Trace a packet arrival that updates the first learned MAC entry.
3869OFPROTO_TRACE(
3870 [ovs-dummy],
3871 [in_port(2),eth(src=50:54:00:00:00:05,dst=ff:ff:ff:ff:ff:ff),$arp],
3872 [-generate],
3873 [1,3,100])
3874
3875# Check that the MAC learning entry was updated.
3876AT_CHECK_UNQUOTED([ovs-appctl fdb/show br0 | sed 's/[[0-9]]\{1,\}$/?/'], [0], [dnl
3877 port VLAN MAC Age
3878 1 0 50:54:00:00:00:06 ?
3879 2 0 50:54:00:00:00:05 ?
3880])
3881
3882# Add another bridge.
3883AT_CHECK(
3884 [ovs-vsctl \
3885 -- add-br br1 \
3886 -- set bridge br1 datapath-type=dummy])
3887ADD_OF_PORTS([br1], 4, 5)
3888
3889# Trace some packet arrivals in br1 to create MAC learning entries there too.
3890OFPROTO_TRACE(
3891 [ovs-dummy],
3892 [in_port(4),eth(src=50:54:00:00:00:06,dst=ff:ff:ff:ff:ff:ff),$arp],
3893 [-generate],
3894 [5,101])
3895OFPROTO_TRACE(
3896 [ovs-dummy],
3897 [in_port(5),eth(src=50:54:00:00:00:07,dst=ff:ff:ff:ff:ff:ff),$arp],
3898 [-generate],
3899 [4,101])
3900
3901# Check that the MAC learning entries were added.
3902AT_CHECK_UNQUOTED([ovs-appctl fdb/show br1 | sed 's/[[0-9]]\{1,\}$/?/'], [0], [dnl
3903 port VLAN MAC Age
3904 4 0 50:54:00:00:00:06 ?
3905 5 0 50:54:00:00:00:07 ?
3906])
3907
3908# Delete port p1 and see that its MAC learning entry disappeared, and
3909# that the MAC learning entry for the same MAC was also deleted from br1.
3910AT_CHECK([ovs-vsctl del-port p1])
3911AT_CHECK_UNQUOTED([ovs-appctl fdb/show br0 | sed 's/[[0-9]]\{1,\}$/?/'], [0], [dnl
3912 port VLAN MAC Age
3913 2 0 50:54:00:00:00:05 ?
3914])
3915AT_CHECK_UNQUOTED([ovs-appctl fdb/show br1 | sed 's/[[0-9]]\{1,\}$/?/'], [0], [dnl
3916 port VLAN MAC Age
3917 5 0 50:54:00:00:00:07 ?
3918])
3919
3920OVS_VSWITCHD_STOP
3921AT_CLEANUP
3922
3923AT_SETUP([ofproto-dpif - MAC table overflow])
3924OVS_VSWITCHD_START(
3925 [set bridge br0 fail-mode=standalone other-config:mac-table-size=10])
3926ADD_OF_PORTS([br0], 1, 2, 3)
3927
3928arp='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)'
3929
3930AT_CHECK([ovs-appctl time/stop])
3931
3932# Trace 10 ARP packets arriving on p3, to create MAC learning entries.
3933for i in 0 1 2 3 4 5 6 7 8 9; do
3934 OFPROTO_TRACE(
3935 [ovs-dummy],
3936 [in_port(3),eth(src=50:54:00:00:00:0$i,dst=ff:ff:ff:ff:ff:ff),$arp],
3937 [-generate],
3938 [1,2,100])
3939 ovs-appctl time/warp 1000
3940done
3941
3942# Check for the MAC learning entries.
3943AT_CHECK_UNQUOTED([ovs-appctl fdb/show br0 | sed 's/ *[[0-9]]\{1,\}$//' | sort],
3944 [0], [dnl
3945 3 0 50:54:00:00:00:00
3946 3 0 50:54:00:00:00:01
3947 3 0 50:54:00:00:00:02
3948 3 0 50:54:00:00:00:03
3949 3 0 50:54:00:00:00:04
3950 3 0 50:54:00:00:00:05
3951 3 0 50:54:00:00:00:06
3952 3 0 50:54:00:00:00:07
3953 3 0 50:54:00:00:00:08
3954 3 0 50:54:00:00:00:09
3955 port VLAN MAC Age
3956])
3957
3958# Trace another ARP packet on another MAC.
3959OFPROTO_TRACE(
3960 [ovs-dummy],
3961 [in_port(3),eth(src=50:54:00:00:00:10,dst=ff:ff:ff:ff:ff:ff),$arp],
3962 [-generate],
3963 [1,2,100])
3964
3965# Check that the new one chased the oldest one out of the table.
3966AT_CHECK_UNQUOTED([ovs-appctl fdb/show br0 | sed 's/[[0-9]]\{1,\}$/?/' | sort],
3967 [0], [dnl
3968 3 0 50:54:00:00:00:01 ?
3969 3 0 50:54:00:00:00:02 ?
3970 3 0 50:54:00:00:00:03 ?
3971 3 0 50:54:00:00:00:04 ?
3972 3 0 50:54:00:00:00:05 ?
3973 3 0 50:54:00:00:00:06 ?
3974 3 0 50:54:00:00:00:07 ?
3975 3 0 50:54:00:00:00:08 ?
3976 3 0 50:54:00:00:00:09 ?
3977 3 0 50:54:00:00:00:10 ?
3978 port VLAN MAC Age
3979])
3980OVS_VSWITCHD_STOP
3981AT_CLEANUP
3982
3983# CHECK_SFLOW_SAMPLING_PACKET(LOOPBACK_ADDR, ADDR_WITHOUT_BRACKETS)
3984#
3985# Test that sFlow samples packets correctly using IPv4/IPv6 sFlow collector
3986#
3987# IP_VERSION_TYPE is used in AT_SETUP
3988m4_define([CHECK_SFLOW_SAMPLING_PACKET],
3989 [AT_SETUP([ofproto-dpif - sFlow packet sampling - $2 collector])
3990 AT_XFAIL_IF([test "$IS_WIN32" = "yes"])
3991 OVS_VSWITCHD_START([set Bridge br0 fail-mode=standalone])
3992
3993 ON_EXIT([kill `cat test-sflow.pid`])
3994 AT_CHECK([ovstest test-sflow --log-file --detach --no-chdir --pidfile 0:$1 > sflow.log], [0], [], [ignore])
3995 AT_CAPTURE_FILE([sflow.log])
3996 SFLOW_PORT=`parse_listening_port < test-sflow.log`
3997 ovs-appctl time/stop
3998
3999 ADD_OF_PORTS([br0], 1, 2)
4000 ovs-vsctl \
4001 set Interface br0 options:ifindex=1002 -- \
4002 set Interface p1 options:ifindex=1004 -- \
4003 set Interface p2 options:ifindex=1003 -- \
4004 set Bridge br0 sflow=@sf -- \
4005 --id=@sf create sflow targets=\"$1:$SFLOW_PORT\" \
4006 header=128 sampling=1 polling=1 agent=$LOOPBACK_INTERFACE
4007
4008 dnl open with ARP packets to seed the bridge-learning. The output
4009 dnl ifIndex numbers should be reported predictably after that.
4010 dnl Since we set sampling=1 we should see all of these packets
4011 dnl reported. Sorting the output by data-source and seqNo makes
4012 dnl it deterministic. Ensuring that we send at least two packets
4013 dnl into each port means we get to check the seq nos are
4014 dnl incrementing correctly.
4015 dnl because packets from different ports can be handled by separate
4016 dnl threads, put some sleeps
4017
4018 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)'
4019 sleep 1
4020 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)'
4021 sleep 1
4022 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)'
4023 sleep 1
4024 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)'
4025 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)'
4026
4027 dnl sleep long enough to get more than one counter sample
4028 dnl from each datasource so we can check sequence numbers
4029 ovs-appctl time/warp 3000 100
4030 OVS_VSWITCHD_STOP
4031 ovs-appctl -t test-sflow exit
4032
4033 AT_CHECK_UNQUOTED([[sort sflow.log | $EGREP 'HEADER|ERROR' | sed 's/ /\
4034 /g']], [0], [dnl
4035HEADER
4036 dgramSeqNo=1
4037 ds=127.0.0.1>2:1000
4038 fsSeqNo=1
4039 in_vlan=0
4040 in_priority=0
4041 out_vlan=0
4042 out_priority=0
4043 meanSkip=1
4044 samplePool=1
4045 dropEvents=0
4046 in_ifindex=1004
4047 in_format=0
4048 out_ifindex=2
4049 out_format=2
4050 hdr_prot=1
4051 pkt_len=64
4052 stripped=4
4053 hdr_len=60
4054 hdr=FF-FF-FF-FF-FF-FF-50-54-00-00-00-05-08-06-00-01-08-00-06-04-00-01-50-54-00-00-00-05-C0-A8-00-02-00-00-00-00-00-00-C0-A8-00-01-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
4055HEADER
4056 dgramSeqNo=1
4057 ds=127.0.0.1>2:1000
4058 fsSeqNo=2
4059 in_vlan=0
4060 in_priority=0
4061 out_vlan=0
4062 out_priority=0
4063 meanSkip=1
4064 samplePool=2
4065 dropEvents=0
4066 in_ifindex=1003
4067 in_format=0
4068 out_ifindex=2
4069 out_format=2
4070 hdr_prot=1
4071 pkt_len=64
4072 stripped=4
4073 hdr_len=60
4074 hdr=FF-FF-FF-FF-FF-FF-50-54-00-00-00-07-08-06-00-01-08-00-06-04-00-01-50-54-00-00-00-07-C0-A8-00-01-00-00-00-00-00-00-C0-A8-00-02-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
4075HEADER
4076 dgramSeqNo=1
4077 ds=127.0.0.1>2:1000
4078 fsSeqNo=3
4079 in_vlan=0
4080 in_priority=0
4081 out_vlan=0
4082 out_priority=0
4083 meanSkip=1
4084 samplePool=3
4085 dropEvents=0
4086 in_ifindex=1004
4087 in_format=0
4088 out_ifindex=1003
4089 out_format=0
4090 hdr_prot=1
4091 pkt_len=64
4092 stripped=4
4093 hdr_len=60
4094 hdr=50-54-00-00-00-07-50-54-00-00-00-05-08-00-45-00-00-1C-00-00-00-00-40-01-F9-8D-C0-A8-00-01-C0-A8-00-02-08-00-F7-FF-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
4095HEADER
4096 dgramSeqNo=1
4097 ds=127.0.0.1>2:1000
4098 fsSeqNo=4
4099 in_vlan=0
4100 in_priority=0
4101 out_vlan=0
4102 out_priority=0
4103 meanSkip=1
4104 samplePool=4
4105 dropEvents=0
4106 in_ifindex=1003
4107 in_format=0
4108 out_ifindex=1004
4109 out_format=0
4110 hdr_prot=1
4111 pkt_len=64
4112 stripped=4
4113 hdr_len=60
4114 hdr=50-54-00-00-00-05-50-54-00-00-00-07-08-00-45-00-00-1C-00-00-00-00-40-01-F9-8D-C0-A8-00-02-C0-A8-00-01-00-00-FF-FF-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
4115HEADER
4116 dgramSeqNo=1
4117 ds=127.0.0.1>2:1000
4118 fsSeqNo=5
4119 in_vlan=0
4120 in_priority=0
4121 out_vlan=0
4122 out_priority=0
4123 meanSkip=1
4124 samplePool=5
4125 dropEvents=0
4126 in_ifindex=1003
4127 in_format=0
4128 out_ifindex=1004
4129 out_format=0
4130 hdr_prot=1
4131 pkt_len=64
4132 stripped=4
4133 hdr_len=60
4134 hdr=50-54-00-00-00-05-50-54-00-00-00-07-86-DD-67-00-00-00-00-00-0A-80-FE-80-00-00-00-00-00-00-00-00-00-00-00-00-00-01-FE-80-00-00-00-00-00-00-00-00-00-00-00-00-00-02-00-00-00-00-00-00
4135])
4136
4137 AT_CHECK_UNQUOTED([[sort sflow.log | $EGREP 'IFCOUNTERS|ERROR' | head -6 | sed 's/ /\
4138 /g']], [0], [dnl
4139IFCOUNTERS
4140 dgramSeqNo=2
4141 ds=127.0.0.1>0:1002
4142 csSeqNo=1
4143 ifindex=1002
4144 type=6
4145 ifspeed=100000000
4146 direction=0
4147 status=0
4148 in_octets=0
4149 in_unicasts=0
4150 in_multicasts=0
4151 in_broadcasts=4294967295
4152 in_discards=0
4153 in_errors=0
4154 in_unknownprotos=4294967295
4155 out_octets=120
4156 out_unicasts=2
4157 out_multicasts=4294967295
4158 out_broadcasts=4294967295
4159 out_discards=0
4160 out_errors=0
4161 promiscuous=0
4162IFCOUNTERS
4163 dgramSeqNo=2
4164 ds=127.0.0.1>0:1003
4165 csSeqNo=1
4166 ifindex=1003
4167 type=6
4168 ifspeed=100000000
4169 direction=0
4170 status=0
4171 in_octets=138
4172 in_unicasts=3
4173 in_multicasts=0
4174 in_broadcasts=4294967295
4175 in_discards=0
4176 in_errors=0
4177 in_unknownprotos=4294967295
4178 out_octets=120
4179 out_unicasts=2
4180 out_multicasts=4294967295
4181 out_broadcasts=4294967295
4182 out_discards=0
4183 out_errors=0
4184 promiscuous=0
4185IFCOUNTERS
4186 dgramSeqNo=2
4187 ds=127.0.0.1>0:1004
4188 csSeqNo=1
4189 ifindex=1004
4190 type=6
4191 ifspeed=100000000
4192 direction=0
4193 status=0
4194 in_octets=84
4195 in_unicasts=2
4196 in_multicasts=0
4197 in_broadcasts=4294967295
4198 in_discards=0
4199 in_errors=0
4200 in_unknownprotos=4294967295
4201 out_octets=180
4202 out_unicasts=3
4203 out_multicasts=4294967295
4204 out_broadcasts=4294967295
4205 out_discards=0
4206 out_errors=0
4207 promiscuous=0
4208IFCOUNTERS
4209 dgramSeqNo=3
4210 ds=127.0.0.1>0:1002
4211 csSeqNo=2
4212 ifindex=1002
4213 type=6
4214 ifspeed=100000000
4215 direction=0
4216 status=0
4217 in_octets=0
4218 in_unicasts=0
4219 in_multicasts=0
4220 in_broadcasts=4294967295
4221 in_discards=0
4222 in_errors=0
4223 in_unknownprotos=4294967295
4224 out_octets=120
4225 out_unicasts=2
4226 out_multicasts=4294967295
4227 out_broadcasts=4294967295
4228 out_discards=0
4229 out_errors=0
4230 promiscuous=0
4231IFCOUNTERS
4232 dgramSeqNo=3
4233 ds=127.0.0.1>0:1003
4234 csSeqNo=2
4235 ifindex=1003
4236 type=6
4237 ifspeed=100000000
4238 direction=0
4239 status=0
4240 in_octets=138
4241 in_unicasts=3
4242 in_multicasts=0
4243 in_broadcasts=4294967295
4244 in_discards=0
4245 in_errors=0
4246 in_unknownprotos=4294967295
4247 out_octets=120
4248 out_unicasts=2
4249 out_multicasts=4294967295
4250 out_broadcasts=4294967295
4251 out_discards=0
4252 out_errors=0
4253 promiscuous=0
4254IFCOUNTERS
4255 dgramSeqNo=3
4256 ds=127.0.0.1>0:1004
4257 csSeqNo=2
4258 ifindex=1004
4259 type=6
4260 ifspeed=100000000
4261 direction=0
4262 status=0
4263 in_octets=84
4264 in_unicasts=2
4265 in_multicasts=0
4266 in_broadcasts=4294967295
4267 in_discards=0
4268 in_errors=0
4269 in_unknownprotos=4294967295
4270 out_octets=180
4271 out_unicasts=3
4272 out_multicasts=4294967295
4273 out_broadcasts=4294967295
4274 out_discards=0
4275 out_errors=0
4276 promiscuous=0
4277])
4278 AT_CLEANUP])
4279
4280CHECK_SFLOW_SAMPLING_PACKET([127.0.0.1], [IPv4])
4281CHECK_SFLOW_SAMPLING_PACKET([[[::1]]], [IPv6])
4282
4283# CHECK_NETFLOW_EXPIRATION(LOOPBACK_ADDR, IP_VERSION_TYPE)
4284#
4285# Test that basic NetFlow reports flow statistics correctly:
4286# The initial packet of a flow are correctly accounted.
4287# Later packets within a flow are correctly accounted.
4288# Flow actions changing (in this case, due to MAC learning)
4289# cause a record to be sent.
4290#
4291# IP_VERSION_TYPE is used in AT_SETUP
4292m4_define([CHECK_NETFLOW_EXPIRATION],
4293 [AT_SETUP([ofproto-dpif - NetFlow flow expiration - $2 collector])
4294 OVS_VSWITCHD_START([set Bridge br0 fail-mode=standalone])
4295 ADD_OF_PORTS([br0], 1, 2)
4296
4297 ovs-appctl time/stop
4298 ON_EXIT([kill `cat test-netflow.pid`])
4299 AT_CHECK([ovstest test-netflow --log-file --detach --no-chdir --pidfile 0:$1 > netflow.log], [0], [], [ignore])
4300 AT_CAPTURE_FILE([netflow.log])
4301 NETFLOW_PORT=`parse_listening_port < test-netflow.log`
4302
4303 ovs-vsctl \
4304 set Bridge br0 netflow=@nf -- \
4305 --id=@nf create NetFlow targets=\"$1:$NETFLOW_PORT\" \
4306 engine_id=1 engine_type=2 active_timeout=30 add-id-to-interface=false
4307
4308 for delay in 1000 30000; do
4309 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)'
4310 sleep 1 # ensure the order in which these two packets are processed
4311 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)'
4312
4313 ovs-appctl time/warp $delay
4314 done
4315
4316 ovs-appctl time/warp 6000
4317 ovs-appctl revalidator/wait
4318 OVS_VSWITCHD_STOP
4319 ovs-appctl -t test-netflow exit
4320
4321 AT_CHECK([test `grep "192.168.0.1 > 192.168.0.2, if 1 > 65535, 1 pkts, 60 bytes, ICMP 8:0" netflow.log | wc -l` -eq 1])
4322
4323 AT_CHECK([test `grep "192.168.0.1 > 192.168.0.2, if 1 > 2, 1 pkts, 60 bytes, ICMP 8:0" netflow.log | wc -l` -eq 1])
4324
4325 combined=`grep "192.168.0.2 > 192.168.0.1, if 2 > 1, 2 pkts, 120 bytes, ICMP 0:0" netflow.log | wc -l`
4326 separate=`grep "192.168.0.2 > 192.168.0.1, if 2 > 1, 1 pkts, 60 bytes, ICMP 0:0" netflow.log | wc -l`
4327 AT_CHECK([test $separate = 2 || test $combined = 1], [0])
4328
4329 AT_CLEANUP])
4330
4331CHECK_NETFLOW_EXPIRATION([127.0.0.1], [IPv4])
4332CHECK_NETFLOW_EXPIRATION([[[::1]]], [IPv6])
4333
4334# CHECK_NETFLOW_ACTIVE_EXPIRATION(LOOPBACK_ADDR, IP_VERSION_TYPE)
4335#
4336# Test that basic NetFlow reports active expirations correctly.
4337#
4338# IP_VERSION_TYPE is used in AT_SETUP
4339m4_define([CHECK_NETFLOW_ACTIVE_EXPIRATION],
4340 [AT_SETUP([ofproto-dpif - NetFlow active expiration - $2 collector])
4341
4342 OVS_VSWITCHD_START([set Bridge br0 fail-mode=standalone])
4343 ADD_OF_PORTS([br0], 1, 2)
4344
4345 ON_EXIT([kill `cat test-netflow.pid`])
4346 AT_CHECK([ovstest test-netflow --log-file --detach --no-chdir --pidfile 0:$1 > netflow.log], [0], [], [ignore])
4347 AT_CAPTURE_FILE([netflow.log])
4348 NETFLOW_PORT=`parse_listening_port < test-netflow.log`
4349
4350 ovs-vsctl \
4351 set Bridge br0 netflow=@nf -- \
4352 --id=@nf create NetFlow targets=\"$1:$NETFLOW_PORT\" \
4353 engine_id=1 engine_type=2 active_timeout=10 add-id-to-interface=false
4354
4355 AT_CHECK([ovs-appctl time/stop])
4356 n=1
4357 while test $n -le 60; do
4358 n=`expr $n + 1`
4359
4360 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)'
4361 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)'
4362
4363 ovs-appctl time/warp 1000
4364 done
4365
4366 ovs-appctl time/warp 10000
4367
4368 ovs-appctl revalidator/wait
4369 OVS_VSWITCHD_STOP
4370 ovs-appctl -t test-netflow exit
4371
4372 # Count the number of reported packets:
4373 # - From source to destination before MAC learning kicks in (just one).
4374 # - From source to destination after that.
4375 # - From destination to source.
4376 n_learn=0
4377 n_in=0
4378 n_out=0
4379 n_other=0
4380 n_recs=0
4381 none=0
4382 while read line; do
4383 pkts=`echo "$line" | sed 's/.*, \([[0-9]]*\) pkts,.*/\1/'`
4384 case $pkts in
4385 [[0-9]]*) ;;
4386 *) continue ;;
4387 esac
4388
4389 case $line in
4390 "seq "*": 192.168.0.1 > 192.168.0.2, if 1 > 65535, "*" pkts, "*" bytes, TCP 1234 > 80, time "*)
4391 counter=n_learn
4392 ;;
4393 "seq "*": 192.168.0.1 > 192.168.0.2, if 1 > 2, "*" pkts, "*" bytes, TCP 1234 > 80, time "*)
4394 counter=n_in
4395 ;;
4396 "seq "*": 192.168.0.2 > 192.168.0.1, if 2 > 1, "*" pkts, "*" bytes, TCP 80 > 1234, time "*)
4397 counter=n_out
4398 ;;
4399 *)
4400 counter=n_other
4401 ;;
4402 esac
4403 eval $counter=\`expr \$$counter + \$pkts\`
4404 n_recs=`expr $n_recs + 1`
4405 done < netflow.log
4406
4407 # There should be exactly 1 MAC learning packet,
4408 # exactly 59 other packets in that direction,
4409 # and exactly 60 packets in the other direction.
4410 AT_CHECK([echo $n_learn $n_in $n_out $n_other], [0], [1 59 60 0
4411])
4412
4413 AT_CLEANUP])
4414
4415CHECK_NETFLOW_ACTIVE_EXPIRATION([127.0.0.1], [IPv4])
4416CHECK_NETFLOW_ACTIVE_EXPIRATION([[[::1]]], [IPv6])
4417
4418AT_SETUP([ofproto-dpif - flow stats])
4419OVS_VSWITCHD_START
4420AT_CHECK([ovs-ofctl add-flow br0 "ip,actions=NORMAL"])
4421AT_CHECK([ovs-ofctl add-flow br0 "icmp,actions=NORMAL"])
4422
4423ovs-appctl time/stop
4424
4425for i in `seq 1 10`; do
4426 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)'
4427done
4428
4429ovs-appctl time/warp 1000
4430ovs-appctl revalidator/wait
4431
4432AT_CHECK([ovs-ofctl dump-flows br0], [0], [stdout])
4433AT_CHECK([STRIP_XIDS stdout | sed -n 's/duration=[[0-9]]*\.[[0-9]]*s/duration=0.0s/p' | sort], [0], [dnl
4434 cookie=0x0, duration=0.0s, table=0, n_packets=0, n_bytes=0, idle_age=1, icmp actions=NORMAL
4435 cookie=0x0, duration=0.0s, table=0, n_packets=10, n_bytes=600, idle_age=1, ip actions=NORMAL
4436])
4437OVS_VSWITCHD_STOP
4438AT_CLEANUP
4439
4440AT_SETUP([ofproto-dpif - flow stats, set-n-threads])
4441OVS_VSWITCHD_START
4442AT_CHECK([ovs-ofctl add-flow br0 "ip,actions=NORMAL"])
4443AT_CHECK([ovs-ofctl add-flow br0 "icmp,actions=NORMAL"])
4444
4445ovs-appctl time/stop
4446
4447for i in `seq 1 10`; do
4448 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)'
4449done
4450
4451ovs-appctl time/warp 100
4452AT_CHECK([ovs-vsctl set Open_vSwitch . other-config:n-revalidator-threads=2])
4453ovs-appctl time/warp 1000
4454
4455AT_CHECK([ovs-ofctl dump-flows br0], [0], [stdout])
4456AT_CHECK([STRIP_XIDS stdout | sed -n 's/duration=[[0-9]]*\.[[0-9]]*s/duration=0.0s/p' | sort], [0], [dnl
4457 cookie=0x0, duration=0.0s, table=0, n_packets=0, n_bytes=0, idle_age=1, icmp actions=NORMAL
4458 cookie=0x0, duration=0.0s, table=0, n_packets=10, n_bytes=600, idle_age=1, ip actions=NORMAL
4459])
4460OVS_VSWITCHD_STOP
4461AT_CLEANUP
4462
4463AT_SETUP([idle_age and hard_age increase over time])
4464OVS_VSWITCHD_START
4465
4466# get_ages DURATION HARD IDLE
4467#
4468# Fetch the flow duration, hard age, and idle age into the variables
4469# whose names are given as arguments. Rounds DURATION down to the
4470# nearest integer. If hard_age doesn't appear in the output, sets
4471# HARD to "none". If idle_age doesn't appear in the output, sets IDLE
4472# to 0.
4473get_ages () {
4474 AT_CHECK([ovs-ofctl dump-flows br0], [0], [stdout])
4475
4476 duration=`sed -n 's/.*duration=\([[0-9]]*\)\(\.[[0-9]]*\)\{0,1\}s.*/\1/p' stdout`
4477 AT_CHECK([[expr X"$duration" : 'X[0-9][0-9]*$']], [0], [ignore])
4478 AS_VAR_COPY([$1], [duration])
4479
4480 hard=`sed -n 's/.*hard_age=\([[0-9]]*\),.*/\1/p' stdout`
4481 if test X"$hard" = X; then
4482 hard=none
4483 else
4484 AT_CHECK([[expr X"$hard" : 'X[0-9][0-9]*$']], [0], [ignore])
4485 fi
4486 AS_VAR_COPY([$2], [hard])
4487
4488 idle=`sed -n 's/.*idle_age=\([[0-9]]*\),.*/\1/p' stdout`
4489 if test X"$idle" = X; then
4490 idle=0
4491 else
4492 AT_CHECK([[expr X"$idle" : 'X[0-9][0-9]*$']], [0], [ignore])
4493 fi
4494 AS_VAR_COPY([$3], [idle])
4495}
4496
4497# Add a flow and get its initial hard and idle age.
4498AT_CHECK([ovs-ofctl add-flow br0 hard_timeout=199,idle_timeout=188,actions=drop])
4499get_ages duration1 hard1 idle1
4500
4501ovs-appctl time/stop
4502# Warp time forward by 10 seconds, then modify the flow's actions.
4503ovs-appctl time/warp 10000
4504get_ages duration2 hard2 idle2
4505AT_CHECK([ovs-ofctl mod-flows br0 actions=flood])
4506
4507# Warp time forward by 10 seconds.
4508ovs-appctl time/warp 10000
4509get_ages duration3 hard3 idle3
4510
4511# Warp time forward 10 more seconds, then pass some packets through the flow,
4512# then warp forward a few more times because idle times are only updated
4513# occasionally.
4514ovs-appctl time/warp 10000
4515ovs-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)'
4516ovs-appctl time/warp 3000 1000
4517sleep 1
4518get_ages duration4 hard4 idle4
4519
4520printf "duration: %4s => %4s => %4s => %4s\n" $duration1 $duration2 $duration3 $duration4
4521printf "hard_age: %4s => %4s => %4s => %4s\n" $hard1 $hard2 $hard3 $hard4
4522printf "idle_age: %4s => %4s => %4s => %4s\n" $idle1 $idle2 $idle3 $idle4
4523
4524# Duration should increase steadily over time.
4525AT_CHECK([test $duration1 -lt $duration2])
4526AT_CHECK([test $duration2 -lt $duration3])
4527AT_CHECK([test $duration3 -lt $duration4])
4528
4529# Hard age should be "none" initially because it's the same as flow_duration,
4530# then it should increase.
4531AT_CHECK([test $hard1 = none])
4532AT_CHECK([test $hard2 = none])
4533AT_CHECK([test $hard3 != none])
4534AT_CHECK([test $hard4 != none])
4535AT_CHECK([test $hard3 -lt $hard4])
4536
4537# Idle age should increase from 1 to 2 to 3, then decrease.
4538AT_CHECK([test $idle1 -lt $idle2])
4539AT_CHECK([test $idle2 -lt $idle3])
4540AT_CHECK([test $idle3 -gt $idle4])
4541
4542# Check some invariant relationships.
4543AT_CHECK([test $duration1 = $idle1])
4544AT_CHECK([test $duration2 = $idle2])
4545AT_CHECK([test $duration3 = $idle3])
4546AT_CHECK([test $idle3 -gt $hard3])
4547AT_CHECK([test $idle4 -lt $hard4])
4548AT_CHECK([test $hard4 -lt $duration4])
4549
4550OVS_VSWITCHD_STOP
4551AT_CLEANUP
4552
4553AT_SETUP([ofproto-dpif - fin_timeout])
4554OVS_VSWITCHD_START
4555ovs-appctl time/stop
4556AT_CHECK([ovs-ofctl add-flow br0 'idle_timeout=60,actions=fin_timeout(idle_timeout=5)'])
4557AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip], [0],
4558[NXST_FLOW reply:
4559 idle_timeout=60, actions=fin_timeout(idle_timeout=5)
4560])
4561
4562# Check that a TCP SYN packet does not change the timeout. (Because
4563# flow stats updates are mainly what implements the fin_timeout
4564# feature, we warp forward a couple of times to ensure that flow stats
4565# run before re-checking the flow table.)
4566AT_CHECK([ovs-appctl netdev-dummy/receive br0 0021853763af0026b98cb0f908004500003c2e2440004006465dac11370dac11370b828b0016751e267b00000000a00216d017360000020405b40402080a2d25085f0000000001030307])
4567AT_CHECK([ovs-appctl time/warp 1000 && ovs-appctl time/warp 1000], [0], [warped
4568warped
4569])
4570ovs-appctl revalidator/wait
4571AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip], [0],
4572[NXST_FLOW reply:
4573 n_packets=1, n_bytes=74, idle_timeout=60, actions=fin_timeout(idle_timeout=5)
4574])
4575# Check that a TCP FIN packet does change the timeout.
4576AT_CHECK([ovs-appctl netdev-dummy/receive br0 0021853763af0026b98cb0f90800451000342e3e40004006463bac11370dac11370b828b0016751e319dfc96399b801100717ae800000101080a2d250a9408579588])
4577AT_CHECK([ovs-appctl time/warp 1000 && ovs-appctl time/warp 1000], [0], [warped
4578warped
4579])
4580AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip], [0],
4581[NXST_FLOW reply:
4582 n_packets=2, n_bytes=140, idle_timeout=5, actions=fin_timeout(idle_timeout=5)
4583])
4584OVS_VSWITCHD_STOP
4585AT_CLEANUP
4586
4587AT_SETUP([ofproto-dpif - ovs-appctl dpif/dump-dps])
4588OVS_VSWITCHD_START([add-br br1 -- set bridge br1 datapath-type=dummy])
4589ADD_OF_PORTS([br0], [1], [2])
4590ADD_OF_PORTS([br1], [3])
4591
4592AT_CHECK([ovs-appctl dpif/dump-dps], [0], [dnl
4593dummy@br0
4594dummy@br1
4595])
4596OVS_VSWITCHD_STOP
4597AT_CLEANUP
4598
4599AT_SETUP([ofproto-dpif - ovs-appctl dpif/show])
4600OVS_VSWITCHD_START([add-br br1 -- set bridge br1 datapath-type=dummy])
4601ADD_OF_PORTS([br0], [1], [2])
4602ADD_OF_PORTS([br1], [3])
4603
4604AT_CHECK([ovs-appctl dpif/show], [0], [dnl
4605dummy@ovs-dummy: hit:0 missed:0
4606 br0:
4607 br0 65534/100: (dummy)
4608 p1 1/1: (dummy)
4609 p2 2/2: (dummy)
4610 br1:
4611 br1 65534/101: (dummy)
4612 p3 3/3: (dummy)
4613])
4614OVS_VSWITCHD_STOP
4615AT_CLEANUP
4616
4617AT_SETUP([ofproto-dpif - ovs-appctl dpif/dump-flows])
4618# bump max-idle to avoid the flows being reclaimed behind us
4619OVS_VSWITCHD_START([add-br br1 -- \
4620 set bridge br1 datapath-type=dummy fail-mode=secure -- \
4621 set Open_vSwitch . other_config:max-idle=10000])
4622ADD_OF_PORTS([br0], [1], [2])
4623ADD_OF_PORTS([br1], [3])
4624
4625AT_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)'])
4626AT_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)'])
4627AT_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)'])
4628ovs-appctl revalidator/wait
4629AT_CHECK([ovs-appctl dpif/dump-flows br0 | sort | STRIP_USED], [0], [dnl
4630recirc_id(0),in_port(1),eth_type(0x0800),ipv4(frag=no), packets:0, bytes:0, used:never, actions:drop
4631recirc_id(0),in_port(2),eth_type(0x0800),ipv4(frag=no), packets:0, bytes:0, used:never, actions:drop
4632])
4633
4634AT_CHECK([ovs-appctl dpif/dump-flows br1 | sort | STRIP_USED], [0], [dnl
4635recirc_id(0),in_port(3),eth_type(0x0800),ipv4(frag=no), packets:0, bytes:0, used:never, actions:drop
4636])
4637
4638AT_CHECK([ovs-appctl dpif/dump-flows -m br0 | sort | STRIP_USED], [0], [dnl
4639skb_priority(0/0),skb_mark(0/0),recirc_id(0),dp_hash(0/0),in_port(p1),eth(src=50:54:00:00:00:05/00:00:00:00:00:00,dst=50:54:00:00:00:07/00:00:00:00:00:00),eth_type(0x0800),ipv4(src=192.168.0.1/0.0.0.0,dst=192.168.0.2/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no),icmp(type=8/0,code=0/0), packets:0, bytes:0, used:never, actions:drop
4640skb_priority(0/0),skb_mark(0/0),recirc_id(0),dp_hash(0/0),in_port(p2),eth(src=50:54:00:00:00:07/00:00:00:00:00:00,dst=50:54:00:00:00:05/00:00:00:00:00:00),eth_type(0x0800),ipv4(src=192.168.0.2/0.0.0.0,dst=192.168.0.1/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no),icmp(type=0/0,code=0/0), packets:0, bytes:0, used:never, actions:drop
4641])
4642
4643AT_CHECK([ovs-appctl dpif/dump-flows -m br1 | sort | STRIP_USED], [0], [dnl
4644skb_priority(0/0),skb_mark(0/0),recirc_id(0),dp_hash(0/0),in_port(p3),eth(src=50:54:00:00:00:09/00:00:00:00:00:00,dst=50:54:00:00:00:0a/00:00:00:00:00:00),eth_type(0x0800),ipv4(src=10.0.0.2/0.0.0.0,dst=10.0.0.1/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no),icmp(type=8/0,code=0/0), packets:0, bytes:0, used:never, actions:drop
4645])
4646
4647OVS_VSWITCHD_STOP
4648AT_CLEANUP
4649
4650AT_SETUP([ofproto-dpif - MPLS actions that result in a userspace action])
4651OVS_VSWITCHD_START([dnl
4652 add-port br0 p1 -- set Interface p1 type=dummy
4653])
4654AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
4655ON_EXIT([kill `cat ovs-ofctl.pid`])
4656
4657AT_CAPTURE_FILE([ofctl_monitor.log])
4658AT_DATA([flows.txt], [dnl
4659dl_src=60:66:66:66:66:00 actions=push_mpls:0x8847,controller
4660dl_src=60:66:66:66:66:01 actions=pop_mpls:0x8849,controller
4661])
4662AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
4663
4664dnl Packet is sent to userspace because a MPLS push or pop action is applied to
4665dnl a packet with 2 MPLS LSEs but dpif-netdev can't handle any labels.
4666dnl
4667dnl The input is a frame with two MPLS labels which tcpdump -vve shows as:
4668dnl 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)
4669dnl (label 20, exp 0, [S], ttl 32)
4670dnl (tos 0x0, ttl 64, id 0, offset 0, flags [none], proto TCP (6), length 44, bad cksum 3b78 (->f978)!)
4671dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x7744 (correct), seq 42:46, win 10000, length 4
4672
4673for dl_src in 00 01; do
4674 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"])
4675done
4676sleep 1 # wait for the datapath flow installed
4677for dl_src in 00 01; do
4678 AT_CHECK_UNQUOTED([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | grep "$dl_src," | STRIP_USED], [0], [dnl
4679recirc_id=0,mpls,in_port=1,dl_src=60:66:66:66:66:$dl_src,mpls_label=20,mpls_tc=0,mpls_ttl=32,mpls_bos=0,mpls_lse1=82208,mpls_lse2=0, actions:userspace(pid=0,slow_path(controller))
4680])
4681done
4682
4683OVS_VSWITCHD_STOP
4684AT_CLEANUP
4685
4686
4687AT_SETUP([ofproto-dpif - MPLS actions that result in a drop])
4688OVS_VSWITCHD_START([dnl
4689 add-port br0 p1 -- set Interface p1 type=dummy
4690])
4691AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
4692ON_EXIT([kill `cat ovs-ofctl.pid`])
4693
4694AT_CAPTURE_FILE([ofctl_monitor.log])
4695AT_DATA([flows.txt], [dnl
4696dl_src=60:66:66:66:66:00 actions=push_mpls:0x8847,controller
4697dl_src=60:66:66:66:66:01 actions=pop_mpls:0x8849,controller
4698])
4699AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
4700
4701dnl Packet is dropped because an MPLS PUSH action is applied to a packet with
4702dnl 4 MPLS LSEs but ovs-vswtichd can only handle up to 3 MPLS LSEs and thus
4703dnl can't determine the resulting MPLS label after MPLS push/pop actions.
4704dnl
4705dnl The input is a frame with two MPLS headers which tcpdump -vve shows as:
4706dnl 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)
4707dnl (label 20, exp 0, ttl 32)
4708dnl (label 20, exp 0, ttl 32)
4709dnl (label 20, exp 0, [S], ttl 32)
4710dnl (tos 0x0, ttl 64, id 0, offset 0, flags [none], proto TCP (6), length 44, bad cksum 3b78 (->f978)!)
4711dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x7744 (correct), seq 42:46, win 10000, length 4
4712
4713for dl_src in 00 01; do
4714 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"])
4715done
4716sleep 1 # wait for the datapath flow installed
4717for dl_src in 00 01; do
4718 AT_CHECK_UNQUOTED([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | grep "$dl_src," | STRIP_USED], [0], [dnl
4719recirc_id=0,mpls,in_port=1,dl_src=60:66:66:66:66:$dl_src,mpls_label=20,mpls_tc=0,mpls_ttl=32,mpls_bos=0,mpls_lse1=82208,mpls_lse2=0, actions:userspace(pid=0,slow_path(controller))
4720])
4721done
4722
4723OVS_VSWITCHD_STOP
4724AT_CLEANUP
4725
4726AT_SETUP([ofproto-dpif - patch ports])
4727OVS_VSWITCHD_START([add-br br1 \
4728-- set bridge br1 datapath-type=dummy fail-mode=secure \
4729-- add-port br1 pbr1 -- set int pbr1 type=patch options:peer=pbr0 \
4730-- add-port br0 pbr0 -- set int pbr0 type=patch options:peer=pbr1])
4731
4732ADD_OF_PORTS([br0], [2])
4733ADD_OF_PORTS([br1], [3])
4734
4735AT_CHECK([ovs-appctl time/stop])
4736AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
4737
4738AT_CHECK([ovs-ofctl add-flow br0 actions=LOCAL,output:1,output:2])
4739AT_CHECK([ovs-ofctl add-flow br1 actions=LOCAL,output:1,output:3])
4740
4741for i in $(seq 1 10); do
4742 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)'
4743 if [[ $i -eq 1 ]]; then
4744 sleep 1
4745 fi
4746done
4747
4748for i in $(seq 1 5); do
4749 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)'
4750 if [[ $i -eq 1 ]]; then
4751 sleep 1
4752 fi
4753done
4754
4755AT_CHECK([ovs-appctl time/warp 500], [0],
4756[warped
4757])
4758sleep 1 # wait for log writer
4759
4760AT_CHECK([ovs-appctl dpif/show], [0], [dnl
4761dummy@ovs-dummy: hit:13 missed:2
4762 br0:
4763 br0 65534/100: (dummy)
4764 p2 2/2: (dummy)
4765 pbr0 1/none: (patch: peer=pbr1)
4766 br1:
4767 br1 65534/101: (dummy)
4768 p3 3/3: (dummy)
4769 pbr1 1/none: (patch: peer=pbr0)
4770])
4771
4772AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_USED], [0], [dnl
4773recirc_id=0,ip,in_port=100,nw_frag=no, actions:101,3,2
4774recirc_id=0,ip,in_port=101,nw_frag=no, actions:100,2,3
4775])
4776
4777AT_CHECK([cat ovs-vswitchd.log | grep -e 'in_port(100).*packets:9' | FILTER_FLOW_DUMP], [0], [dnl
4778skb_priority(0/0),skb_mark(0/0),recirc_id(0),dp_hash(0/0),in_port(100),eth(src=50:54:00:00:00:05/00:00:00:00:00:00,dst=50:54:00:00:00:07/00:00:00:00:00:00),eth_type(0x0800),ipv4(src=192.168.0.1/0.0.0.0,dst=192.168.0.2/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no),icmp(type=8/0,code=0/0), packets:9, bytes:540, used:0.0s, actions:101,3,2
4779])
4780AT_CHECK([cat ovs-vswitchd.log | grep -e 'in_port(101).*packets:4' | FILTER_FLOW_DUMP], [0], [dnl
4781skb_priority(0/0),skb_mark(0/0),recirc_id(0),dp_hash(0/0),in_port(101),eth(src=50:54:00:00:00:07/00:00:00:00:00:00,dst=50:54:00:00:00:05/00:00:00:00:00:00),eth_type(0x0800),ipv4(src=192.168.0.2/0.0.0.0,dst=192.168.0.1/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no),icmp(type=8/0,code=0/0), packets:4, bytes:240, used:0.0s, actions:100,2,3
4782])
4783
4784AT_CHECK([ovs-ofctl dump-ports br0 pbr0], [0], [dnl
4785OFPST_PORT reply (xid=0x4): 1 ports
4786 port 1: rx pkts=5, bytes=300, drop=0, errs=0, frame=0, over=0, crc=0
4787 tx pkts=10, bytes=600, drop=0, errs=0, coll=0
4788])
4789
4790AT_CHECK([ovs-ofctl dump-ports br1 pbr1], [0], [dnl
4791OFPST_PORT reply (xid=0x4): 1 ports
4792 port 1: rx pkts=10, bytes=600, drop=0, errs=0, frame=0, over=0, crc=0
4793 tx pkts=5, bytes=300, drop=0, errs=0, coll=0
4794])
4795
4796OVS_VSWITCHD_STOP
4797AT_CLEANUP
4798
4799AT_SETUP([ofproto-dpif - port duration])
4800OVS_VSWITCHD_START([set Bridge br0 protocols=OpenFlow13])
4801ADD_OF_PORTS([br0], 1, 2)
4802
4803ovs-appctl time/stop
4804ovs-appctl time/warp 10000
4805
4806AT_CHECK([ovs-ofctl -O openflow13 dump-ports br0], [0], [stdout])
4807AT_CHECK([sed -n 's/=[[0-9]][[0-9]]\(\.[[0-9]][[0-9]]*\)\{0,1\}s/=?s/p' stdout], [0],
4808[dnl
4809 duration=?s
4810 duration=?s
4811 duration=?s
4812])
4813OVS_VSWITCHD_STOP
4814AT_CLEANUP
4815
4816dnl ----------------------------------------------------------------------
4817AT_BANNER([ofproto-dpif -- megaflows])
4818
4819AT_SETUP([ofproto-dpif megaflow - port classification])
4820OVS_VSWITCHD_START
4821AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
4822ADD_OF_PORTS([br0], [1], [2])
4823AT_DATA([flows.txt], [dnl
4824table=0 in_port=1 actions=output(2)
4825])
4826AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
4827AT_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)'])
4828sleep 1
4829AT_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)'])
4830sleep 1
4831AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl
4832recirc_id=0,ip,in_port=1,nw_frag=no, actions: <del>
4833])
4834OVS_VSWITCHD_STOP
4835AT_CLEANUP
4836
4837AT_SETUP([ofproto-dpif megaflow - L2 classification])
4838OVS_VSWITCHD_START
4839AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
4840ADD_OF_PORTS([br0], [1], [2])
4841AT_DATA([flows.txt], [dnl
4842table=0 in_port=1,dl_src=50:54:00:00:00:09 actions=output(2)
4843])
4844AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
4845AT_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)'])
4846AT_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)'])
4847sleep 1
4848AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl
4849recirc_id=0,ip,in_port=1,dl_src=50:54:00:00:00:09,nw_frag=no, actions: <del>
4850recirc_id=0,ip,in_port=1,dl_src=50:54:00:00:00:0b/ff:ff:00:00:00:02,nw_frag=no, actions: <del>
4851])
4852OVS_VSWITCHD_STOP
4853AT_CLEANUP
4854
4855AT_SETUP([ofproto-dpif megaflow - L3 classification])
4856OVS_VSWITCHD_START
4857AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
4858ADD_OF_PORTS([br0], [1], [2])
4859AT_CHECK([ovs-vsctl set Bridge br0 flow_tables:0=@N1 -- --id=@N1 create Flow_Table name=t0 prefixes=nw_dst,nw_src], [0], [ignore], [])
4860AT_DATA([flows.txt], [dnl
4861table=0 in_port=1,icmp,nw_src=10.0.0.4 actions=output(2)
4862])
4863AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
4864AT_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)'])
4865AT_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)'])
4866sleep 1
4867AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl
4868recirc_id=0,icmp,in_port=1,nw_src=10.0.0.4,nw_frag=no, actions: <del>
4869recirc_id=0,ip,in_port=1,nw_src=10.0.0.2/0.0.0.2,nw_frag=no, actions: <del>
4870])
4871OVS_VSWITCHD_STOP
4872AT_CLEANUP
4873
4874AT_SETUP([ofproto-dpif megaflow - IPv6 classification])
4875OVS_VSWITCHD_START
4876AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
4877ADD_OF_PORTS([br0], [1], [2])
4878AT_CHECK([ovs-vsctl set Bridge br0 flow_tables:0=@N1 -- --id=@N1 create Flow_Table name=t0 prefixes=ipv6_dst,ipv6_src], [0], [ignore], [])
4879AT_DATA([flows.txt], [dnl
4880table=0 in_port=1,ipv6,ipv6_src=2001:db8:3c4d:1:2:3:4:5 actions=output(2)
4881])
4882AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
4883AT_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)'])
4884AT_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)'])
4885sleep 1
4886AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl
4887recirc_id=0,ipv6,in_port=1,ipv6_src=2001:db8:3c4d:1:2:3:4:5,nw_frag=no, actions: <del>
4888recirc_id=0,ipv6,in_port=1,ipv6_src=2001:db8:3c4d:5:4:3:2:1/ffff:ffff:0:4::,nw_frag=no, actions: <del>
4889])
4890OVS_VSWITCHD_STOP
4891AT_CLEANUP
4892
4893AT_SETUP([ofproto-dpif megaflow - L4 classification])
4894OVS_VSWITCHD_START
4895AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
4896ADD_OF_PORTS([br0], [1], [2])
4897AT_DATA([flows.txt], [dnl
4898table=0 in_port=1,icmp,icmp_type=8 actions=output(2)
4899])
4900AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
4901AT_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)'])
4902sleep 1
4903AT_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)'])
4904sleep 1
4905AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl
4906recirc_id=0,icmp,in_port=1,nw_frag=no,icmp_type=0x8/0xff, actions: <del>
4907])
4908OVS_VSWITCHD_STOP
4909AT_CLEANUP
4910
4911AT_SETUP([ofproto-dpif megaflow - normal])
4912OVS_VSWITCHD_START
4913AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
4914ADD_OF_PORTS([br0], [1], [2])
4915AT_CHECK([ovs-ofctl add-flow br0 action=normal])
4916AT_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)'])
4917AT_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)'])
4918sleep 1
4919AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl
4920recirc_id=0,ip,in_port=1,vlan_tci=0x0000/0x1fff,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,nw_frag=no, actions: <del>
4921recirc_id=0,ip,in_port=1,vlan_tci=0x0000/0x1fff,dl_src=50:54:00:00:00:0b,dl_dst=50:54:00:00:00:0c,nw_frag=no, actions: <del>
4922])
4923OVS_VSWITCHD_STOP
4924AT_CLEANUP
4925
4926AT_SETUP([ofproto-dpif megaflow - mpls])
4927OVS_VSWITCHD_START
4928AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
4929ADD_OF_PORTS([br0], [1], [2])
4930AT_DATA([flows.txt], [dnl
4931table=0 dl_src=50:54:00:00:00:09 actions=push_mpls:0x8847,2
4932table=0 dl_src=50:54:00:00:00:0b actions=pop_mpls:0x0800,2
4933])
4934AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
4935AT_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)'])
4936AT_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)'])
4937sleep 1
4938AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl
4939recirc_id=0,mpls,in_port=1,dl_src=50:54:00:00:00:09,mpls_label=11,mpls_tc=3,mpls_ttl=64,mpls_bos=1,mpls_lse1=0,mpls_lse2=0, actions: <del>
4940recirc_id=0,mpls,in_port=1,dl_src=50:54:00:00:00:0b,mpls_label=11,mpls_tc=3,mpls_ttl=64,mpls_bos=1,mpls_lse1=0,mpls_lse2=0, actions: <del>
4941])
4942OVS_VSWITCHD_STOP
4943AT_CLEANUP
4944
4945# CHECK_MEGAFLOW_NETFLOW(LOOPBACK_ADDR, IP_VERSION_TYPE)
4946#
4947# IP_VERSION_TYPE is used in AT_SETUP
4948m4_define([CHECK_MEGAFLOW_NETFLOW],
4949 [AT_SETUP([ofproto-dpif megaflow - netflow - $2 collector])
4950 OVS_VSWITCHD_START
4951 AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
4952 ADD_OF_PORTS([br0], [1], [2])
4953
4954 dnl NetFlow configuration disables wildcarding relevant fields
4955 ON_EXIT([kill `cat test-netflow.pid`])
4956 AT_CHECK([ovstest test-netflow --log-file --detach --no-chdir --pidfile 0:$1 > netflow.log], [0], [], [ignore])
4957 AT_CAPTURE_FILE([netflow.log])
4958 NETFLOW_PORT=`parse_listening_port < test-netflow.log`
4959 ovs-vsctl \
4960 set Bridge br0 netflow=@nf -- \
4961 --id=@nf create NetFlow targets=\"$1:$NETFLOW_PORT\" \
4962 engine_id=1 engine_type=2 active_timeout=30 add-id-to-interface=false
4963
4964 AT_CHECK([ovs-ofctl add-flow br0 action=normal])
4965 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)'])
4966 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)'])
4967 sleep 1
4968 AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl
4969recirc_id=0,icmp,in_port=1,vlan_tci=0x0000/0x1fff,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,nw_src=10.0.0.2,nw_dst=10.0.0.1,nw_tos=0,nw_frag=no,icmp_type=0x8/0xff,icmp_code=0x0/0xff, actions: <del>
4970recirc_id=0,icmp,in_port=1,vlan_tci=0x0000/0x1fff,dl_src=50:54:00:00:00:0b,dl_dst=50:54:00:00:00:0c,nw_src=10.0.0.4,nw_dst=10.0.0.3,nw_tos=0,nw_frag=no,icmp_type=0x8/0xff,icmp_code=0x0/0xff, actions: <del>
4971])
4972 OVS_VSWITCHD_STOP
4973 AT_CLEANUP])
4974
4975CHECK_MEGAFLOW_NETFLOW([127.0.0.1], [IPv4])
4976CHECK_MEGAFLOW_NETFLOW([[[::1]]], [IPv6])
4977
4978AT_SETUP([ofproto-dpif megaflow - normal, active-backup bonding])
4979OVS_VSWITCHD_START(
4980 [add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1 -- \
4981 add-bond br0 bond0 p2 p3 bond_mode=active-backup -- \
4982 set interface p2 type=dummy ofport_request=2 -- \
4983 set interface p3 type=dummy ofport_request=3])
4984AT_CHECK([ovs-appctl netdev-dummy/set-admin-state up], 0, [OK
4985])
4986AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
4987
4988AT_CHECK([ovs-ofctl add-flow br0 action=normal])
4989AT_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)'])
4990AT_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)'])
4991sleep 1
4992AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl
4993recirc_id=0,ip,in_port=1,vlan_tci=0x0000/0x1fff,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,nw_frag=no, actions: <del>
4994recirc_id=0,ip,in_port=1,vlan_tci=0x0000/0x1fff,dl_src=50:54:00:00:00:0b,dl_dst=50:54:00:00:00:0c,nw_frag=no, actions: <del>
4995])
4996OVS_VSWITCHD_STOP
4997AT_CLEANUP
4998
4999AT_SETUP([ofproto-dpif megaflow - normal, balance-slb bonding])
5000OVS_VSWITCHD_START(
5001 [add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1 -- \
5002 add-bond br0 bond0 p2 p3 bond_mode=balance-slb -- \
5003 set interface p2 type=dummy ofport_request=2 -- \
5004 set interface p3 type=dummy ofport_request=3])
5005AT_CHECK([ovs-appctl netdev-dummy/set-admin-state up], 0, [OK
5006])
5007AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
5008
5009AT_CHECK([ovs-ofctl add-flow br0 action=normal])
5010AT_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)'])
5011AT_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)'])
5012sleep 1
5013AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl
5014recirc_id=0,ip,in_port=1,vlan_tci=0x0000/0x1fff,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,nw_frag=no, actions: <del>
5015recirc_id=0,ip,in_port=1,vlan_tci=0x0000/0x1fff,dl_src=50:54:00:00:00:0b,dl_dst=50:54:00:00:00:0c,nw_frag=no, actions: <del>
5016])
5017OVS_VSWITCHD_STOP
5018AT_CLEANUP
5019
5020AT_SETUP([ofproto-dpif megaflow - normal, balance-tcp bonding])
5021# Create bond0 on br0 with interfaces p0 and p1
5022# and bond1 on br1 with interfaces p2 and p3
5023# with p0 patched to p2 and p1 patched to p3.
5024OVS_VSWITCHD_START(
5025 [add-bond br0 bond0 p0 p1 bond_mode=balance-tcp lacp=active \
5026 other-config:lacp-time=fast \
5027 other-config:bond-rebalance-interval=0 -- \
5028 set interface p0 type=patch options:peer=p2 ofport_request=1 -- \
5029 set interface p1 type=patch options:peer=p3 ofport_request=2 -- \
5030 add-br br1 -- \
5031 set bridge br1 other-config:hwaddr=aa:66:aa:66:00:00 -- \
5032 set bridge br1 datapath-type=dummy other-config:datapath-id=1234 \
5033 fail-mode=secure -- \
5034 add-bond br1 bond1 p2 p3 bond_mode=balance-tcp lacp=active \
5035 other-config:lacp-time=fast \
5036 other-config:bond-rebalance-interval=0 -- \
5037 set interface p2 type=patch options:peer=p0 ofport_request=3 -- \
5038 set interface p3 type=patch options:peer=p1 ofport_request=4 --])
5039
5040AT_CHECK([ovs-appctl netdev-dummy/set-admin-state up], 0, [OK
5041])
5042AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
5043ADD_OF_PORTS([br0], [7])
5044AT_CHECK([ovs-ofctl add-flow br0 action=normal])
5045AT_CHECK([ovs-ofctl add-flow br1 action=normal])
5046ovs-appctl time/stop
5047ovs-appctl time/warp 5000
5048AT_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)'])
5049AT_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)'])
5050sleep 1
5051AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl
5052recirc_id=0,ip,in_port=7,vlan_tci=0x0000/0x1fff,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,nw_frag=no, actions: <del>
5053recirc_id=0,ip,in_port=7,vlan_tci=0x0000/0x1fff,dl_src=50:54:00:00:00:0b,dl_dst=50:54:00:00:00:0c,nw_frag=no, actions: <del>
5054])
5055OVS_VSWITCHD_STOP
5056AT_CLEANUP
5057
5058AT_SETUP([ofproto-dpif megaflow - resubmit port action])
5059OVS_VSWITCHD_START
5060AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
5061ADD_OF_PORTS([br0], [1], [2])
5062AT_DATA([flows.txt], [dnl
5063table=0 in_port=1,ip actions=resubmit(90)
5064table=0 in_port=90,dl_src=50:54:00:00:00:09 actions=output(2)
5065])
5066AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
5067AT_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)'])
5068AT_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)'])
5069sleep 1
5070AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl
5071recirc_id=0,ip,in_port=1,dl_src=50:54:00:00:00:09,nw_frag=no, actions: <del>
5072recirc_id=0,ip,in_port=1,dl_src=50:54:00:00:00:0b/ff:ff:00:00:00:02,nw_frag=no, actions: <del>
5073])
5074OVS_VSWITCHD_STOP
5075AT_CLEANUP
5076
5077AT_SETUP([ofproto-dpif megaflow - resubmit table action])
5078OVS_VSWITCHD_START
5079AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
5080ADD_OF_PORTS([br0], [1], [2])
5081AT_DATA([flows.txt], [dnl
5082table=0 in_port=1,ip actions=resubmit(,1)
5083table=1 dl_src=50:54:00:00:00:09 actions=output(2)
5084])
5085AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
5086AT_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)'])
5087AT_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=
50881,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
5089sleep 1
5090AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl
5091recirc_id=0,ip,in_port=1,dl_src=50:54:00:00:00:09,nw_frag=no, actions: <del>
5092recirc_id=0,ip,in_port=1,dl_src=50:54:00:00:00:0b,nw_frag=no, actions: <del>
5093])
5094OVS_VSWITCHD_STOP
5095AT_CLEANUP
5096
5097AT_SETUP([ofproto-dpif megaflow - goto_table action])
5098OVS_VSWITCHD_START
5099AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
5100ADD_OF_PORTS([br0], [1], [2])
5101AT_DATA([flows.txt], [dnl
5102table=0 in_port=1,ip actions=goto_table(1)
5103table=1 dl_src=50:54:00:00:00:09 actions=output(2)
5104])
5105AT_CHECK([ovs-ofctl -O OpenFlow12 add-flows br0 flows.txt])
5106AT_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)'])
5107AT_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)'])
5108sleep 1
5109AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl
5110recirc_id=0,ip,in_port=1,dl_src=50:54:00:00:00:09,nw_frag=no, actions: <del>
5111recirc_id=0,ip,in_port=1,dl_src=50:54:00:00:00:0b,nw_frag=no, actions: <del>
5112])
5113OVS_VSWITCHD_STOP
5114AT_CLEANUP
5115
5116AT_SETUP([ofproto-dpif megaflow - mirroring, select_all])
5117OVS_VSWITCHD_START
5118AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
5119ADD_OF_PORTS([br0], [1], [2], [3])
5120ovs-vsctl \
5121 set Bridge br0 mirrors=@m --\
5122 --id=@p3 get Port p3 --\
5123 --id=@m create Mirror name=mymirror select_all=true output_port=@p3
5124
5125AT_DATA([flows.txt], [dnl
5126in_port=1 actions=output:2
5127])
5128AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
5129AT_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)'])
5130sleep 1
5131AT_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)'])
5132sleep 1
5133AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl
5134recirc_id=0,ip,in_port=1,nw_frag=no, actions: <del>
5135])
5136OVS_VSWITCHD_STOP
5137AT_CLEANUP
5138
5139AT_SETUP([ofproto-dpif megaflow - mirroring, select_vlan])
5140OVS_VSWITCHD_START
5141AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
5142ADD_OF_PORTS([br0], [1], [2], [3])
5143ovs-vsctl \
5144 set Bridge br0 mirrors=@m --\
5145 --id=@p2 get Port p2 -- --id=@p3 get Port p3 --\
5146 --id=@m create Mirror name=mymirror select_all=true select_vlan=11 output_port=@p3
5147
5148AT_DATA([flows.txt], [dnl
5149in_port=1 actions=output:2
5150])
5151AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
5152AT_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))'])
5153AT_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)'])
5154sleep 1
5155AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl
5156recirc_id=0,ip,in_port=1,dl_vlan=11,nw_frag=no, actions: <del>
5157recirc_id=0,ip,in_port=1,vlan_tci=0x0000/0x1fff,nw_frag=no, actions: <del>
5158])
5159OVS_VSWITCHD_STOP
5160AT_CLEANUP
5161
5162AT_SETUP([ofproto-dpif megaflow - move action])
5163OVS_VSWITCHD_START
5164AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
5165ADD_OF_PORTS([br0], [1], [2])
5166AT_DATA([flows.txt], [dnl
5167table=0 in_port=1 ip,actions=move:NXM_OF_IP_SRC[[]]->NXM_NX_REG0[[]],resubmit(90)
5168table=0 in_port=90 ip,actions=move:NXM_NX_REG0[[]]->NXM_NX_REG1[[]],resubmit(91)
5169table=0 in_port=91 reg0=0x0a000002,actions=output(2)
5170])
5171AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
5172AT_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)'])
5173AT_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)'])
5174sleep 1
5175AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl
5176recirc_id=0,ip,in_port=1,nw_src=10.0.0.2,nw_frag=no, actions: <del>
5177recirc_id=0,ip,in_port=1,nw_src=10.0.0.4,nw_frag=no, actions: <del>
5178])
5179OVS_VSWITCHD_STOP
5180AT_CLEANUP
5181
5182AT_SETUP([ofproto-dpif megaflow - push action])
5183OVS_VSWITCHD_START
5184AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
5185ADD_OF_PORTS([br0], [1], [2])
5186AT_DATA([flows.txt], [dnl
5187table=0 in_port=1 ip,actions=push:NXM_OF_IP_SRC[[]],output(2)
5188])
5189AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
5190AT_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)'])
5191AT_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)'])
5192sleep 1
5193AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl
5194recirc_id=0,ip,in_port=1,nw_src=10.0.0.2,nw_frag=no, actions: <del>
5195recirc_id=0,ip,in_port=1,nw_src=10.0.0.4,nw_frag=no, actions: <del>
5196])
5197OVS_VSWITCHD_STOP
5198AT_CLEANUP
5199
5200AT_SETUP([ofproto-dpif megaflow - learning])
5201OVS_VSWITCHD_START
5202AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
5203ADD_OF_PORTS([br0], [1], [2])
5204AT_DATA([flows.txt], [dnl
5205table=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
5206])
5207AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
5208ovs-appctl time/stop
5209# We send each packet twice because the first packet in each flow causes the
5210# flow table to change and thus revalidations, which (depending on timing)
5211# can keep a megaflow from being installed. The revalidations are done by
5212# the second iteration, allowing the flows to be installed.
5213for i in 1 2; do
5214 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)'])
5215 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)'])
5216 ovs-appctl time/warp 100
5217done
5218sleep 1
5219dnl The original flow is missing due to a revalidation.
5220AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl
5221recirc_id=0,ip,in_port=1,vlan_tci=0x0000/0x0fff,dl_src=50:54:00:00:00:09,nw_frag=no, actions: <del>
5222recirc_id=0,ip,in_port=1,vlan_tci=0x0000/0x0fff,dl_src=50:54:00:00:00:0b,nw_frag=no, actions: <del>
5223])
5224OVS_VSWITCHD_STOP
5225AT_CLEANUP
5226
5227AT_SETUP([ofproto-dpif megaflow - tunnels])
5228OVS_VSWITCHD_START(
5229 [add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1])
5230AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
5231AT_CHECK([ovs-vsctl add-port br0 p2 -- set Interface p2 type=gre \
5232 options:remote_ip=1.1.1.1 ofport_request=2 options:key=flow])
5233AT_CHECK([ovs-vsctl add-port br0 p3 -- set Interface p3 type=dummy \
5234 ofport_request=3])
5235AT_CHECK([ovs-vsctl add-port br0 p4 -- set Interface p4 type=gre \
5236 options:remote_ip=1.1.1.2 options:tos=inherit options:ttl=inherit \
5237 ofport_request=4 options:key=flow])
5238AT_DATA([flows.txt], [dnl
5239in_port=1,actions=output(2)
5240in_port=3,actions=output(4)
5241])
5242AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
5243dnl ECN bits are always copied out, but don't use 0x3 (CE), since that
5244dnl will cause the packet to be dropped.
5245AT_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)'])
5246sleep 1
5247AT_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)'])
5248AT_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)'])
5249sleep 1
5250AT_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)'])
5251sleep 1
5252AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl
5253recirc_id=0,ip,in_port=1,nw_ecn=1,nw_frag=no, actions: <del>
5254recirc_id=0,ip,in_port=3,nw_tos=0,nw_ecn=1,nw_ttl=64,nw_frag=no, actions: <del>
5255recirc_id=0,ip,in_port=3,nw_tos=252,nw_ecn=1,nw_ttl=128,nw_frag=no, actions: <del>
5256])
5257OVS_VSWITCHD_STOP
5258AT_CLEANUP
5259
5260AT_SETUP([ofproto-dpif megaflow - dec_ttl])
5261OVS_VSWITCHD_START
5262AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
5263ADD_OF_PORTS([br0], [1], [2])
5264AT_CHECK([ovs-vsctl set Bridge br0 flow_tables:0=@N1 -- --id=@N1 create Flow_Table name=t0 prefixes=nw_dst,nw_src], [0], [ignore], [])
5265AT_DATA([flows.txt], [dnl
5266table=0 in_port=1,icmp,nw_src=10.0.0.4 actions=dec_ttl,output(2)
5267])
5268AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
5269AT_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)'])
5270AT_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)'])
5271sleep 1
5272AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl
5273recirc_id=0,icmp,in_port=1,nw_src=10.0.0.4,nw_ttl=64,nw_frag=no, actions: <del>
5274recirc_id=0,ip,in_port=1,nw_src=10.0.0.2/0.0.0.2,nw_frag=no, actions: <del>
5275])
5276OVS_VSWITCHD_STOP
5277AT_CLEANUP
5278
5279AT_SETUP([ofproto-dpif megaflow - set dl_dst])
5280OVS_VSWITCHD_START
5281AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
5282ADD_OF_PORTS([br0], [1], [2])
5283AT_DATA([flows.txt], [dnl
5284table=0 in_port=1 actions=mod_dl_dst(50:54:00:00:00:0a),output(2)
5285])
5286AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
5287AT_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)'])
5288AT_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)'])
5289sleep 1
5290dnl The first packet is essentially a no-op, as the new destination MAC is the
5291dnl same as the original. The second entry actually updates the destination
5292dnl MAC.
5293AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_USED], [0], [dnl
5294recirc_id=0,ip,in_port=1,dl_dst=50:54:00:00:00:0a,nw_frag=no, actions:2
5295recirc_id=0,ip,in_port=1,dl_dst=50:54:00:00:00:0c,nw_frag=no, actions:set(eth(dst=50:54:00:00:00:0a)),2
5296])
5297OVS_VSWITCHD_STOP
5298AT_CLEANUP
5299
5300AT_SETUP([ofproto-dpif megaflow - disabled])
5301OVS_VSWITCHD_START
5302AT_CHECK([ovs-appctl vlog/set dpif:dbg dpif_netdev:dbg])
5303ADD_OF_PORTS([br0], [1], [2])
5304AT_DATA([flows.txt], [dnl
5305table=0 in_port=1,ip,nw_dst=10.0.0.1 actions=output(2)
5306table=0 in_port=1,ip,nw_dst=10.0.0.3 actions=drop
5307])
5308AT_CHECK([ovs-appctl upcall/disable-megaflows], [0], [megaflows disabled
5309], [])
5310AT_CHECK([ovs-appctl vlog/set dpif_netdev:dbg], [0], [], [])
5311AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
5312for i in 1 2 3 4; do
5313 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)'])
5314 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)'])
5315 if [[ $i -eq 1 ]]; then
5316 sleep 1
5317 fi
5318done
5319sleep 1
5320AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_USED], [0], [dnl
5321pkt_mark=0,recirc_id=0,skb_priority=0,icmp,tun_id=0,tun_src=0.0.0.0,tun_dst=0.0.0.0,tun_tos=0,tun_ttl=0,,in_port=1,vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,nw_src=10.0.0.2,nw_dst=10.0.0.1,nw_tos=0,nw_ecn=0,nw_ttl=64,mpls_label=0,mpls_tc=0,mpls_ttl=0,mpls_bos=0,mpls_lse1=0,mpls_lse2=0,icmp_type=8,icmp_code=0, actions:2
5322pkt_mark=0,recirc_id=0,skb_priority=0,icmp,tun_id=0,tun_src=0.0.0.0,tun_dst=0.0.0.0,tun_tos=0,tun_ttl=0,,in_port=1,vlan_tci=0x0000,dl_src=50:54:00:00:00:0b,dl_dst=50:54:00:00:00:0c,nw_src=10.0.0.4,nw_dst=10.0.0.3,nw_tos=0,nw_ecn=0,nw_ttl=64,mpls_label=0,mpls_tc=0,mpls_ttl=0,mpls_bos=0,mpls_lse1=0,mpls_lse2=0,icmp_type=8,icmp_code=0, actions:drop
5323])
5324AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_DUMP | grep 'packets:3'], [0], [dnl
5325skb_priority(0),skb_mark(0),recirc_id(0),dp_hash(0),in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0), packets:3, bytes:180, used:0.0s, actions:2
5326skb_priority(0),skb_mark(0),recirc_id(0),dp_hash(0),in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.4,dst=10.0.0.3,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0), packets:3, bytes:180, used:0.0s, actions:drop
5327])
5328OVS_VSWITCHD_STOP
5329AT_CLEANUP
5330
5331AT_SETUP([ofproto-dpif - datapath port number change])
5332OVS_VSWITCHD_START([set Bridge br0 fail-mode=standalone])
5333ADD_OF_PORTS([br0], 1)
5334
5335# Trace a flow that should output to p1.
5336AT_CHECK([ovs-appctl ofproto/trace br0 in_port=LOCAL,dl_src=10:20:30:40:50:60],
5337 [0], [stdout])
5338AT_CHECK([tail -1 stdout], [0], [Datapath actions: 1
5339])
5340
5341# Change p1's port number to 5.
5342AT_CHECK([ovs-appctl dpif-dummy/change-port-number ovs-dummy p1 5])
5343
5344# Trace a flow that should output to p1 in its new location.
5345AT_CHECK([ovs-appctl ofproto/trace br0 in_port=LOCAL,dl_src=10:20:30:40:50:60],
5346 [0], [stdout])
5347AT_CHECK([tail -1 stdout], [0], [Datapath actions: 5
5348])
5349OVS_VSWITCHD_STOP
5350AT_CLEANUP
5351
5352# Tests the bundling with various bfd and cfm configurations.
5353AT_SETUP([ofproto - bundle with variable bfd/cfm config])
5354OVS_VSWITCHD_START([add-br br1 -- set bridge br1 datapath-type=dummy -- \
5355 add-bond br0 br0bond p0 p2 bond-mode=active-backup -- \
5356 add-bond br1 br1bond p1 p3 bond-mode=active-backup -- \
5357 set Interface p1 type=patch options:peer=p0 ofport_request=2 -- \
5358 set Interface p3 type=patch options:peer=p2 ofport_request=4 -- \
5359 set Interface p0 type=patch options:peer=p1 ofport_request=1 -- \
5360 set Interface p2 type=patch options:peer=p3 ofport_request=3 -- \
5361 set Interface p0 bfd:enable=true bfd:min_tx=300 bfd:min_rx=300 -- \
5362 set Interface p0 cfm_mpid=1 -- \
5363 set Interface p1 bfd:enable=true bfd:min_tx=500 bfd:min_rx=500])
5364
5365ovs-appctl time/stop
5366# advance the clock to stablize everything.
5367ovs-appctl time/warp 5000 100
5368# cfm/show should show 'recv' fault.
5369AT_CHECK([ovs-appctl cfm/show | sed -n '/^.*fault:.*/p'], [0], [dnl
5370 fault: recv
5371])
5372# bfd/show should show 'up'.
5373AT_CHECK([ovs-appctl bfd/show | sed -n '/^.*Session State:.*/p'], [0], [dnl
5374 Local Session State: up
5375 Remote Session State: up
5376 Local Session State: up
5377 Remote Session State: up
5378])
5379# bond/show should show 'may-enable: true' for all slaves.
5380AT_CHECK([ovs-appctl bond/show | sed -n '/^.*may_enable:.*/p'], [0], [dnl
5381 may_enable: true
5382 may_enable: true
5383 may_enable: true
5384 may_enable: true
5385])
5386
5387# now disable the bfd on p1.
5388AT_CHECK([ovs-vsctl set Interface p1 bfd:enable=false])
5389# advance the clock to stablize everything.
5390ovs-appctl time/warp 5000 100
5391# cfm/show should show 'recv' fault.
5392AT_CHECK([ovs-appctl cfm/show | sed -n '/^.*fault:.*/p'], [0], [dnl
5393 fault: recv
5394])
5395# bfd/show should show 'down'.
5396AT_CHECK([ovs-appctl bfd/show | sed -n '/^.*Session State:.*/p'], [0], [dnl
5397 Local Session State: down
5398 Remote Session State: down
5399])
5400# bond/show should show 'may-enable: false' for p0.
5401AT_CHECK([ovs-appctl bond/show br0bond | sed -n '/^.*may_enable:.*/p'], [0], [dnl
5402 may_enable: false
5403 may_enable: true
5404])
5405
5406# now enable the bfd on p1 and disable bfd on p0.
5407AT_CHECK([ovs-vsctl set Interface p1 bfd:enable=true])
5408AT_CHECK([ovs-vsctl set Interface p0 bfd:enable=false])
5409# advance the clock to stablize everything.
5410ovs-appctl time/warp 5000 100
5411# cfm/show should show 'recv' fault.
5412AT_CHECK([ovs-appctl cfm/show | sed -n '/^.*fault:.*/p'], [0], [dnl
5413 fault: recv
5414])
5415# bfd/show should show 'down'.
5416AT_CHECK([ovs-appctl bfd/show | sed -n '/^.*Session State:.*/p'], [0], [dnl
5417 Local Session State: down
5418 Remote Session State: down
5419])
5420# bond/show should show 'may-enable: false' for p0 and p1.
5421AT_CHECK([ovs-appctl bond/show | sed -n '/^.*may_enable:.*/p'], [0], [dnl
5422 may_enable: false
5423 may_enable: true
5424 may_enable: false
5425 may_enable: true
5426])
5427
5428OVS_VSWITCHD_STOP
5429AT_CLEANUP
5430
5431AT_SETUP([ofproto-dpif - ofproto-dpif-monitor 1])
5432OVS_VSWITCHD_START([add-port br0 p0 -- set interface p0 type=gre options:remote_ip=1.2.3.4])
5433
5434# enable bfd on p0.
5435AT_CHECK([ovs-vsctl set interface p0 bfd:enable=true])
5436# check log.
5437OVS_WAIT_UNTIL([grep "monitor thread created" ovs-vswitchd.log])
5438# disable bfd on p0.
5439AT_CHECK([ovs-vsctl set interface p0 bfd:enable=false])
5440# check log.
5441OVS_WAIT_UNTIL([grep "monitor thread terminated" ovs-vswitchd.log])
5442AT_CHECK([cat ovs-vswitchd.log | sed -e '/^.*ofproto_dpif_monitor.*$/d' > ovs-vswitchd.log])
5443
5444# enable cfm on p0.
5445AT_CHECK([ovs-vsctl set interface p0 cfm_mpid=10])
5446# check log.
5447OVS_WAIT_UNTIL([grep "monitor thread created" ovs-vswitchd.log])
5448# disable cfm on p0.
5449AT_CHECK([ovs-vsctl remove interface p0 cfm_mpid 10])
5450# check log.
5451OVS_WAIT_UNTIL([grep "monitor thread terminated" ovs-vswitchd.log])
5452AT_CHECK([cat ovs-vswitchd.log | sed -e '/^.*ofproto_dpif_monitor.*$/d' > ovs-vswitchd.log])
5453
5454# enable both bfd and cfm on p0.
5455AT_CHECK([ovs-vsctl set interface p0 bfd:enable=true cfm_mpid=10])
5456# check log.
5457OVS_WAIT_UNTIL([grep "monitor thread created" ovs-vswitchd.log])
5458# disable bfd on p0.
5459AT_CHECK([ovs-vsctl set interface p0 bfd:enable=false])
5460# check log, there should not be the log of thread terminated.
5461AT_CHECK([sed -n "s/^.*|ofproto_dpif_monitor(monitor[[0-9]]*)|INFO|\(.* terminated\)$/\1/p" ovs-vswitchd.log], [0], [dnl
5462])
5463# reenable bfd on p0.
5464AT_CHECK([ovs-vsctl set interface p0 bfd:enable=true])
5465# check log, should still be on log of thread created.
5466AT_CHECK([sed -n "s/^.*|ofproto_dpif_monitor(monitor[[0-9]]*)|INFO|\(.* created\)$/\1/p" ovs-vswitchd.log], [0], [dnl
5467monitor thread created
5468])
5469# disable bfd and cfm together.
5470AT_CHECK([ovs-vsctl set interface p0 bfd:enable=false -- remove interface p0 cfm_mpid 10])
5471# check log.
5472OVS_WAIT_UNTIL([grep "monitor thread terminated" ovs-vswitchd.log])
5473
5474OVS_VSWITCHD_STOP
5475AT_CLEANUP
5476
5477# this test helps avoid the deadlock between the main thread and monitor thread.
5478AT_SETUP([ofproto-dpif - ofproto-dpif-monitor 2])
5479OVS_VSWITCHD_START
5480
5481for i in `seq 1 199`
5482do
5483 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])
5484done
5485
5486OVS_VSWITCHD_STOP
5487AT_CLEANUP
5488\f
5489AT_BANNER([ofproto-dpif - flow translation resource limits])
5490
5491AT_SETUP([ofproto-dpif - infinite resubmit])
5492OVS_VSWITCHD_START
5493AT_CHECK([ovs-ofctl add-flow br0 actions=resubmit:1,resubmit:2,output:3])
5494AT_CHECK([ovs-appctl -vpoll_loop:off ofproto/trace br0 'eth_dst=ff:ff:ff:ff:ff:ff'],
5495 [0], [stdout])
5496AT_CHECK([tail -1 stdout], [0], [Datapath actions: drop
5497])
5498AT_CHECK([grep -c 'resubmit actions recursed over 64 times' ovs-vswitchd.log],
5499 [0], [1
5500])
5501OVS_VSWITCHD_STOP(["/resubmit actions recursed/d"])
5502AT_CLEANUP
5503
5504AT_SETUP([ofproto-dpif - exponential resubmit chain])
5505OVS_VSWITCHD_START
5506ADD_OF_PORTS([br0], 1)
5507(for i in `seq 1 64`; do
5508 j=`expr $i + 1`
5509 echo "in_port=$i, actions=resubmit:$j, resubmit:$j, local"
5510 done
5511 echo "in_port=65, actions=local") > flows
5512 AT_CHECK([ovs-ofctl add-flows br0 flows])
5513AT_CHECK([ovs-appctl -vpoll_loop:off ofproto/trace br0 'in_port=1'], [0], [stdout])
5514AT_CHECK([grep -c 'over 4096 resubmit actions' ovs-vswitchd.log], [0], [1
5515])
5516OVS_VSWITCHD_STOP(["/over.*resubmit actions/d"])
5517AT_CLEANUP
5518
5519AT_SETUP([ofproto-dpif - too many output actions])
5520OVS_VSWITCHD_START
5521ADD_OF_PORTS([br0], 1)
5522(for i in `seq 1 12`; do
5523 j=`expr $i + 1`
5524 echo "in_port=$i, actions=resubmit:$j, resubmit:$j, local"
5525 done
5526 echo "in_port=13, actions=local,local,local,local,local,local,local,local") > flows
5527AT_CHECK([ovs-ofctl add-flows br0 flows])
5528AT_CHECK([ovs-appctl -vpoll_loop:off ofproto/trace br0 'in_port=1'], [0], [stdout])
5529AT_CHECK([grep -c -e '- Uses action(s) not supported by datapath' stdout],
5530 [0], [1
5531])
5532AT_CHECK([grep -c 'resubmits yielded over 64 kB of actions' ovs-vswitchd.log], [0], [1
5533])
5534OVS_VSWITCHD_STOP(["/resubmits yielded over 64 kB of actions/d"])
5535AT_CLEANUP
5536
5537AT_SETUP([ofproto-dpif - stack too deep])
5538OVS_VSWITCHD_START
5539ADD_OF_PORTS([br0], 1)
5540(for i in `seq 1 12`; do
5541 j=`expr $i + 1`
5542 echo "in_port=$i, actions=resubmit:$j, resubmit:$j, local"
5543 done
5544 push="push:NXM_NX_REG0[[]]"
5545 echo "in_port=13, actions=$push,$push,$push,$push,$push,$push,$push,$push") > flows
5546 AT_CHECK([ovs-ofctl add-flows br0 flows])
5547AT_CHECK([ovs-appctl -vpoll_loop:off ofproto/trace br0 'in_port=1'], [0], [stdout])
5548AT_CHECK([grep -c 'resubmits yielded over 64 kB of stack' ovs-vswitchd.log], [0], [1
5549])
5550OVS_VSWITCHD_STOP(["/resubmits yielded over 64 kB of stack/d"])
5551AT_CLEANUP
5552
5553
5554AT_SETUP([ofproto-dpif packet-out controller])
5555OVS_VSWITCHD_START
5556ADD_OF_PORTS([br0], 1, 2)
5557
5558AT_CHECK([ovs-ofctl add-flow br0 'dl_dst=50:54:00:00:00:0a actions=controller'])
5559
5560AT_CAPTURE_FILE([ofctl_monitor.log])
5561AT_CHECK([ovs-ofctl monitor br0 65534 invalid_ttl --detach --no-chdir --pidfile 2> ofctl_monitor.log])
5562
5563for i in 1 2 3; do
5564 AT_CHECK([ovs-ofctl -O OpenFlow13 packet-out br0 CONTROLLER controller '50540000000a5054000000091234'])
5565done
5566
5567OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
5568AT_CHECK([cat ofctl_monitor.log], [0], [dnl
5569NXT_PACKET_IN (xid=0x0): total_len=14 in_port=CONTROLLER (via action) data_len=14 (unbuffered)
5570metadata=0,in_port=0,vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,dl_type=0x1234
5571dnl
5572NXT_PACKET_IN (xid=0x0): total_len=14 in_port=CONTROLLER (via action) data_len=14 (unbuffered)
5573metadata=0,in_port=0,vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,dl_type=0x1234
5574dnl
5575NXT_PACKET_IN (xid=0x0): total_len=14 in_port=CONTROLLER (via action) data_len=14 (unbuffered)
5576metadata=0,in_port=0,vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,dl_type=0x1234
5577])
5578
5579AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
5580 dl_dst=50:54:00:00:00:0a actions=CONTROLLER:65535
5581NXST_FLOW reply:
5582])
5583
5584(echo "OFPST_TABLE reply (OF1.3) (xid=0x2):
5585 table 0:
5586 active=1, lookup=0, matched=0"
5587 x=1
5588 while test $x -lt 254; do
5589 echo "
5590 table $x:
5591 active=0, lookup=0, matched=0"
5592 x=`expr $x + 1`
5593 done) > expout
5594AT_CHECK([ovs-ofctl -O OpenFlow13 dump-tables br0 ], [0], [expout])
5595
5596OVS_VSWITCHD_STOP
5597AT_CLEANUP
5598
5599AT_SETUP([ofproto-dpif packet-out controller (patch port)])
5600OVS_VSWITCHD_START(
5601 [-- \
5602 add-port br0 p1 -- \
5603 set interface p1 type=patch options:peer=p2 -- \
5604 add-br br1 -- \
5605 set bridge br1 datapath-type=dummy -- \
5606 set bridge br1 fail-mode=secure -- \
5607 set bridge br1 protocols='[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13]' -- \
5608 add-port br1 p2 -- \
5609 set interface p2 type=patch options:peer=p1 --])
5610
5611AT_CAPTURE_FILE([ofctl_monitor.log])
5612AT_CHECK([ovs-ofctl monitor br1 65534 invalid_ttl --detach --no-chdir --pidfile 2> ofctl_monitor.log])
5613
5614for i in 1 2 3; do
5615 AT_CHECK([ovs-ofctl -O OpenFlow13 packet-out br0 CONTROLLER output:1 '50540000000a5054000000091234'])
5616done
5617
5618OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
5619AT_CHECK([cat ofctl_monitor.log], [0], [dnl
5620NXT_PACKET_IN (xid=0x0): cookie=0x0 total_len=14 in_port=1 (via no_match) data_len=14 (unbuffered)
5621metadata=0,in_port=0,vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,dl_type=0x1234
5622dnl
5623NXT_PACKET_IN (xid=0x0): cookie=0x0 total_len=14 in_port=1 (via no_match) data_len=14 (unbuffered)
5624metadata=0,in_port=0,vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,dl_type=0x1234
5625dnl
5626NXT_PACKET_IN (xid=0x0): cookie=0x0 total_len=14 in_port=1 (via no_match) data_len=14 (unbuffered)
5627metadata=0,in_port=0,vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,dl_type=0x1234
5628])
5629
5630(printf "OFPST_TABLE reply (OF1.3) (xid=0x2):"
5631 x=0
5632 while test $x -lt 254; do
5633 echo "
5634 table $x:
5635 active=0, lookup=0, matched=0"
5636 x=`expr $x + 1`
5637 done) > expout
5638AT_CHECK([ovs-ofctl -O OpenFlow13 dump-tables br0 ], [0], [expout])
5639
5640(echo "OFPST_TABLE reply (OF1.3) (xid=0x2):
5641 table 0:
5642 active=0, lookup=3, matched=0"
5643 x=1
5644 while test $x -lt 254; do
5645 echo "
5646 table $x:
5647 active=0, lookup=0, matched=0"
5648 x=`expr $x + 1`
5649 done) > expout
5650AT_CHECK([ovs-ofctl -O OpenFlow13 dump-tables br1 ], [0], [expout])
5651
5652OVS_VSWITCHD_STOP
5653AT_CLEANUP
5654
5655
5656AT_SETUP([ofproto-dpif packet-out goto_table])
5657OVS_VSWITCHD_START
5658ADD_OF_PORTS([br0], 1, 2)
5659
5660AT_DATA([flows.txt], [dnl
5661table=0 dl_dst=50:54:00:00:00:0a actions=goto_table(1)
5662table=1 dl_dst=50:54:00:00:00:0a actions=controller
5663])
5664AT_CHECK([ovs-ofctl -O OpenFlow13 add-flows br0 flows.txt])
5665
5666AT_CAPTURE_FILE([ofctl_monitor.log])
5667AT_CHECK([ovs-ofctl monitor br0 65534 invalid_ttl --detach --no-chdir --pidfile 2> ofctl_monitor.log])
5668
5669for i in 1 2 3; do
5670 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)'
5671done
5672
5673OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
5674OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
5675AT_CHECK([cat ofctl_monitor.log], [0], [dnl
5676NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
5677metadata=0,in_port=0,vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,dl_type=0x1234
5678dnl
5679NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
5680metadata=0,in_port=0,vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,dl_type=0x1234
5681dnl
5682NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
5683metadata=0,in_port=0,vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,dl_type=0x1234
5684])
5685
5686AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
5687AT_CHECK([ovs-appctl revalidator/wait], [0], [ignore])
5688
5689AT_CHECK([ovs-ofctl -O OpenFlow13 dump-flows br0 | ofctl_strip | sort], [0], [dnl
5690 n_packets=3, n_bytes=180, dl_dst=50:54:00:00:00:0a actions=goto_table:1
5691 table=1, n_packets=3, n_bytes=180, dl_dst=50:54:00:00:00:0a actions=CONTROLLER:65535
5692OFPST_FLOW reply (OF1.3):
5693])
5694
5695(echo "OFPST_TABLE reply (OF1.3) (xid=0x2):
5696 table 0:
5697 active=1, lookup=3, matched=3
5698
5699 table 1:
5700 active=1, lookup=3, matched=3"
5701 x=2
5702 while test $x -lt 254; do
5703 echo "
5704 table $x:
5705 active=0, lookup=0, matched=0"
5706 x=`expr $x + 1`
5707 done) > expout
5708AT_CHECK([ovs-ofctl -O OpenFlow13 dump-tables br0 ], [0], [expout])
5709
5710OVS_VSWITCHD_STOP
5711AT_CLEANUP
5712
5713
5714AT_SETUP([ofproto-dpif packet-out table-miss (continue)])
5715OVS_VSWITCHD_START
5716ADD_OF_PORTS([br0], 1, 2)
5717
5718AT_CHECK([ovs-ofctl -O OpenFlow11 add-flow br0 'table=1 dl_dst=50:54:00:00:00:0a actions=controller'])
5719AT_CHECK([ovs-ofctl -O OpenFlow11 mod-table br0 all continue])
5720
5721AT_CAPTURE_FILE([ofctl_monitor.log])
5722AT_CHECK([ovs-ofctl monitor br0 65534 invalid_ttl --detach --no-chdir --pidfile 2> ofctl_monitor.log])
5723
5724for i in 1 2 3; do
5725 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)'
5726done
5727
5728OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
5729OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
5730AT_CHECK([cat ofctl_monitor.log], [0], [dnl
5731NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
5732metadata=0,in_port=0,vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,dl_type=0x1234
5733dnl
5734NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
5735metadata=0,in_port=0,vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,dl_type=0x1234
5736dnl
5737NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
5738metadata=0,in_port=0,vlan_tci=0x0000,dl_src=50:54:00:00:00:09,dl_dst=50:54:00:00:00:0a,dl_type=0x1234
5739])
5740
5741AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
5742AT_CHECK([ovs-appctl revalidator/wait], [0], [ignore])
5743
5744AT_CHECK([ovs-ofctl -O OpenFlow11 dump-flows br0 | ofctl_strip | sort], [0], [dnl
5745 table=1, n_packets=3, n_bytes=180, dl_dst=50:54:00:00:00:0a actions=CONTROLLER:65535
5746OFPST_FLOW reply (OF1.1):
5747])
5748
5749(echo "OFPST_TABLE reply (OF1.3) (xid=0x2):
5750 table 0:
5751 active=0, lookup=3, matched=0
5752
5753 table 1:
5754 active=1, lookup=3, matched=3"
5755 x=2
5756 while test $x -lt 254; do
5757 echo "
5758 table $x:
5759 active=0, lookup=0, matched=0"
5760 x=`expr $x + 1`
5761 done) > expout
5762AT_CHECK([ovs-ofctl -O OpenFlow13 dump-tables br0 ], [0], [expout])
5763
5764OVS_VSWITCHD_STOP
5765AT_CLEANUP
5766
5767AT_SETUP([ofproto-dpif - ICMPv6])
5768OVS_VSWITCHD_START
5769ADD_OF_PORTS([br0], 1)
5770
5771AT_CAPTURE_FILE([ofctl_monitor.log])
5772
5773AT_CHECK([ovs-ofctl monitor br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
5774
5775ovs-appctl netdev-dummy/receive p1 '0060970769ea0000860580da86dd6000000000203afffe80000000000000020086fffe0580dafe80000000000000026097fffe0769ea870068bd00000000fe80000000000000026097fffe0769ea01010000860580da'
5776
5777OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
5778
5779AT_CHECK([cat ofctl_monitor.log], [0], [dnl
5780NXT_PACKET_IN (xid=0x0): cookie=0x0 total_len=86 in_port=1 (via no_match) data_len=86 (unbuffered)
5781icmp6,metadata=0,in_port=0,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
5782])
5783
5784OVS_VSWITCHD_STOP
5785AT_CLEANUP