1 AT_BANNER([ofproto-dpif])
3 AT_SETUP([ofproto-dpif, active-backup bonding])
4 # Create br0 with interfaces p1, p2 and p7, creating bond0 with p1 and p2
5 # and br1 with interfaces p3, p4 and p8.
6 # toggle p1,p2 of bond0 up and down to test bonding in active-backup mode.
8 [add-bond br0 bond0 p1 p2 bond_mode=active-backup --\
9 set interface p1 type=dummy options:pstream=punix:$OVS_RUNDIR/p1.sock ofport_request=1 -- \
10 set interface p2 type=dummy options:pstream=punix:$OVS_RUNDIR/p2.sock ofport_request=2 -- \
11 add-port br0 p7 -- set interface p7 ofport_request=7 type=dummy -- \
13 set bridge br1 other-config:hwaddr=aa:66:aa:66:00:00 -- \
14 set bridge br1 datapath-type=dummy other-config:datapath-id=1234 \
16 add-port br1 p3 -- set interface p3 type=dummy options:stream=unix:$OVS_RUNDIR/p1.sock ofport_request=3 -- \
17 add-port br1 p4 -- set interface p4 type=dummy options:stream=unix:$OVS_RUNDIR/p2.sock ofport_request=4 -- \
18 add-port br1 p8 -- set interface p8 ofport_request=8 type=dummy --])
19 WAIT_FOR_DUMMY_PORTS([p3], [p4])
20 AT_CHECK([ovs-appctl vlog/set dpif:dbg])
22 AT_CHECK([ovs-ofctl add-flow br0 action=normal])
23 AT_CHECK([ovs-ofctl add-flow br1 action=normal])
24 ovs-appctl netdev-dummy/set-admin-state up
25 ovs-appctl time/warp 100
26 ovs-appctl netdev-dummy/set-admin-state p2 down
28 ovs-appctl time/warp 100
29 AT_CHECK([ovs-appctl netdev-dummy/receive p7 'in_port(7),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
30 AT_CHECK([ovs-appctl netdev-dummy/receive p7 'in_port(7),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.3,dst=10.0.0.4,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
31 ovs-appctl time/warp 100
32 ovs-appctl netdev-dummy/set-admin-state p2 up
33 ovs-appctl netdev-dummy/set-admin-state p1 down
34 ovs-appctl time/warp 100
35 AT_CHECK([ovs-appctl netdev-dummy/receive p7 'in_port(7),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00: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)'])
36 AT_CHECK([ovs-appctl netdev-dummy/receive p7 'in_port(7),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0e),eth_type(0x0800),ipv4(src=10.0.0.6,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
37 ovs-appctl time/warp 100
38 ovs-appctl time/warp 100
40 AT_CHECK([cat ovs-vswitchd.log | grep 'in_port([[348]])' | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl
41 skb_priority(0),skb_mark(0/0),recirc_id(0),dp_hash(0/0),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/0.0.0.0,dst=10.0.0.1/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no/0xff),icmp(type=8/0,code=0/0), actions: <del>
42 skb_priority(0),skb_mark(0/0),recirc_id(0),dp_hash(0/0),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.3/0.0.0.0,dst=10.0.0.4/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no/0xff),icmp(type=8/0,code=0/0), actions: <del>
43 skb_priority(0),skb_mark(0/0),recirc_id(0),dp_hash(0/0),in_port(4),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0d),eth_type(0x0800),ipv4(src=10.0.0.5/0.0.0.0,dst=10.0.0.1/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no/0xff),icmp(type=8/0,code=0/0), actions: <del>
44 skb_priority(0),skb_mark(0/0),recirc_id(0),dp_hash(0/0),in_port(4),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0e),eth_type(0x0800),ipv4(src=10.0.0.6/0.0.0.0,dst=10.0.0.1/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no/0xff),icmp(type=8/0,code=0/0), actions: <del>
45 skb_priority(0),skb_mark(0/0),recirc_id(0),dp_hash(0/0),in_port(4),eth(src=50:54:00:00:00:09,dst=ff:ff:ff:ff:ff:ff),eth_type(0x8035),arp(sip=0.0.0.0/0.0.0.0,tip=0.0.0.0/0.0.0.0,op=3/0,sha=50:54:00:00:00:09/00:00:00:00:00:00,tha=50:54:00:00:00:09/00:00:00:00:00:00), actions: <del>
46 skb_priority(0),skb_mark(0/0),recirc_id(0),dp_hash(0/0),in_port(4),eth(src=50:54:00:00:00:0b,dst=ff:ff:ff:ff:ff:ff),eth_type(0x8035),arp(sip=0.0.0.0/0.0.0.0,tip=0.0.0.0/0.0.0.0,op=3/0,sha=50:54:00:00:00:0b/00:00:00:00:00:00,tha=50:54:00:00:00:0b/00:00:00:00:00:00), actions: <del>
51 AT_SETUP([ofproto-dpif, balance-slb bonding])
52 # Create br0 with interfaces bond0(p1, p2, p3) and p7,
53 # and br1 with interfaces p4, p5, p6 and p8.
54 # p1 <-> p4, p2 <-> p5, p3 <-> p6
55 # Send some traffic, make sure the traffic are spread based on source mac.
57 [add-bond br0 bond0 p1 p2 p3 bond_mode=balance-slb --\
58 set interface p1 type=dummy options:pstream=punix:$OVS_RUNDIR/p1.sock ofport_request=1 -- \
59 set interface p2 type=dummy options:pstream=punix:$OVS_RUNDIR/p2.sock ofport_request=2 -- \
60 set interface p3 type=dummy options:pstream=punix:$OVS_RUNDIR/p3.sock ofport_request=3 -- \
61 add-port br0 p7 -- set interface p7 ofport_request=7 type=dummy -- \
63 set bridge br1 other-config:hwaddr=aa:66:aa:66:00:00 -- \
64 set bridge br1 datapath-type=dummy other-config:datapath-id=1234 \
66 add-port br1 p4 -- set interface p4 type=dummy options:stream=unix:$OVS_RUNDIR/p1.sock ofport_request=4 -- \
67 add-port br1 p5 -- set interface p5 type=dummy options:stream=unix:$OVS_RUNDIR/p2.sock ofport_request=5 -- \
68 add-port br1 p6 -- set interface p6 type=dummy options:stream=unix:$OVS_RUNDIR/p3.sock ofport_request=6 -- \
69 add-port br1 p8 -- set interface p8 ofport_request=8 type=dummy --])
70 WAIT_FOR_DUMMY_PORTS([p4], [p5], [p6])
71 AT_CHECK([ovs-ofctl add-flow br0 action=normal])
72 AT_CHECK([ovs-ofctl add-flow br1 action=normal])
73 AT_CHECK([ovs-appctl netdev-dummy/set-admin-state up], 0, [OK
76 ovs-appctl time/warp 100
78 for i in `seq 0 100 |xargs printf '%02x\n'`;
80 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)"
81 AT_CHECK([ovs-appctl netdev-dummy/receive p7 $pkt])
84 ovs-appctl time/warp 100
85 AT_CHECK([ovs-appctl dpif/dump-flows br1 > br1_flows.txt])
86 # Make sure there is resonable distribution to all three ports.
87 # We don't want to make this check precise, in case hash function changes.
88 AT_CHECK([test `egrep 'in_port\(4\)' br1_flows.txt |wc -l` -gt 3])
89 AT_CHECK([test `egrep 'in_port\(5\)' br1_flows.txt |wc -l` -gt 3])
90 AT_CHECK([test `egrep 'in_port\(6\)' br1_flows.txt |wc -l` -gt 3])
94 AT_SETUP([ofproto-dpif, balance-tcp bonding])
95 # Create br0 with interfaces bond0(p1, p2, p3) and p7,
96 # and br1 with interfaces bond1(p4, p5, p6) and p8.
98 # Send some traffic, make sure the traffic are spread based on L4 headers.
100 [add-bond br0 bond0 p1 p2 p3 bond_mode=balance-tcp lacp=active \
101 other-config:lacp-time=fast other-config:bond-rebalance-interval=0 --\
102 set interface p1 type=dummy options:pstream=punix:$OVS_RUNDIR/p1.sock ofport_request=1 -- \
103 set interface p2 type=dummy options:pstream=punix:$OVS_RUNDIR/p2.sock ofport_request=2 -- \
104 set interface p3 type=dummy options:pstream=punix:$OVS_RUNDIR/p3.sock ofport_request=3 -- \
105 add-port br0 p7 -- set interface p7 ofport_request=7 type=dummy -- \
107 set bridge br1 other-config:hwaddr=aa:66:aa:66:00:00 -- \
108 set bridge br1 datapath-type=dummy other-config:datapath-id=1234 \
109 fail-mode=secure -- \
110 add-bond br1 bond1 p4 p5 p6 bond_mode=balance-tcp lacp=active \
111 other-config:lacp-time=fast other-config:bond-rebalance-interval=0 --\
112 set interface p4 type=dummy options:stream=unix:$OVS_RUNDIR/p1.sock ofport_request=4 -- \
113 set interface p5 type=dummy options:stream=unix:$OVS_RUNDIR/p2.sock ofport_request=5 -- \
114 set interface p6 type=dummy options:stream=unix:$OVS_RUNDIR/p3.sock ofport_request=6 -- \
115 add-port br1 p8 -- set interface p8 ofport_request=8 type=dummy --])
116 AT_CHECK([ovs-appctl netdev-dummy/set-admin-state up], 0, [OK
118 AT_CHECK([ovs-ofctl add-flow br0 action=normal])
119 AT_CHECK([ovs-ofctl add-flow br1 action=normal])
120 AT_CHECK([ovs-appctl upcall/disable-megaflows], [0], [megaflows disabled
122 WAIT_FOR_DUMMY_PORTS([p4], [p5], [p6])
124 ovs-appctl time/warp 100
125 ovs-appctl lacp/show > lacp.txt
126 ovs-appctl bond/show > bond.txt
128 for i in `seq 0 255` ;
130 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(0x010)"
131 AT_CHECK([ovs-appctl netdev-dummy/receive p7 $pkt])
134 ovs-appctl time/warp 100
135 ovs-appctl time/warp 100
136 ovs-appctl time/warp 100
137 AT_CHECK([ovs-appctl dpif/dump-flows br0 |grep tcp > br0_flows.txt])
138 AT_CHECK([ovs-appctl dpif/dump-flows br1 |grep tcp > br1_flows.txt])
139 # Make sure there is resonable distribution to all three ports.
140 # We don't want to make this check precise, in case hash function changes.
141 AT_CHECK([test `grep in_port.4 br1_flows.txt |wc -l` -gt 24])
142 AT_CHECK([test `grep in_port.5 br1_flows.txt |wc -l` -gt 24])
143 AT_CHECK([test `grep in_port.6 br1_flows.txt |wc -l` -gt 24])
147 AT_SETUP([ofproto-dpif - resubmit])
149 ADD_OF_PORTS([br0], [1], [10], [11], [12], [13], [14], [15],
150 [16], [17], [18], [19], [20], [21])
151 AT_DATA([flows.txt], [dnl
152 table=0 in_port=1 priority=1000 icmp actions=output(10),resubmit(2),output(19),resubmit(3),output(21)
153 table=0 in_port=2 priority=1500 icmp actions=output(11),resubmit(,1),output(16),resubmit(2,1),output(18)
154 table=0 in_port=3 priority=2000 icmp actions=output(20)
155 table=1 in_port=1 priority=1000 icmp actions=output(12),resubmit(4,1),output(13),resubmit(3),output(15)
156 table=1 in_port=2 priority=1500 icmp actions=output(17),resubmit(,2)
157 table=1 in_port=3 priority=1500 icmp actions=output(14),resubmit(,2)
159 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
160 AT_CHECK([ovs-appctl ofproto/trace br0 'in_port=1,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,dl_type=0x0800,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=1,nw_tos=0,nw_ttl=128,icmp_type=8,icmp_code=0'], [0], [stdout])
161 AT_CHECK([tail -1 stdout], [0],
162 [Datapath actions: 10,11,12,13,14,15,16,17,18,19,20,21
167 AT_SETUP([ofproto-dpif - goto table])
169 ADD_OF_PORTS([br0], [1], [10], [11])
170 echo "table=0 in_port=1 actions=output(10),goto_table(1)" > flows.txt
171 for i in `seq 1 63`; do echo "table=$i actions=goto_table($(($i+1)))"; done >> flows.txt
172 echo "table=64 actions=output(11)" >> flows.txt
173 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flows br0 flows.txt])
174 AT_CHECK([ovs-appctl ofproto/trace br0 'in_port=1,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,dl_type=0x0800,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=1,nw_tos=0,nw_ttl=128,icmp_type=8,icmp_code=0'], [0], [stdout])
175 AT_CHECK([tail -1 stdout], [0],
176 [Datapath actions: 10,11
181 AT_SETUP([ofproto-dpif - write actions])
183 ADD_OF_PORTS([br0], [1], [10], [11], [12], [13])
184 AT_DATA([flows.txt], [dnl
185 table=0 in_port=1,ip actions=output(10),write_actions(set_field:192.168.3.90->ip_src,output(12)),goto_table(1)
186 table=1 ip actions=write_actions(output(13)),goto_table(2)
187 table=2 ip actions=set_field:192.168.3.91->ip_src,output(11)
189 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flows br0 flows.txt])
190 AT_CHECK([ovs-appctl ofproto/trace br0 'in_port=1,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,dl_type=0x0800,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=1,nw_tos=0,nw_ttl=128,icmp_type=8,icmp_code=0'], [0], [stdout])
191 AT_CHECK([tail -2 stdout], [0],
192 [Megaflow: recirc_id=0,skb_priority=0,icmp,in_port=1,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=128
193 Datapath actions: 10,set(ipv4(src=192.168.3.91,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no)),11,set(ipv4(src=192.168.3.90,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no)),13
198 AT_SETUP([ofproto-dpif - clear actions])
200 ADD_OF_PORTS([br0], [1], [10], [11], [12])
201 AT_DATA([flows.txt], [dnl
202 table=0 in_port=1,ip actions=output(10),write_actions(set_field:192.168.3.90->ip_src,output(12)),goto_table(1)
203 table=1 tcp actions=set_field:91->tp_src,output(11),clear_actions
205 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flows br0 flows.txt])
206 AT_CHECK([ovs-appctl ofproto/trace br0 'in_port=1,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,dl_type=0x0800,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=6,nw_tos=0,nw_ttl=128,tp_src=8,tp_dst=9'], [0], [stdout])
207 AT_CHECK([tail -2 stdout], [0],
208 [Megaflow: recirc_id=0,skb_priority=0,tcp,in_port=1,nw_frag=no,tp_src=8,tp_dst=9
209 Datapath actions: 10,set(tcp(src=91,dst=9)),11
214 AT_SETUP([ofproto-dpif - group chaining not supported])
216 ADD_OF_PORTS([br0], [1], [10], [11])
217 AT_CHECK([ovs-ofctl -O OpenFlow12 add-group br0 'group_id=1234,type=all,bucket=output:10,set_field:192.168.3.90->ip_src,group:123,bucket=output:11'],
219 AT_CHECK([STRIP_XIDS stderr | sed 1q], [0],
220 [OFPT_ERROR (OF1.2): OFPGMFC_CHAINING_UNSUPPORTED
225 AT_SETUP([ofproto-dpif - all group in action list])
227 ADD_OF_PORTS([br0], [1], [10], [11])
228 AT_CHECK([ovs-ofctl -O OpenFlow12 add-group br0 'group_id=1234,type=all,bucket=output:10,set_field:192.168.3.90->ip_src,bucket=output:11'])
229 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 'ip actions=group:1234'])
230 AT_CHECK([ovs-appctl ofproto/trace br0 'in_port=1,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,dl_type=0x0800,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=1,nw_tos=0,nw_ttl=128,icmp_type=8,icmp_code=0'], [0], [stdout])
231 AT_CHECK([tail -2 stdout], [0],
232 [Megaflow: recirc_id=0,skb_priority=0,icmp,in_port=1,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=128
233 Datapath actions: set(ipv4(src=192.168.3.90,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no)),10,set(ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no)),11
238 AT_SETUP([ofproto-dpif - indirect group in action list])
240 ADD_OF_PORTS([br0], [1], [10])
241 AT_CHECK([ovs-ofctl -O OpenFlow12 add-group br0 group_id=1234,type=indirect,bucket=output:10])
242 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 'ip actions=group:1234'])
243 AT_CHECK([ovs-appctl ofproto/trace br0 'in_port=1,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,dl_type=0x0800,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=1,nw_tos=0,nw_ttl=128,icmp_type=8,icmp_code=0'], [0], [stdout])
244 AT_CHECK([tail -1 stdout], [0],
245 [Datapath actions: 10
250 AT_SETUP([ofproto-dpif - all group in action set])
252 ADD_OF_PORTS([br0], [1], [10], [11])
253 AT_CHECK([ovs-ofctl -O OpenFlow12 add-group br0 'group_id=1234,type=all,bucket=output:10,set_field:192.168.3.90->ip_src,bucket=output:11'])
254 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 'ip actions=write_actions(group:1234)'])
255 AT_CHECK([ovs-appctl ofproto/trace br0 'in_port=1,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,dl_type=0x0800,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=1,nw_tos=0,nw_ttl=128,icmp_type=8,icmp_code=0'], [0], [stdout])
256 AT_CHECK([tail -2 stdout], [0],
257 [Megaflow: recirc_id=0,skb_priority=0,icmp,in_port=1,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_tos=0,nw_ecn=0,nw_ttl=128
258 Datapath actions: set(ipv4(src=192.168.3.90,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no)),10,set(ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no)),11
263 AT_SETUP([ofproto-dpif - indirect group in action set])
265 ADD_OF_PORTS([br0], [1], [10])
266 AT_CHECK([ovs-ofctl -O OpenFlow12 add-group br0 group_id=1234,type=indirect,bucket=output:10])
267 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 'ip actions=write_actions(group:1234)'])
268 AT_CHECK([ovs-appctl ofproto/trace br0 'in_port=1,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,dl_type=0x0800,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=1,nw_tos=0,nw_ttl=128,icmp_type=8,icmp_code=0'], [0], [stdout])
269 AT_CHECK([tail -1 stdout], [0],
270 [Datapath actions: 10
275 AT_SETUP([ofproto-dpif - select group])
277 ADD_OF_PORTS([br0], [1], [10], [11])
278 AT_CHECK([ovs-ofctl -O OpenFlow12 add-group br0 'group_id=1234,type=select,bucket=output:10,bucket=output:11'])
279 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 'ip actions=write_actions(group:1234)'])
281 # Try a bunch of different flows and make sure that they get distributed
283 for d in 0 1 2 3 4 5 6 7 8 9 a b c d e f; do
284 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])
285 tail -1 stdout >> results
287 sort results | uniq -c
288 AT_CHECK([sort results | uniq], [0],
289 [Datapath actions: 10
295 AT_SETUP([ofproto-dpif - select group with watch port])
297 ADD_OF_PORTS([br0], [1], [10], [11])
298 AT_CHECK([ovs-ofctl -O OpenFlow12 add-group br0 'group_id=1234,type=select,bucket=watch_port:10,output:10,bucket=output:11'])
299 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 'ip actions=write_actions(group:1234)'])
300 AT_CHECK([ovs-appctl ofproto/trace br0 'in_port=1,dl_src=50:54:00:00:00:07,dl_dst=50:54:00:00:00:07,dl_type=0x0800,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=1,nw_tos=0,nw_ttl=128,icmp_type=8,icmp_code=0'], [0], [stdout])
301 AT_CHECK([tail -1 stdout], [0],
302 [Datapath actions: 11
307 AT_SETUP([ofproto-dpif - select group with weight])
309 ADD_OF_PORTS([br0], [1], [10], [11], [12])
310 AT_CHECK([ovs-ofctl -O OpenFlow12 add-group br0 'group_id=1234,type=select,bucket=output:10,bucket=output:11,weight=2000,bucket=output:12,weight=0'])
311 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 'ip actions=write_actions(group:1234)'])
312 AT_CHECK([ovs-appctl ofproto/trace br0 'in_port=1,dl_src=50:54:00:00:00:07,dl_dst=50:54:00:00:00:07,dl_type=0x0800,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=1,nw_tos=0,nw_ttl=128,icmp_type=8,icmp_code=0'], [0], [stdout])
313 AT_CHECK([tail -1 stdout], [0],
314 [Datapath actions: 11
319 AT_SETUP([ofproto-dpif - fast failover group])
321 ADD_OF_PORTS([br0], [1], [10], [11])
322 AT_CHECK([ovs-ofctl -O OpenFlow12 add-group br0 'group_id=1234,type=ff,bucket=watch_port:10,output:10,bucket=watch_port:11,output:11'])
323 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 'ip actions=write_actions(group:1234)'])
324 AT_CHECK([ovs-appctl ofproto/trace br0 'in_port=1,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,dl_type=0x0800,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=1,nw_tos=0,nw_ttl=128,icmp_type=8,icmp_code=0'], [0], [stdout])
325 AT_CHECK([tail -1 stdout], [0],
326 [Datapath actions: drop
331 AT_SETUP([ofproto-dpif - group stats single bucket])
333 ADD_OF_PORTS([br0], [1], [10], [11])
334 AT_CHECK([ovs-ofctl -O OpenFlow12 add-group br0 'group_id=1234,type=select,bucket=output:10,weight=2000,bucket=output:11,weight=0'])
335 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 'ip actions=write_actions(group:1234)'])
339 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)"
340 AT_CHECK([ovs-appctl netdev-dummy/receive p1 $pkt])
343 ovs-appctl time/warp 100
344 sleep 1 # wait for forwarders process packets
345 AT_CHECK([ovs-ofctl -O OpenFlow12 -vwarn dump-group-stats br0], [0], [stdout])
346 AT_CHECK([STRIP_XIDS stdout | sort], [0], [dnl
347 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
348 OFPST_GROUP reply (OF1.2):
353 AT_SETUP([ofproto-dpif - group stats all buckets])
355 ADD_OF_PORTS([br0], [1], [10], [11])
356 AT_CHECK([ovs-ofctl -O OpenFlow12 add-group br0 'group_id=1234,type=all,bucket=output:10,bucket=output:11'])
357 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flow br0 'ip actions=write_actions(group:1234)'])
361 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)"
362 AT_CHECK([ovs-appctl netdev-dummy/receive p1 $pkt])
365 ovs-appctl time/warp 100
366 sleep 1 # wait for forwarders process packets
367 AT_CHECK([ovs-ofctl -O OpenFlow12 -vwarn dump-group-stats br0], [0], [stdout])
368 AT_CHECK([STRIP_XIDS stdout | sort], [0], [dnl
369 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
370 OFPST_GROUP reply (OF1.2):
375 AT_SETUP([ofproto-dpif - registers])
377 ADD_OF_PORTS([br0], [20], [21], [22], [33], [90])
378 AT_DATA([flows.txt], [dnl
379 in_port=90 actions=resubmit:2,resubmit:3,resubmit:4,resubmit:91
380 in_port=91 actions=resubmit:5,resubmit:6,resubmit:7,resubmit:92
381 in_port=92 actions=resubmit:8,resubmit:9,resubmit:10,resubmit:11,resubmit:93
382 in_port=93 actions=resubmit:12,resubmit:13,resubmit:14,resubmit:15
384 in_port=2 actions=load:0x000db000->NXM_NX_REG0[[]]
385 in_port=3 actions=load:0xdea->NXM_NX_REG0[[20..31]]
386 in_port=4 actions=load:0xeef->NXM_NX_REG0[[0..11]]
387 in_port=5 actions=move:NXM_NX_REG0[[]]->NXM_NX_REG1[[]]
388 in_port=6 actions=load:0x22222222->NXM_NX_REG2[[]]
389 in_port=7 actions=move:NXM_NX_REG1[[20..31]]->NXM_NX_REG2[[0..11]]
390 in_port=8 actions=move:NXM_NX_REG1[[0..11]]->NXM_NX_REG2[[20..31]]
391 in_port=9,reg0=0xdeadbeef actions=output:20
392 in_port=10,reg1=0xdeadbeef actions=output:21
393 in_port=11,reg2=0xeef22dea actions=output:22
395 dnl Sanilty check all registers
396 in_port=12 actions=load:0x10->NXM_NX_REG0[[]],load:0x11->NXM_NX_REG1[[]],load:0x12->NXM_NX_REG2[[]]
397 in_port=13 actions=load:0x13->NXM_NX_REG3[[]],load:0x14->NXM_NX_REG4[[]],load:0x15->NXM_NX_REG5[[]]
398 in_port=14 actions=load:0x16->NXM_NX_REG6[[]],load:0x17->NXM_NX_REG7[[]]
399 in_port=15,reg0=0x10,reg1=0x11,reg2=0x12,reg3=0x13,reg4=0x14,reg5=0x15,reg6=0x16,reg7=0x17 actions=output:33
402 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
403 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(90),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)'], [0], [stdout])
404 AT_CHECK([tail -1 stdout], [0],
405 [Datapath actions: 20,21,22,33
410 AT_SETUP([ofproto-dpif - push-pop])
412 ADD_OF_PORTS([br0], [20], [21], [22], [33], [90])
413 AT_DATA([flows.txt], [dnl
414 in_port=90 actions=load:20->NXM_NX_REG0[[0..7]],load:21->NXM_NX_REG1[[0..7]],load:22->NXM_NX_REG2[[0..7]], load:33->NXM_NX_REG3[[0..7]], push:NXM_NX_REG0[[]], push:NXM_NX_REG1[[0..7]],push:NXM_NX_REG2[[0..15]], push:NXM_NX_REG3[[]], resubmit:2, resubmit:3, resubmit:4, resubmit:5
415 in_port=2 actions=pop:NXM_NX_REG0[[0..7]],output:NXM_NX_REG0[[]]
416 in_port=3 actions=pop:NXM_NX_REG1[[0..7]],output:NXM_NX_REG1[[]]
417 in_port=4 actions=pop:NXM_NX_REG2[[0..15]],output:NXM_NX_REG2[[]]
418 in_port=5 actions=pop:NXM_NX_REG3[[]],output:NXM_NX_REG3[[]]
421 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
422 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(90),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)'], [0], [stdout])
423 AT_CHECK([tail -1 stdout], [0],
424 [Datapath actions: 33,22,21,20
429 AT_SETUP([ofproto-dpif - output])
431 ADD_OF_PORTS([br0], [1], [9], [10], [11], [55], [66], [77], [88])
432 AT_DATA([flows.txt], [dnl
433 in_port=1 actions=resubmit:2,resubmit:3,resubmit:4,resubmit:5,resubmit:6,resubmit:7,resubmit:8
434 in_port=2 actions=output:9
435 in_port=3 actions=load:55->NXM_NX_REG0[[]],output:NXM_NX_REG0[[]],load:66->NXM_NX_REG1[[]]
436 in_port=4 actions=output:10,output:NXM_NX_REG0[[]],output:NXM_NX_REG1[[]],output:11
437 in_port=5 actions=load:77->NXM_NX_REG0[[0..15]],load:88->NXM_NX_REG0[[16..31]]
438 in_port=6 actions=output:NXM_NX_REG0[[0..15]],output:NXM_NX_REG0[[16..31]]
439 in_port=7 actions=load:0x110000ff->NXM_NX_REG0[[]],output:NXM_NX_REG0[[]]
440 in_port=8 actions=1,9,load:9->NXM_OF_IN_PORT[[]],1,9
442 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
443 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)'], [0], [stdout])
444 AT_CHECK([tail -1 stdout], [0],
445 [Datapath actions: 9,55,10,55,66,11,77,88,9,1
450 AT_SETUP([ofproto-dpif - dec_ttl])
452 ADD_OF_PORTS([br0], [1], [2], [3], [4])
453 AT_DATA([flows.txt], [dnl
454 table=0 in_port=1 action=dec_ttl,output:2,resubmit(1,1),output:4
455 table=1 in_port=1 action=dec_ttl,output:3
457 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
458 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=111,tos=0,ttl=2,frag=no)' -generate], [0], [stdout])
459 AT_CHECK([tail -4 stdout], [0],
460 [Megaflow: recirc_id=0,skb_priority=0,ip,in_port=1,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=111,nw_tos=0,nw_ecn=0,nw_ttl=2
461 Datapath actions: set(ipv4(src=192.168.0.1,dst=192.168.0.2,proto=111,tos=0,ttl=1,frag=no)),2,4
462 This flow is handled by the userspace slow path because it:
463 - Sends "packet-in" messages to the OpenFlow controller.
465 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=111,tos=0,ttl=3,frag=no)'], [0], [stdout])
466 AT_CHECK([tail -2 stdout], [0],
467 [Megaflow: recirc_id=0,skb_priority=0,ip,in_port=1,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_proto=111,nw_tos=0,nw_ecn=0,nw_ttl=3
468 Datapath actions: set(ipv4(src=192.168.0.1,dst=192.168.0.2,proto=111,tos=0,ttl=2,frag=no)),2,set(ipv4(src=192.168.0.1,dst=192.168.0.2,proto=111,tos=0,ttl=1,frag=no)),3,4
470 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x86dd),ipv6(src=::1,dst=::2,label=0,proto=10,tclass=0x70,hlimit=128,frag=no)'], [0], [stdout])
471 AT_CHECK([tail -2 stdout], [0],
472 [Megaflow: recirc_id=0,skb_priority=0,ipv6,in_port=1,ipv6_src=::1,ipv6_dst=::2,ipv6_label=0x00000,nw_proto=10,nw_tos=112,nw_ecn=0,nw_ttl=128
473 Datapath actions: set(ipv6(src=::1,dst=::2,label=0,proto=10,tclass=0x70,hlimit=127,frag=no)),2,set(ipv6(src=::1,dst=::2,label=0,proto=10,tclass=0x70,hlimit=126,frag=no)),3,4
476 AT_CAPTURE_FILE([ofctl_monitor.log])
477 AT_CHECK([ovs-ofctl monitor br0 65534 invalid_ttl --detach --no-chdir --pidfile 2> ofctl_monitor.log])
478 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=111,tos=0,ttl=2,frag=no)' -generate], [0], [stdout])
479 OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
480 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
481 NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=34 in_port=1 (via invalid_ttl) data_len=34 (unbuffered)
482 ip,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
487 dnl A dec_ttl action at offset 32 in ofpacts will cause the ofpacts
488 dnl buffer to be resized just before pushing the id of the dec_ttl action.
489 dnl Thus the implementation must account for this by using the
490 dnl reallocated buffer rather than the original buffer.
492 dnl A number of similar rules are added to try and exercise
493 dnl xrealloc sufficiently that it returns a different base pointer
494 AT_SETUP([ofproto-dpif - dec_ttl without arguments at offset 32 in ofpacts])
496 ADD_OF_PORTS([br0], [1])
497 (for i in `seq 0 255`; do
498 printf "dl_src=10:11:11:11:11:%02x actions=output:1,output:1,output:1,dec_ttl,controller\n" $i
500 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
504 dnl A dec_ttl action at offset 32 in ofpacts will cause the ofpacts
505 dnl buffer to be resized just before pushing the id of the dec_ttl action.
506 dnl Thus the implementation must account for this by using the
507 dnl reallocated buffer rather than the original buffer.
509 dnl A number of similar rules are added to try and exercise
510 dnl xrealloc sufficiently that it returns a different base pointer
511 AT_SETUP([ofproto-dpif - dec_ttl with arguments at offset 32 in ofpacts])
513 ADD_OF_PORTS([br0], [1])
514 (for i in `seq 0 255`; do
515 printf "dl_src=10:11:11:11:11:%02x actions=output:1,output:1,output:1,dec_ttl(1),controller\n" $i
517 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
521 dnl A note action at offset 24 in ofpacts will cause the ofpacts
522 dnl buffer to be resized just before pushing the id of the dec_ttl action.
523 dnl Thus the implementation must account for this by using the
524 dnl reallocated buffer rather than the original buffer.
526 dnl A number of similar rules are added to try and exercise
527 dnl xrealloc sufficiently that it returns a different base pointer
528 AT_SETUP([ofproto-dpif - note at offset 24 in ofpacts])
530 ADD_OF_PORTS([br0], [1])
531 (for i in `seq 0 255`; do
532 printf "dl_src=10:11:11:11:11:%02x actions=output:1,output:1,note:ff,controller\n" $i
534 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
538 AT_SETUP([ofproto-dpif - output, OFPP_NONE ingress port])
540 ADD_OF_PORTS([br0], [1], [2])
542 AT_CHECK([ovs-ofctl add-flow br0 action=normal])
544 # "in_port" defaults to OFPP_NONE if it's not specified.
545 flow="icmp,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,icmp_type=8,icmp_code=0"
546 AT_CHECK([ovs-appctl ofproto/trace br0 "$flow"], [0], [stdout])
547 AT_CHECK([tail -1 stdout | sed 's/Datapath actions: //' | tr "," "\n" | sort -n], [0], [dnl
556 AT_SETUP([ofproto-dpif - DSCP])
557 OVS_VSWITCHD_START([add-port br0 p1 -- set Interface p1 type=dummy])
558 ADD_OF_PORTS([br0], [9])
559 AT_DATA([flows.txt], [dnl
560 actions=output:LOCAL,enqueue:1:1,enqueue:1:2,enqueue:1:2,enqueue:1:1,output:1,mod_nw_tos:0,output:1,output:LOCAL
562 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
563 AT_CHECK([ovs-vsctl -- \
564 set Port p1 qos=@newqos --\
565 --id=@newqos create QoS type=linux-htb queues=1=@q1,2=@q2 --\
566 --id=@q1 create Queue dscp=1 --\
567 --id=@q2 create Queue dscp=2], [0], [ignore])
568 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(9),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=1.1.1.1,dst=2.2.2.2,proto=1,tos=0xff,ttl=128,frag=no),icmp(type=8,code=0)'], [0], [stdout])
569 AT_CHECK([tail -2 stdout], [0],
570 [Megaflow: recirc_id=0,skb_priority=0,icmp,in_port=9,nw_src=1.1.1.1,nw_dst=2.2.2.2,nw_tos=252,nw_ecn=3,nw_ttl=128
571 Datapath actions: dnl
573 set(ipv4(src=1.1.1.1,dst=2.2.2.2,proto=1,tos=0x7,ttl=128,frag=no)),set(skb_priority(0x1)),1,dnl
574 set(ipv4(src=1.1.1.1,dst=2.2.2.2,proto=1,tos=0xb,ttl=128,frag=no)),set(skb_priority(0x2)),1,dnl
576 set(ipv4(src=1.1.1.1,dst=2.2.2.2,proto=1,tos=0x7,ttl=128,frag=no)),set(skb_priority(0x1)),1,dnl
577 set(ipv4(src=1.1.1.1,dst=2.2.2.2,proto=1,tos=0xff,ttl=128,frag=no)),set(skb_priority(0)),1,dnl
578 set(ipv4(src=1.1.1.1,dst=2.2.2.2,proto=1,tos=0x3,ttl=128,frag=no)),1,dnl
584 AT_SETUP([ofproto-dpif - output/flood flags])
586 ADD_OF_PORTS([br0], [1], [2], [3], [4], [5], [6], [7])
588 AT_DATA([flows.txt], [dnl
589 in_port=local actions=local,flood
590 in_port=1 actions=flood
591 in_port=2 actions=all
592 in_port=3 actions=output:LOCAL,output:1,output:2,output:3,output:4,output:5,output:6,output:7
593 in_port=4 actions=enqueue:LOCAL:1,enqueue:1:1,enqueue:2:1,enqueue:3:2,enqueue:4:1,enqueue:5:1,enqueue:6:1,enqueue:7:1
595 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
596 AT_CHECK([ovs-ofctl mod-port br0 5 noforward])
597 AT_CHECK([ovs-ofctl mod-port br0 6 noflood])
599 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(100),eth(src=00:00:00:00:00:01,dst=00:00:00:00:00:02),eth_type(0x0900)'], [0], [stdout])
600 AT_CHECK([tail -1 stdout \
601 | sed -e 's/Datapath actions: //' | tr ',' '\n' | sort], [0], [dnl
609 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(1),eth(src=00:00:00:00:00:01,dst=00:00:00:00:00:02),eth_type(0x0900)'], [0], [stdout])
610 AT_CHECK([tail -1 stdout \
611 | sed -e 's/Datapath actions: //' | tr ',' '\n' | sort], [0], [dnl
619 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(2),eth(src=00:00:00:00:00:01,dst=00:00:00:00:00:02),eth_type(0x0900)'], [0], [stdout])
620 AT_CHECK([tail -1 stdout \
621 | sed -e 's/Datapath actions: //' | tr ',' '\n' | sort], [0], [dnl
630 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(3),eth(src=00:00:00:00:00:01,dst=00:00:00:00:00:02),eth_type(0x0900)'], [0], [stdout])
631 AT_CHECK([tail -1 stdout], [0],
632 [Datapath actions: 100,1,2,4,6,7
635 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(4),eth(src=00:00:00:00:00:01,dst=00:00:00:00:00:02),eth_type(0x0900)'], [0], [stdout])
636 AT_CHECK([tail -1 stdout], [0],
637 [Datapath actions: set(skb_priority(0x1)),100,1,2,set(skb_priority(0x2)),3,set(skb_priority(0x1)),6,7
642 AT_SETUP([ofproto-dpif - Default Table Miss - OF1.0 (OFPTC_TABLE_MISS_CONTROLLER)])
643 OVS_VSWITCHD_START([dnl
644 add-port br0 p1 -- set Interface p1 type=dummy
646 ON_EXIT([kill `cat ovs-ofctl.pid`])
648 AT_CAPTURE_FILE([ofctl_monitor.log])
650 AT_CHECK([ovs-ofctl monitor br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
653 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)'
655 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
656 OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
657 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
658 NXT_PACKET_IN (xid=0x0): cookie=0x0 total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
659 tcp,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=0x010 tcp_csum:0
661 NXT_PACKET_IN (xid=0x0): cookie=0x0 total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
662 tcp,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=0x010 tcp_csum:0
664 NXT_PACKET_IN (xid=0x0): cookie=0x0 total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
665 tcp,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=0x010 tcp_csum:0
668 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
669 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
676 AT_SETUP([ofproto-dpif - Default Table Miss - OF1.3 (OFPTC_TABLE_MISS_DROP)])
677 OVS_VSWITCHD_START([dnl
678 add-port br0 p1 -- set Interface p1 type=dummy
680 ON_EXIT([kill `cat ovs-ofctl.pid`])
682 AT_CAPTURE_FILE([ofctl_monitor.log])
683 AT_CHECK([ovs-ofctl del-flows br0])
685 AT_CHECK([ovs-ofctl monitor -OOpenFlow13 -P openflow10 br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
687 dnl Test that missed packets are droped
689 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)'
691 OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
693 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
696 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
697 AT_CHECK([ovs-ofctl -OOpenFlow13 dump-flows br0 | ofctl_strip | sort], [0], [dnl
698 OFPST_FLOW reply (OF1.3):
704 AT_SETUP([ofproto-dpif - Table Miss - goto table and OFPTC_TABLE_MISS_CONTROLLER])
705 OVS_VSWITCHD_START([dnl
706 add-port br0 p1 -- set Interface p1 type=dummy
708 ON_EXIT([kill `cat ovs-ofctl.pid`])
710 AT_CAPTURE_FILE([ofctl_monitor.log])
711 AT_CHECK([ovs-ofctl -OOpenFlow12 add-flow br0 'table=0 actions=goto_table(1)'])
713 AT_CHECK([ovs-ofctl monitor -P openflow10 br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
716 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)'
718 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
719 OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
720 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
721 OFPT_PACKET_IN (xid=0x0): total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
722 tcp,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=0x010 tcp_csum:0
724 OFPT_PACKET_IN (xid=0x0): total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
725 tcp,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=0x010 tcp_csum:0
727 OFPT_PACKET_IN (xid=0x0): total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
728 tcp,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=0x010 tcp_csum:0
731 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
732 sleep 1 # wait for revalidator to update stats
733 AT_CHECK([ovs-ofctl -OOpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
734 n_packets=3, n_bytes=180, actions=goto_table:1
735 OFPST_FLOW reply (OF1.2):
741 AT_SETUP([ofproto-dpif - Table Miss - resubmit and OFPTC_TABLE_MISS_CONTROLLER])
742 OVS_VSWITCHD_START([dnl
743 add-port br0 p1 -- set Interface p1 type=dummy
745 ON_EXIT([kill `cat ovs-ofctl.pid`])
747 AT_CAPTURE_FILE([ofctl_monitor.log])
748 AT_CHECK([ovs-ofctl -OOpenFlow12 add-flow br0 'table=0 actions=resubmit(1,1)'])
750 AT_CHECK([ovs-ofctl monitor -P openflow10 br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
753 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)'
756 OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
757 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
760 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
761 sleep 1 # wait for revalidator to update stats
762 AT_CHECK([ovs-ofctl -OOpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
763 n_packets=3, n_bytes=180, actions=resubmit(1,1)
764 OFPST_FLOW reply (OF1.2):
770 AT_SETUP([ofproto-dpif - Table Miss - OFPTC_TABLE_MISS_CONTINUE])
771 OVS_VSWITCHD_START([dnl
772 add-port br0 p1 -- set Interface p1 type=dummy
774 ON_EXIT([kill `cat ovs-ofctl.pid`])
776 AT_CAPTURE_FILE([ofctl_monitor.log])
777 AT_CHECK([ovs-ofctl add-flow br0 'table=1 dl_src=10:11:11:11:11:11 actions=controller'])
778 AT_CHECK([ovs-ofctl -OOpenFlow11 mod-table br0 all continue])
780 dnl Miss table 0, Hit table 1
781 AT_CHECK([ovs-ofctl monitor br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
784 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)'
786 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
787 OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
789 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
790 NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
791 tcp,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=0x010 tcp_csum:0
793 NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
794 tcp,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=0x010 tcp_csum:0
796 NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
797 tcp,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=0x010 tcp_csum:0
800 dnl Hit table 0, Miss all other tables, sent to controller
801 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --no-chdir --pidfile 2> ofctl_monitor.log])
804 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)'
806 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
807 OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
809 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
810 NXT_PACKET_IN (xid=0x0): table_id=253 cookie=0x0 total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
811 tcp,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=0x010 tcp_csum:0
813 NXT_PACKET_IN (xid=0x0): table_id=253 cookie=0x0 total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
814 tcp,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=0x010 tcp_csum:0
816 NXT_PACKET_IN (xid=0x0): table_id=253 cookie=0x0 total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
817 tcp,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=0x010 tcp_csum:0
820 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
821 sleep 1 # wait for revalidator to update stats
822 AT_CHECK([ovs-ofctl -OOpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
823 table=1, n_packets=3, n_bytes=180, dl_src=10:11:11:11:11:11 actions=CONTROLLER:65535
824 OFPST_FLOW reply (OF1.2):
830 AT_SETUP([ofproto-dpif - Table Miss - goto table and OFPTC_TABLE_MISS_CONTINUE])
831 OVS_VSWITCHD_START([dnl
832 add-port br0 p1 -- set Interface p1 type=dummy
834 ON_EXIT([kill `cat ovs-ofctl.pid`])
836 AT_CAPTURE_FILE([ofctl_monitor.log])
837 AT_DATA([flows.txt], [dnl
838 table=0 actions=goto_table(1)
839 table=2 dl_src=10:11:11:11:11:11 actions=controller
841 AT_CHECK([ovs-ofctl -OOpenFlow12 add-flows br0 flows.txt])
842 AT_CHECK([ovs-ofctl -OOpenFlow11 mod-table br0 all continue])
844 dnl Hit table 0, Miss table 1, Hit table 2
845 AT_CHECK([ovs-ofctl monitor br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
848 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)'
850 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
851 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
853 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
854 NXT_PACKET_IN (xid=0x0): table_id=2 cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
855 tcp,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=0x010 tcp_csum:0
857 NXT_PACKET_IN (xid=0x0): table_id=2 cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
858 tcp,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=0x010 tcp_csum:0
860 NXT_PACKET_IN (xid=0x0): table_id=2 cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
861 tcp,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=0x010 tcp_csum:0
864 dnl Hit table 1, Miss all other tables, sent to controller
865 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --no-chdir --pidfile 2> ofctl_monitor.log])
868 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)'
870 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
871 OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
873 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
874 NXT_PACKET_IN (xid=0x0): table_id=253 cookie=0x0 total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
875 tcp,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=0x010 tcp_csum:0
877 NXT_PACKET_IN (xid=0x0): table_id=253 cookie=0x0 total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
878 tcp,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=0x010 tcp_csum:0
880 NXT_PACKET_IN (xid=0x0): table_id=253 cookie=0x0 total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
881 tcp,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=0x010 tcp_csum:0
884 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
885 sleep 1 # wait for revalidator to update stats
886 AT_CHECK([ovs-ofctl -OOpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
887 n_packets=6, n_bytes=360, actions=goto_table:1
888 table=2, n_packets=3, n_bytes=180, dl_src=10:11:11:11:11:11 actions=CONTROLLER:65535
889 OFPST_FLOW reply (OF1.2):
895 AT_SETUP([ofproto-dpif - Table Miss - resubmit and OFPTC_TABLE_MISS_CONTINUE])
896 OVS_VSWITCHD_START([dnl
897 add-port br0 p1 -- set Interface p1 type=dummy
899 ON_EXIT([kill `cat ovs-ofctl.pid`])
901 AT_CAPTURE_FILE([ofctl_monitor.log])
902 AT_DATA([flows.txt], [dnl
903 table=0 actions=resubmit(1,1)
904 table=2 dl_src=10:11:11:11:11:11 actions=controller
906 AT_CHECK([ovs-ofctl -OOpenFlow12 add-flows br0 flows.txt])
907 AT_CHECK([ovs-ofctl -OOpenFlow11 mod-table br0 all continue])
909 dnl Hit table 0, Miss table 1, Dropped
910 AT_CHECK([ovs-ofctl monitor br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
913 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)'
915 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
917 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
920 dnl Hit table 1, Dropped
921 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --no-chdir --pidfile 2> ofctl_monitor.log])
924 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)'
926 OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
928 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
931 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
932 sleep 1 # wait for revalidator to update stats
933 AT_CHECK([ovs-ofctl -OOpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
934 n_packets=6, n_bytes=360, actions=resubmit(1,1)
935 table=2, dl_src=10:11:11:11:11:11 actions=CONTROLLER:65535
936 OFPST_FLOW reply (OF1.2):
942 AT_SETUP([ofproto-dpif - Table Miss - OFPTC_TABLE_MISS_DROP])
943 OVS_VSWITCHD_START([dnl
944 add-port br0 p1 -- set Interface p1 type=dummy
946 ON_EXIT([kill `cat ovs-ofctl.pid`])
948 AT_CAPTURE_FILE([ofctl_monitor.log])
949 AT_CHECK([ovs-ofctl -OOpenFlow11 mod-table br0 all drop])
951 AT_CHECK([ovs-ofctl monitor -P openflow10 br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
953 dnl Test that missed packets are droped
955 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)'
957 OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
959 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
962 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
963 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
970 AT_SETUP([ofproto-dpif - Table Miss - goto table and OFPTC_TABLE_MISS_DROP])
971 OVS_VSWITCHD_START([dnl
972 add-port br0 p1 -- set Interface p1 type=dummy
974 ON_EXIT([kill `cat ovs-ofctl.pid`])
976 AT_CAPTURE_FILE([ofctl_monitor.log])
977 AT_CHECK([ovs-ofctl del-flows br0])
978 AT_CHECK([ovs-ofctl -OOpenFlow12 add-flow br0 'table=0 actions=goto_table(1)'])
979 AT_CHECK([ovs-ofctl -OOpenFlow11 mod-table br0 all drop])
981 AT_CHECK([ovs-ofctl monitor -P openflow10 br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
983 dnl Test that missed packets are droped
985 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)'
987 OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
989 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
992 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
993 sleep 1 # wait for revalidator to update stats
994 AT_CHECK([ovs-ofctl -OOpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
995 n_packets=3, n_bytes=180, actions=goto_table:1
996 OFPST_FLOW reply (OF1.2):
1002 AT_SETUP([ofproto-dpif - Table Miss - resubmit and OFPTC_TABLE_MISS_DROP])
1003 OVS_VSWITCHD_START([dnl
1004 add-port br0 p1 -- set Interface p1 type=dummy
1006 ON_EXIT([kill `cat ovs-ofctl.pid`])
1008 AT_CAPTURE_FILE([ofctl_monitor.log])
1009 AT_CHECK([ovs-ofctl del-flows br0])
1010 AT_CHECK([ovs-ofctl -OOpenFlow12 add-flow br0 'table=0 actions=resubmit(1,1)'])
1011 AT_CHECK([ovs-ofctl -OOpenFlow11 mod-table br0 all drop])
1013 AT_CHECK([ovs-ofctl monitor -P openflow10 br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
1015 dnl Test that missed packets are droped
1017 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)'
1019 OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
1021 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1024 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
1025 sleep 1 # wait for revalidator to update stats
1026 AT_CHECK([ovs-ofctl -OOpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1027 n_packets=3, n_bytes=180, actions=resubmit(1,1)
1028 OFPST_FLOW reply (OF1.2):
1034 AT_SETUP([ofproto-dpif - controller])
1035 OVS_VSWITCHD_START([dnl
1036 add-port br0 p1 -- set Interface p1 type=dummy
1038 ON_EXIT([kill `cat ovs-ofctl.pid`])
1040 AT_CAPTURE_FILE([ofctl_monitor.log])
1041 AT_DATA([flows.txt], [dnl
1042 cookie=0x0 dl_src=10:11:11:11:11:11 actions=controller
1043 cookie=0x1 dl_src=20:22:22:22:22:22 actions=controller,resubmit(80,1)
1044 cookie=0x2 dl_src=30:33:33:33:33:33 actions=mod_vlan_vid:15,controller
1046 cookie=0x3 table=1 in_port=80 actions=load:1->NXM_NX_REG0[[]],mod_vlan_vid:80,controller,resubmit(81,2)
1047 cookie=0x4 table=2 in_port=81 actions=load:2->NXM_NX_REG1[[]],mod_dl_src:80:81:81:81:81:81,controller,resubmit(82,3)
1048 cookie=0x5 table=3 in_port=82 actions=load:3->NXM_NX_REG2[[]],mod_dl_dst:82:82:82:82:82:82,controller,resubmit(83,4)
1049 cookie=0x6 table=4 in_port=83 actions=load:4->NXM_NX_REG3[[]],mod_nw_src:83.83.83.83,controller,resubmit(84,5)
1050 cookie=0x7 table=5 in_port=84 actions=load:5->NXM_NX_REG4[[]],load:6->NXM_NX_TUN_ID[[]],mod_nw_dst:84.84.84.84,controller,resubmit(85,6)
1051 cookie=0x8 table=6 in_port=85 actions=mod_tp_src:85,controller,resubmit(86,7)
1052 cookie=0x9 table=7 in_port=86 actions=mod_tp_dst:86,controller,controller
1053 cookie=0xa dl_src=40:44:44:44:44:41 actions=mod_vlan_vid:99,mod_vlan_pcp:1,controller
1054 cookie=0xd dl_src=80:88:88:88:88:88 arp actions=load:2->OXM_OF_ARP_OP[[]],controller,load:0xc0a88001->OXM_OF_ARP_SPA[[]],controller,load:0x404444444441->OXM_OF_ARP_THA[[]],load:0x01010101->OXM_OF_ARP_SPA[[]],load:0x02020202->OXM_OF_ARP_TPA[[]],controller
1056 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
1059 AT_CHECK([ovs-ofctl monitor -P openflow10 br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
1062 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)'
1064 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1065 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1067 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1068 OFPT_PACKET_IN (xid=0x0): total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
1069 tcp,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=0x010 tcp_csum:0
1071 OFPT_PACKET_IN (xid=0x0): total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
1072 tcp,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=0x010 tcp_csum:0
1074 OFPT_PACKET_IN (xid=0x0): total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
1075 tcp,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=0x010 tcp_csum:0
1078 dnl Singleton controller action.
1079 AT_CHECK([ovs-ofctl monitor -P openflow10 br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
1082 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)'
1084 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1085 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1087 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1088 OFPT_PACKET_IN (xid=0x0): total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
1089 tcp,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=0x002 tcp_csum:0
1091 OFPT_PACKET_IN (xid=0x0): total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
1092 tcp,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=0x002 tcp_csum:0
1094 OFPT_PACKET_IN (xid=0x0): total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
1095 tcp,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=0x002 tcp_csum:0
1098 dnl Modified controller action.
1099 AT_CHECK([ovs-ofctl monitor -P openflow10 br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
1102 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)'
1104 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1105 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1107 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1108 OFPT_PACKET_IN (xid=0x0): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1109 tcp,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=0x001 tcp_csum:0
1111 OFPT_PACKET_IN (xid=0x0): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1112 tcp,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=0x001 tcp_csum:0
1114 OFPT_PACKET_IN (xid=0x0): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1115 tcp,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=0x001 tcp_csum:0
1118 dnl Modified VLAN controller action.
1119 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
1122 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)'
1124 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1125 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1127 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1128 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1129 ip,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
1131 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1132 ip,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
1134 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1135 ip,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
1139 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --no-chdir --pidfile 2> ofctl_monitor.log])
1142 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)'
1144 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 18])
1145 ovs-appctl -t ovs-ofctl exit
1147 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1148 NXT_PACKET_IN (xid=0x0): cookie=0x1 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
1149 tcp,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=0x001 tcp_csum:0
1151 NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x3 total_len=64 in_port=1 reg0=0x1 (via action) data_len=64 (unbuffered)
1152 tcp,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=0x001 tcp_csum:0
1154 NXT_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)
1155 tcp,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=0x001 tcp_csum:0
1157 NXT_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)
1158 tcp,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=0x001 tcp_csum:0
1160 NXT_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)
1161 tcp,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=0x001 tcp_csum:1a03
1163 NXT_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)
1164 tcp,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=0x001 tcp_csum:3205
1166 NXT_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)
1167 tcp,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=0x001 tcp_csum:31b8
1169 NXT_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)
1170 tcp,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=0x001 tcp_csum:316d
1172 NXT_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)
1173 tcp,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=0x001 tcp_csum:316d
1177 AT_CHECK([ovs-ofctl monitor br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
1180 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'
1182 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 18])
1183 ovs-appctl -t ovs-ofctl exit
1185 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1186 NXT_PACKET_IN (xid=0x0): cookie=0x1 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
1187 udp,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
1189 NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x3 total_len=64 in_port=1 reg0=0x1 (via action) data_len=64 (unbuffered)
1190 udp,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
1192 NXT_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)
1193 udp,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
1195 NXT_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)
1196 udp,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
1198 NXT_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)
1199 udp,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
1201 NXT_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)
1202 udp,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
1204 NXT_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)
1205 udp,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
1207 NXT_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)
1208 udp,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
1210 NXT_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)
1211 udp,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
1214 dnl Modified ARP controller action.
1215 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
1218 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)'
1221 OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
1222 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1223 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
1224 arp,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
1225 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
1226 arp,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
1227 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
1228 arp,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
1229 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
1230 arp,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
1231 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
1232 arp,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
1233 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
1234 arp,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
1235 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
1236 arp,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
1237 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
1238 arp,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
1239 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
1240 arp,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
1243 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
1246 AT_CHECK([ovs-ofctl monitor br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
1249 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'
1252 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 18])
1253 OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
1254 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1255 NXT_PACKET_IN (xid=0x0): cookie=0x1 total_len=98 in_port=1 (via action) data_len=98 (unbuffered)
1256 sctp,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
1258 NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x3 total_len=102 in_port=1 reg0=0x1 (via action) data_len=102 (unbuffered)
1259 sctp,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
1261 NXT_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)
1262 sctp,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
1264 NXT_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)
1265 sctp,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
1267 NXT_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)
1268 sctp,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
1270 NXT_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)
1271 sctp,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
1273 NXT_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)
1274 sctp,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
1276 NXT_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)
1277 sctp,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
1279 NXT_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)
1280 sctp,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
1283 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1284 cookie=0x1, n_packets=3, n_bytes=218, dl_src=20:22:22:22:22:22 actions=CONTROLLER:65535,resubmit(80,1)
1285 cookie=0x2, n_packets=3, n_bytes=180, dl_src=30:33:33:33:33:33 actions=mod_vlan_vid:15,CONTROLLER:65535
1286 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)
1287 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)
1288 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)
1289 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)
1290 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)
1291 cookie=0x8, table=6, n_packets=3, n_bytes=218, in_port=85 actions=mod_tp_src:85,CONTROLLER:65535,resubmit(86,7)
1292 cookie=0x9, table=7, n_packets=3, n_bytes=218, in_port=86 actions=mod_tp_dst:86,CONTROLLER:65535,CONTROLLER:65535
1293 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
1294 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
1295 n_packets=3, n_bytes=180, dl_src=10:11:11:11:11:11 actions=CONTROLLER:65535
1302 AT_SETUP([ofproto-dpif - MPLS handling])
1303 OVS_VSWITCHD_START([dnl
1304 add-port br0 p1 -- set Interface p1 type=dummy
1306 ON_EXIT([kill `cat ovs-ofctl.pid`])
1308 AT_CAPTURE_FILE([ofctl_monitor.log])
1309 AT_DATA([flows.txt], [dnl
1310 cookie=0xa dl_src=40:44:44:44:44:42 actions=push_mpls:0x8847,load:10->OXM_OF_MPLS_LABEL[[]],load:3->OXM_OF_MPLS_TC[[]],controller
1311 cookie=0xa dl_src=41:44:44:44:44:42 actions=push_mpls:0x8847,load:10->OXM_OF_MPLS_LABEL[[]],load:3->OXM_OF_MPLS_TC[[]],pop_mpls:0x0800,controller
1312 cookie=0xa dl_src=40:44:44:44:44:43 actions=push_mpls:0x8847,load:10->OXM_OF_MPLS_LABEL[[]],load:3->OXM_OF_MPLS_TC[[]],controller
1313 cookie=0xa dl_src=40:44:44:44:44:44 actions=push_mpls:0x8847,load:10->OXM_OF_MPLS_LABEL[[]],load:3->OXM_OF_MPLS_TC[[]],controller
1314 cookie=0xa dl_src=40:44:44:44:44:45 actions=push_mpls:0x8847,load:10->OXM_OF_MPLS_LABEL[[]],load:3->OXM_OF_MPLS_TC[[]],dec_mpls_ttl,controller
1315 cookie=0xa dl_src=40:44:44:44:44:46 actions=push_mpls:0x8847,load:10->OXM_OF_MPLS_LABEL[[]],load:3->OXM_OF_MPLS_TC[[]],set_mpls_ttl(10),controller
1316 cookie=0xa dl_src=40:44:44:44:44:47 actions=push_mpls:0x8847,load:10->OXM_OF_MPLS_LABEL[[]],load:3->OXM_OF_MPLS_TC[[]],dec_mpls_ttl,set_mpls_ttl(10),controller
1317 cookie=0xa dl_src=40:44:44:44:44:48 actions=push_mpls:0x8847,load:10->OXM_OF_MPLS_LABEL[[]],load:3->OXM_OF_MPLS_TC[[]],set_mpls_ttl(10),dec_mpls_ttl,controller
1318 cookie=0xb dl_src=50:55:55:55:55:55 dl_type=0x8847 actions=load:1000->OXM_OF_MPLS_LABEL[[]],controller
1319 cookie=0xd dl_src=60:66:66:66:66:66 actions=pop_mpls:0x0800,controller
1320 cookie=0xc dl_src=70:77:77:77:77:77 actions=push_mpls:0x8848,load:1000->OXM_OF_MPLS_LABEL[[]],load:7->OXM_OF_MPLS_TC[[]],controller
1322 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
1324 dnl Modified MPLS controller action.
1325 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
1328 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)'
1330 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1331 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1333 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1334 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1335 mpls,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
1337 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1338 mpls,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
1340 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1341 mpls,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
1344 dnl Modified MPLS controller action.
1345 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
1348 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)'
1350 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1351 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1353 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1354 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
1355 ip,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
1357 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
1358 ip,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
1360 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
1361 ip,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
1364 dnl Modified MPLS controller action.
1365 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
1367 dnl in_port(1),eth(src=00:01:02:03:04:05,dst=10:11:12:13:14:15),eth_type(0x8847),mpls(label=100,tc=3,ttl=64,bos=1)
1370 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)'
1372 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1373 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1375 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1376 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1377 mpls,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
1379 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1380 mpls,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
1382 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1383 mpls,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
1386 dnl Modified MPLS controller action.
1387 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
1390 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))'
1392 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1393 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1395 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1396 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1397 mpls,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
1399 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1400 mpls,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
1402 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1403 mpls,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
1406 dnl Modified MPLS controller action.
1407 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
1410 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)'
1412 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1413 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1415 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1416 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1417 mpls,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
1419 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1420 mpls,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
1422 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1423 mpls,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
1426 dnl Modified MPLS controller action.
1427 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
1430 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)'
1432 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1433 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1435 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1436 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1437 mpls,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
1439 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1440 mpls,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
1442 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1443 mpls,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
1446 dnl Modified MPLS controller action.
1447 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
1450 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)'
1452 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1453 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1455 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1456 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1457 mpls,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
1459 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1460 mpls,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
1462 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1463 mpls,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
1466 dnl Modified MPLS controller action.
1467 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
1470 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)'
1472 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1473 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1475 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1476 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1477 mpls,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
1479 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1480 mpls,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
1482 NXT_PACKET_IN (xid=0x0): cookie=0xa total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1483 mpls,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
1486 dnl Modified MPLS actions.
1487 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
1490 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)'
1492 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1493 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1495 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1496 NXT_PACKET_IN (xid=0x0): cookie=0xb total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
1497 mpls,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
1499 NXT_PACKET_IN (xid=0x0): cookie=0xb total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
1500 mpls,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
1502 NXT_PACKET_IN (xid=0x0): cookie=0xb total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
1503 mpls,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
1506 dnl Modified MPLS ipv6 controller action.
1507 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
1510 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)'
1512 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1513 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1515 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1516 NXT_PACKET_IN (xid=0x0): cookie=0xc total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1517 mplsm,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
1519 NXT_PACKET_IN (xid=0x0): cookie=0xc total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1520 mplsm,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
1522 NXT_PACKET_IN (xid=0x0): cookie=0xc total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1523 mplsm,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
1527 dnl Modified MPLS pop action.
1528 dnl The input is a frame with two MPLS headers which tcpdump -vve shows as:
1529 dnl 60:66:66:66:66:66 > 50:54:00:00:00:07, ethertype MPLS multicast (0x8847), length 66: MPLS (label 20, exp 0, ttl 32)
1530 dnl (tos 0x0, ttl 64, id 0, offset 0, flags [none], proto TCP (6), length 44)
1532 AT_CHECK([ovs-ofctl monitor br0 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
1535 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'
1538 # 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)'
1540 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1541 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1543 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1544 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
1545 tcp,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=0x000 tcp_csum:7744
1547 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
1548 tcp,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=0x000 tcp_csum:7744
1550 NXT_PACKET_IN (xid=0x0): cookie=0xd total_len=58 in_port=1 (via action) data_len=58 (unbuffered)
1551 tcp,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=0x000 tcp_csum:7744
1554 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
1556 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
1557 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
1558 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
1559 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
1560 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
1561 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
1562 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
1563 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
1564 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
1565 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
1566 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
1567 cookie=0xd, n_packets=3, n_bytes=186, dl_src=60:66:66:66:66:66 actions=pop_mpls:0x0800,CONTROLLER:65535
1575 AT_SETUP([ofproto-dpif - table-miss flow (OpenFlow 1.0)])
1576 OVS_VSWITCHD_START([dnl
1577 add-port br0 p1 -- set Interface p1 type=dummy
1579 ON_EXIT([kill `cat ovs-ofctl.pid`])
1581 AT_CAPTURE_FILE([ofctl_monitor.log])
1582 # A table-miss flow has priority 0 and no match
1583 AT_CHECK([ovs-ofctl --protocols=OpenFlow10 add-flow br0 'priority=0 actions=output:CONTROLLER'])
1585 dnl Singleton controller action.
1586 AT_CHECK([ovs-ofctl monitor -P openflow10 --protocols=OpenFlow10 br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
1589 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)'
1591 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1592 ovs-appctl -t ovs-ofctl exit
1594 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1595 OFPT_PACKET_IN (xid=0x0): total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
1596 tcp,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=0x002 tcp_csum:0
1598 OFPT_PACKET_IN (xid=0x0): total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
1599 tcp,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=0x002 tcp_csum:0
1601 OFPT_PACKET_IN (xid=0x0): total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
1602 tcp,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=0x002 tcp_csum:0
1605 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
1607 AT_CHECK([ovs-ofctl --protocols=OpenFlow10 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1608 n_packets=3, n_bytes=180, priority=0 actions=CONTROLLER:65535
1616 AT_SETUP([ofproto-dpif - table-miss flow (OpenFlow 1.3)])
1617 OVS_VSWITCHD_START([dnl
1618 add-port br0 p1 -- set Interface p1 type=dummy
1620 ON_EXIT([kill `cat ovs-ofctl.pid`])
1622 AT_CAPTURE_FILE([ofctl_monitor.log])
1623 # A table-miss flow has priority 0 and no match
1624 AT_CHECK([ovs-ofctl --protocols=OpenFlow13 add-flow br0 'priority=0 actions=output:CONTROLLER'])
1626 dnl Singleton controller action.
1627 AT_CHECK([ovs-ofctl monitor -P openflow10 --protocols=OpenFlow13 br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
1630 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)'
1632 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
1633 ovs-appctl -t ovs-ofctl exit
1635 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
1637 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
1638 OFPT_PACKET_IN (OF1.3) (xid=0x0): cookie=0x0 total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
1639 tcp,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=0x002 tcp_csum:0
1641 OFPT_PACKET_IN (OF1.3) (xid=0x0): cookie=0x0 total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
1642 tcp,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=0x002 tcp_csum:0
1644 OFPT_PACKET_IN (OF1.3) (xid=0x0): cookie=0x0 total_len=60 in_port=1 (via no_match) data_len=60 (unbuffered)
1645 tcp,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=0x002 tcp_csum:0
1648 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
1650 AT_CHECK([ovs-ofctl --protocols=OpenFlow13 dump-flows br0 | ofctl_strip | sort], [0], [dnl
1651 n_packets=3, n_bytes=180, priority=0 actions=CONTROLLER:65535
1652 OFPST_FLOW reply (OF1.3):
1658 AT_SETUP([ofproto-dpif - ARP modification slow-path])
1660 ADD_OF_PORTS([br0], [1], [2])
1662 ovs-vsctl -- set Interface p2 type=dummy options:pcap=p2.pcap
1663 ovs-ofctl add-flow br0 'in_port=1,arp actions=load:2->OXM_OF_ARP_OP[[]],2,load:0xc0a88001->OXM_OF_ARP_SPA[[]],2,load:0x404444444441->OXM_OF_ARP_THA[[]],2'
1665 # Input some packets that should follow the arp modification slow-path.
1667 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)'
1669 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
1671 # Check the packets that were output.
1672 AT_CHECK([ovs-ofctl parse-pcap p2.pcap], [0], [dnl
1673 arp,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
1674 arp,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
1675 arp,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
1676 arp,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
1677 arp,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
1678 arp,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
1679 arp,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
1680 arp,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
1681 arp,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
1687 AT_SETUP([ofproto-dpif - VLAN handling])
1689 [set Bridge br0 fail-mode=standalone -- \
1690 add-port br0 p1 trunks=10,12 -- \
1691 add-port br0 p2 tag=10 -- \
1692 add-port br0 p3 tag=12 \
1693 other-config:priority-tags=true -- \
1694 add-port br0 p4 tag=12 -- \
1695 add-port br0 p5 vlan_mode=native-tagged tag=10 -- \
1696 add-port br0 p6 vlan_mode=native-tagged tag=10 trunks=10,12 -- \
1697 add-port br0 p7 vlan_mode=native-untagged tag=12 -- \
1698 add-port br0 p8 vlan_mode=native-untagged tag=12 trunks=10,12 \
1699 other-config:priority-tags=true -- \
1700 set Interface p1 type=dummy -- \
1701 set Interface p2 type=dummy -- \
1702 set Interface p3 type=dummy -- \
1703 set Interface p4 type=dummy -- \
1704 set Interface p5 type=dummy -- \
1705 set Interface p6 type=dummy -- \
1706 set Interface p7 type=dummy -- \
1707 set Interface p8 type=dummy --])
1709 dnl Each of these specifies an in_port by number, a VLAN VID (or "none"),
1710 dnl a VLAN PCP (used if the VID isn't "none") and the expected set of datapath
1716 "100 10 0 1,5,6,7,8,pop_vlan,2" \
1717 "100 10 1 1,5,6,7,8,pop_vlan,2" \
1720 "100 12 0 1,5,6,pop_vlan,3,4,7,8" \
1721 "100 12 1 1,5,6,pop_vlan,4,7,push_vlan(vid=0,pcp=1),3,8" \
1725 "1 10 0 5,6,7,8,100,pop_vlan,2" \
1726 "1 10 1 5,6,7,8,100,pop_vlan,2" \
1729 "1 12 0 5,6,100,pop_vlan,3,4,7,8" \
1730 "1 12 1 5,6,100,pop_vlan,4,7,push_vlan(vid=0,pcp=1),3,8" \
1731 "2 none 0 push_vlan(vid=10,pcp=0),1,5,6,7,8,100" \
1732 "2 0 0 pop_vlan,push_vlan(vid=10,pcp=0),1,5,6,7,8,100" \
1733 "2 0 1 pop_vlan,push_vlan(vid=10,pcp=1),1,5,6,7,8,100" \
1740 "3 none 0 4,7,8,push_vlan(vid=12,pcp=0),1,5,6,100" \
1741 "3 0 0 pop_vlan,4,7,8,push_vlan(vid=12,pcp=0),1,5,6,100" \
1742 "3 0 1 8,pop_vlan,4,7,push_vlan(vid=12,pcp=1),1,5,6,100" \
1749 "4 none 0 3,7,8,push_vlan(vid=12,pcp=0),1,5,6,100" \
1750 "4 0 0 pop_vlan,3,7,8,push_vlan(vid=12,pcp=0),1,5,6,100" \
1751 "4 0 1 3,8,pop_vlan,7,push_vlan(vid=12,pcp=1),1,5,6,100" \
1758 "5 none 0 2,push_vlan(vid=10,pcp=0),1,6,7,8,100" \
1759 "5 0 0 pop_vlan,2,push_vlan(vid=10,pcp=0),1,6,7,8,100" \
1760 "5 0 1 pop_vlan,2,push_vlan(vid=10,pcp=1),1,6,7,8,100" \
1761 "5 10 0 1,6,7,8,100,pop_vlan,2" \
1762 "5 10 1 1,6,7,8,100,pop_vlan,2" \
1765 "5 12 0 1,6,100,pop_vlan,3,4,7,8" \
1766 "5 12 1 1,6,100,pop_vlan,4,7,push_vlan(vid=0,pcp=1),3,8" \
1767 "6 none 0 2,push_vlan(vid=10,pcp=0),1,5,7,8,100" \
1768 "6 0 0 pop_vlan,2,push_vlan(vid=10,pcp=0),1,5,7,8,100" \
1769 "6 0 1 pop_vlan,2,push_vlan(vid=10,pcp=1),1,5,7,8,100" \
1770 "6 10 0 1,5,7,8,100,pop_vlan,2" \
1771 "6 10 1 1,5,7,8,100,pop_vlan,2" \
1774 "6 12 0 1,5,100,pop_vlan,3,4,7,8" \
1775 "6 12 1 1,5,100,pop_vlan,4,7,push_vlan(vid=0,pcp=1),3,8" \
1776 "7 none 0 3,4,8,push_vlan(vid=12,pcp=0),1,5,6,100" \
1777 "7 0 0 pop_vlan,3,4,8,push_vlan(vid=12,pcp=0),1,5,6,100" \
1778 "7 0 1 3,8,pop_vlan,4,push_vlan(vid=12,pcp=1),1,5,6,100" \
1779 "7 10 0 1,5,6,8,100,pop_vlan,2" \
1780 "7 10 1 1,5,6,8,100,pop_vlan,2" \
1783 "7 12 0 1,5,6,100,pop_vlan,3,4,8" \
1784 "7 12 1 1,5,6,100,pop_vlan,4,push_vlan(vid=0,pcp=1),3,8" \
1785 "8 none 0 3,4,7,push_vlan(vid=12,pcp=0),1,5,6,100" \
1786 "8 0 0 pop_vlan,3,4,7,push_vlan(vid=12,pcp=0),1,5,6,100" \
1787 "8 0 1 3,pop_vlan,4,7,push_vlan(vid=12,pcp=1),1,5,6,100" \
1788 "8 10 0 1,5,6,7,100,pop_vlan,2" \
1789 "8 10 1 1,5,6,7,100,pop_vlan,2" \
1792 "8 12 0 1,5,6,100,pop_vlan,3,4,7" \
1793 "8 12 1 1,5,6,100,pop_vlan,4,7,push_vlan(vid=0,pcp=1),3"
1801 if test $vlan = none; then
1802 flow="in_port($in_port),eth(src=50:54:00:00:00:01,dst=ff:ff:ff:ff:ff:ff),eth_type(0xabcd)"
1804 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))"
1807 echo "----------------------------------------------------------------------"
1808 echo "in_port=$in_port vlan=$vlan pcp=$pcp"
1810 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
1811 actual=`tail -1 stdout | sed 's/Datapath actions: //'`
1813 AT_CHECK([ovs-dpctl normalize-actions "$flow" "$expected"], [0], [stdout])
1815 AT_CHECK([ovs-dpctl normalize-actions "$flow" "$actual"], [0], [expout])
1821 AT_SETUP([ofproto-dpif - MPLS handling])
1822 OVS_VSWITCHD_START([dnl
1823 add-port br0 p1 -- set Interface p1 type=dummy
1825 ON_EXIT([kill `cat ovs-ofctl.pid`])
1827 AT_CAPTURE_FILE([ofctl_monitor.log])
1828 AT_DATA([flows.txt], [dnl
1829 dl_src=40:44:44:44:00:00 actions=push_mpls:0x8847,controller
1830 dl_src=40:44:44:44:00:01,mpls actions=push_mpls:0x8847,controller
1831 dl_src=40:44:44:44:00:02,mpls actions=push_mpls:0x8848,controller
1833 AT_CHECK([ovs-ofctl --protocols=OpenFlow12 add-flows br0 flows.txt])
1835 dnl In this test, we push an MPLS tag to an ethernet packet.
1836 AT_CHECK([ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P nxm --detach --pidfile 2> ofctl_monitor.log])
1839 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)'
1841 OVS_WAIT_UNTIL([test `grep OFPT_PACKET_IN ofctl_monitor.log | wc -l` -ge 3])
1842 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1844 AT_CHECK([cat ofctl_monitor.log | ofctl_strip], [0], [dnl
1845 OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1846 mpls,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
1847 00000000 50 54 00 00 00 07 40 44-44 44 00 00 88 47 00 00
1848 00000010 01 40 45 00 00 28 00 00-00 00 40 06 f9 7c c0 a8
1849 00000020 00 01 c0 a8 00 02 00 00-00 00 00 00 00 00 00 00
1850 00000030 00 00 50 00 00 00 00 00-00 00 00 00 00 00 00 00
1852 OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1853 mpls,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
1854 00000000 50 54 00 00 00 07 40 44-44 44 00 00 88 47 00 00
1855 00000010 01 40 45 00 00 28 00 00-00 00 40 06 f9 7c c0 a8
1856 00000020 00 01 c0 a8 00 02 00 00-00 00 00 00 00 00 00 00
1857 00000030 00 00 50 00 00 00 00 00-00 00 00 00 00 00 00 00
1859 OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1860 mpls,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
1861 00000000 50 54 00 00 00 07 40 44-44 44 00 00 88 47 00 00
1862 00000010 01 40 45 00 00 28 00 00-00 00 40 06 f9 7c c0 a8
1863 00000020 00 01 c0 a8 00 02 00 00-00 00 00 00 00 00 00 00
1864 00000030 00 00 50 00 00 00 00 00-00 00 00 00 00 00 00 00
1867 dnl In this test, we push an MPLS tag to an MPLS packet. The LSE should be
1868 dnl copied exactly, except for the BOS bit.
1869 AT_CHECK([ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P nxm --detach --pidfile 2> ofctl_monitor.log])
1872 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)'
1874 OVS_WAIT_UNTIL([test `grep OFPT_PACKET_IN ofctl_monitor.log | wc -l` -ge 3])
1875 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1877 AT_CHECK([cat ofctl_monitor.log | ofctl_strip], [0], [dnl
1878 OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1879 mpls,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
1880 00000000 50 54 00 00 00 07 40 44-44 44 00 01 88 47 00 00
1881 00000010 a0 40 00 00 a1 40 00 00-00 00 00 00 00 00 00 00
1882 00000020 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00
1883 00000030 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00
1885 OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1886 mpls,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
1887 00000000 50 54 00 00 00 07 40 44-44 44 00 01 88 47 00 00
1888 00000010 a0 40 00 00 a1 40 00 00-00 00 00 00 00 00 00 00
1889 00000020 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00
1890 00000030 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00
1892 OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1893 mpls,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
1894 00000000 50 54 00 00 00 07 40 44-44 44 00 01 88 47 00 00
1895 00000010 a0 40 00 00 a1 40 00 00-00 00 00 00 00 00 00 00
1896 00000020 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00
1897 00000030 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00
1900 dnl In this test, we push an MPLS tag to an MPLS packet. The LSE should be
1901 dnl copied exactly, except for the BOS bit. The ethertype should be updated
1902 dnl to the MPLS ethertype of the MPLS push action which differs to that
1903 dnl of the input packet.
1904 AT_CHECK([ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P nxm --detach --pidfile 2> ofctl_monitor.log])
1907 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)'
1909 OVS_WAIT_UNTIL([test `grep OFPT_PACKET_IN ofctl_monitor.log | wc -l` -ge 3])
1910 OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
1912 AT_CHECK([cat ofctl_monitor.log | ofctl_strip], [0], [dnl
1913 OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1914 mplsm,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
1915 00000000 50 54 00 00 00 07 40 44-44 44 00 02 88 48 00 00
1916 00000010 a0 40 00 00 a1 40 00 00-00 00 00 00 00 00 00 00
1917 00000020 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00
1918 00000030 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00
1920 OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1921 mplsm,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
1922 00000000 50 54 00 00 00 07 40 44-44 44 00 02 88 48 00 00
1923 00000010 a0 40 00 00 a1 40 00 00-00 00 00 00 00 00 00 00
1924 00000020 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00
1925 00000030 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00
1927 OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
1928 mplsm,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
1929 00000000 50 54 00 00 00 07 40 44-44 44 00 02 88 48 00 00
1930 00000010 a0 40 00 00 a1 40 00 00-00 00 00 00 00 00 00 00
1931 00000020 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00
1932 00000030 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00
1938 AT_SETUP([ofproto-dpif - VLAN+MPLS handling])
1939 OVS_VSWITCHD_START([dnl
1940 add-port br0 p1 -- set Interface p1 type=dummy
1942 ON_EXIT([kill `cat ovs-ofctl.pid`])
1944 AT_CAPTURE_FILE([ofctl_monitor.log])
1945 AT_DATA([flows.txt], [dnl
1946 cookie=0xa dl_src=40:44:44:44:54:50 actions=push_mpls:0x8847,load:10->OXM_OF_MPLS_LABEL[[]],push_vlan:0x8100,set_vlan_vid:99,set_vlan_pcp:1,controller
1947 cookie=0xa dl_src=40:44:44:44:54:51 actions=push_mpls:0x8847,load:10->OXM_OF_MPLS_LABEL[[]],push_vlan:0x8100,set_vlan_vid:99,set_vlan_pcp:1,controller
1948 cookie=0xa dl_src=40:44:44:44:54:52 actions=push_mpls:0x8847,load:10->OXM_OF_MPLS_LABEL[[]],push_vlan:0x8100,load:99->OXM_OF_VLAN_VID[[]],set_vlan_pcp:1,controller
1949 cookie=0xa dl_src=40:44:44:44:54:53 actions=push_mpls:0x8847,load:10->OXM_OF_MPLS_LABEL[[]],push_vlan:0x8100,load:99->OXM_OF_VLAN_VID[[]],set_vlan_pcp:1,controller
1950 cookie=0xa dl_src=40:44:44:44:54:54 actions=push_vlan:0x8100,set_vlan_vid:99,set_vlan_pcp:1,push_mpls:0x8847,load:10->OXM_OF_MPLS_LABEL[[]],controller
1951 cookie=0xa dl_src=40:44:44:44:54:55 actions=push_vlan:0x8100,set_vlan_vid:99,set_vlan_pcp:1,push_mpls:0x8847,load:10->OXM_OF_MPLS_LABEL[[]],controller
1952 cookie=0xa dl_src=40:44:44:44:54:56 actions=push_vlan:0x8100,load:99->OXM_OF_VLAN_VID[[]],set_vlan_pcp:1,push_mpls:0x8847,load:10->OXM_OF_MPLS_LABEL[[]],controller
1953 cookie=0xa dl_src=40:44:44:44:54:57 actions=push_vlan:0x8100,load:99->OXM_OF_VLAN_VID[[]],set_vlan_pcp:1,push_mpls:0x8847,load:10->OXM_OF_MPLS_LABEL[[]],controller
1954 cookie=0xa dl_src=40:44:44:44:54:58,vlan_tci=0x1000/0x1000 actions=load:99->OXM_OF_VLAN_VID[[]],set_vlan_pcp:1,push_mpls:0x8847,load:10->OXM_OF_MPLS_LABEL[[]],controller
1955 cookie=0xa dl_src=40:44:44:44:54:59,vlan_tci=0x1000/0x1000 actions=push_mpls:0x8847,load:10->OXM_OF_MPLS_LABEL[[]],set_vlan_pcp:1,load:99->OXM_OF_VLAN_VID[[]],controller
1957 AT_CHECK([ovs-ofctl --protocols=OpenFlow12 add-flows br0 flows.txt])
1959 dnl Modified MPLS controller action.
1960 dnl In this test, we push the MPLS tag before pushing a VLAN tag, so we see
1961 dnl both of these in the final flow
1962 AT_CHECK([ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P nxm --detach --pidfile 2> ofctl_monitor.log])
1965 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)'
1967 OVS_WAIT_UNTIL([test `grep OFPT_PACKET_IN ofctl_monitor.log | wc -l` -ge 3])
1968 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
1970 AT_CHECK([cat ofctl_monitor.log | ofctl_strip], [0], [dnl
1971 OFPT_PACKET_IN (OF1.2): total_len=68 in_port=1 (via action) data_len=68 (unbuffered)
1972 mpls,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
1973 00000000 50 54 00 00 00 07 40 44-44 44 54 50 81 00 20 63
1974 00000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
1975 00000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
1976 00000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
1977 00000040 00 00 00 00
1979 OFPT_PACKET_IN (OF1.2): total_len=68 in_port=1 (via action) data_len=68 (unbuffered)
1980 mpls,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
1981 00000000 50 54 00 00 00 07 40 44-44 44 54 50 81 00 20 63
1982 00000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
1983 00000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
1984 00000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
1985 00000040 00 00 00 00
1987 OFPT_PACKET_IN (OF1.2): total_len=68 in_port=1 (via action) data_len=68 (unbuffered)
1988 mpls,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
1989 00000000 50 54 00 00 00 07 40 44-44 44 54 50 81 00 20 63
1990 00000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
1991 00000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
1992 00000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
1993 00000040 00 00 00 00
1996 dnl Modified MPLS controller action.
1997 dnl In this test, the input packet in vlan-tagged, which should be stripped
1998 dnl before we push the MPLS and VLAN tags.
1999 AT_CHECK([ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P nxm --detach --pidfile 2> ofctl_monitor.log])
2002 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))'
2004 OVS_WAIT_UNTIL([test `grep OFPT_PACKET_IN ofctl_monitor.log | wc -l` -ge 3])
2005 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2007 AT_CHECK([cat ofctl_monitor.log | ofctl_strip], [0], [dnl
2008 OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
2009 mpls,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
2010 00000000 50 54 00 00 00 07 40 44-44 44 54 51 81 00 20 63
2011 00000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
2012 00000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
2013 00000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
2015 OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
2016 mpls,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
2017 00000000 50 54 00 00 00 07 40 44-44 44 54 51 81 00 20 63
2018 00000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
2019 00000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
2020 00000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
2022 OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
2023 mpls,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
2024 00000000 50 54 00 00 00 07 40 44-44 44 54 51 81 00 20 63
2025 00000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
2026 00000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
2027 00000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
2030 dnl Modified MPLS controller action.
2031 dnl In this test, we push the MPLS tag before pushing a VLAN tag, so we see
2032 dnl both of these in the final flow
2033 AT_CHECK([ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P nxm --detach --pidfile 2> ofctl_monitor.log])
2036 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)'
2038 OVS_WAIT_UNTIL([test `grep OFPT_PACKET_IN ofctl_monitor.log | wc -l` -ge 3])
2039 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2041 AT_CHECK([cat ofctl_monitor.log | ofctl_strip], [0], [dnl
2042 OFPT_PACKET_IN (OF1.2): total_len=68 in_port=1 (via action) data_len=68 (unbuffered)
2043 mpls,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
2044 00000000 52 54 00 00 00 07 40 44-44 44 54 52 81 00 20 63
2045 00000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
2046 00000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
2047 00000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
2048 00000040 00 00 00 00
2050 OFPT_PACKET_IN (OF1.2): total_len=68 in_port=1 (via action) data_len=68 (unbuffered)
2051 mpls,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
2052 00000000 52 54 00 00 00 07 40 44-44 44 54 52 81 00 20 63
2053 00000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
2054 00000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
2055 00000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
2056 00000040 00 00 00 00
2058 OFPT_PACKET_IN (OF1.2): total_len=68 in_port=1 (via action) data_len=68 (unbuffered)
2059 mpls,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
2060 00000000 52 54 00 00 00 07 40 44-44 44 54 52 81 00 20 63
2061 00000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
2062 00000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
2063 00000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
2064 00000040 00 00 00 00
2067 dnl Modified MPLS controller action.
2068 dnl In this test, the input packet in vlan-tagged, which should be stripped
2069 dnl before we push the MPLS and VLAN tags.
2070 AT_CHECK([ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P nxm --detach --pidfile 2> ofctl_monitor.log])
2073 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))'
2075 OVS_WAIT_UNTIL([test `grep OFPT_PACKET_IN ofctl_monitor.log | wc -l` -ge 3])
2076 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2078 AT_CHECK([cat ofctl_monitor.log | ofctl_strip], [0], [dnl
2079 OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
2080 mpls,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
2081 00000000 50 54 00 00 00 07 40 44-44 44 54 53 81 00 20 63
2082 00000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
2083 00000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
2084 00000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
2086 OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
2087 mpls,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
2088 00000000 50 54 00 00 00 07 40 44-44 44 54 53 81 00 20 63
2089 00000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
2090 00000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
2091 00000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
2093 OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
2094 mpls,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
2095 00000000 50 54 00 00 00 07 40 44-44 44 54 53 81 00 20 63
2096 00000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
2097 00000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
2098 00000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
2101 dnl Modified MPLS controller action.
2102 dnl In this test, we push the VLAN tag before pushing a MPLS tag, but these
2103 dnl actions are reordered, so we see both of these in the final flow.
2104 AT_CHECK([ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P nxm --detach --pidfile 2> ofctl_monitor.log])
2107 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)'
2109 OVS_WAIT_UNTIL([test `grep OFPT_PACKET_IN ofctl_monitor.log | wc -l` -ge 3])
2110 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2112 AT_CHECK([cat ofctl_monitor.log | ofctl_strip], [0], [dnl
2113 OFPT_PACKET_IN (OF1.2): total_len=68 in_port=1 (via action) data_len=68 (unbuffered)
2114 mpls,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
2115 00000000 50 54 00 00 00 07 40 44-44 44 54 54 81 00 20 63
2116 00000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
2117 00000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
2118 00000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
2119 00000040 00 00 00 00
2121 OFPT_PACKET_IN (OF1.2): total_len=68 in_port=1 (via action) data_len=68 (unbuffered)
2122 mpls,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
2123 00000000 50 54 00 00 00 07 40 44-44 44 54 54 81 00 20 63
2124 00000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
2125 00000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
2126 00000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
2127 00000040 00 00 00 00
2129 OFPT_PACKET_IN (OF1.2): total_len=68 in_port=1 (via action) data_len=68 (unbuffered)
2130 mpls,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
2131 00000000 50 54 00 00 00 07 40 44-44 44 54 54 81 00 20 63
2132 00000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
2133 00000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
2134 00000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
2135 00000040 00 00 00 00
2138 dnl Modified MPLS controller action.
2139 dnl In this test, the input packet in vlan-tagged, which should be stripped
2140 dnl before we push the MPLS and VLAN tags.
2141 AT_CHECK([ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P nxm --detach --pidfile 2> ofctl_monitor.log])
2144 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))'
2146 OVS_WAIT_UNTIL([test `grep OFPT_PACKET_IN ofctl_monitor.log | wc -l` -ge 3])
2147 OVS_APP_EXIT_AND_WAIT([ovs-ofctl])
2149 AT_CHECK([cat ofctl_monitor.log | ofctl_strip], [0], [dnl
2150 OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
2151 mpls,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
2152 00000000 50 54 00 00 00 07 40 44-44 44 54 55 81 00 20 63
2153 00000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
2154 00000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
2155 00000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
2157 OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
2158 mpls,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
2159 00000000 50 54 00 00 00 07 40 44-44 44 54 55 81 00 20 63
2160 00000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
2161 00000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
2162 00000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
2164 OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
2165 mpls,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
2166 00000000 50 54 00 00 00 07 40 44-44 44 54 55 81 00 20 63
2167 00000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
2168 00000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
2169 00000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
2172 dnl Modified MPLS controller action.
2173 dnl In this test, we push the VLAN tag before pushing a MPLS tag, but these
2174 dnl actions are reordered, so we see both of these in the final flow.
2175 AT_CHECK([ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P nxm --detach --pidfile 2> ofctl_monitor.log])
2178 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)'
2180 OVS_WAIT_UNTIL([test `grep OFPT_PACKET_IN ofctl_monitor.log | wc -l` -ge 3])
2181 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2183 AT_CHECK([cat ofctl_monitor.log | ofctl_strip], [0], [dnl
2184 OFPT_PACKET_IN (OF1.2): total_len=68 in_port=1 (via action) data_len=68 (unbuffered)
2185 mpls,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
2186 00000000 50 54 00 00 00 07 40 44-44 44 54 56 81 00 20 63
2187 00000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
2188 00000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
2189 00000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
2190 00000040 00 00 00 00
2192 OFPT_PACKET_IN (OF1.2): total_len=68 in_port=1 (via action) data_len=68 (unbuffered)
2193 mpls,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
2194 00000000 50 54 00 00 00 07 40 44-44 44 54 56 81 00 20 63
2195 00000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
2196 00000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
2197 00000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
2198 00000040 00 00 00 00
2200 OFPT_PACKET_IN (OF1.2): total_len=68 in_port=1 (via action) data_len=68 (unbuffered)
2201 mpls,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
2202 00000000 50 54 00 00 00 07 40 44-44 44 54 56 81 00 20 63
2203 00000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
2204 00000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
2205 00000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
2206 00000040 00 00 00 00
2209 dnl Modified MPLS controller action.
2210 dnl In this test, the input packet in vlan-tagged, which should be stripped
2211 dnl before we push the MPLS and VLAN tags.
2212 AT_CHECK([ovs-ofctl --protocols=OpenFlow12 monitor br0 -m 65534 -P nxm --detach --pidfile 2> ofctl_monitor.log])
2215 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))'
2217 OVS_WAIT_UNTIL([test `grep OFPT_PACKET_IN ofctl_monitor.log | wc -l` -ge 3])
2218 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2220 AT_CHECK([cat ofctl_monitor.log | ofctl_strip], [0], [dnl
2221 OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
2222 mpls,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
2223 00000000 50 54 00 00 00 07 40 44-44 44 54 57 81 00 20 63
2224 00000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
2225 00000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
2226 00000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
2228 OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
2229 mpls,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
2230 00000000 50 54 00 00 00 07 40 44-44 44 54 57 81 00 20 63
2231 00000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
2232 00000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
2233 00000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
2235 OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
2236 mpls,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
2237 00000000 50 54 00 00 00 07 40 44-44 44 54 57 81 00 20 63
2238 00000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
2239 00000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
2240 00000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
2243 dnl Modified MPLS controller action.
2244 dnl In this test, the input packet in vlan-tagged, which should be stripped
2245 dnl before we push the MPLS and VLAN tags.
2246 AT_CHECK([ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P nxm --detach --pidfile 2> ofctl_monitor.log])
2249 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))'
2251 OVS_WAIT_UNTIL([test `grep OFPT_PACKET_IN ofctl_monitor.log | wc -l` -ge 3])
2252 OVS_APP_EXIT_AND_WAIT(ovs-ofctl)
2254 AT_CHECK([cat ofctl_monitor.log | ofctl_strip], [0], [dnl
2255 OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
2256 mpls,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
2257 00000000 50 54 00 00 00 07 40 44-44 44 54 58 81 00 20 63
2258 00000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
2259 00000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
2260 00000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
2262 OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
2263 mpls,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
2264 00000000 50 54 00 00 00 07 40 44-44 44 54 58 81 00 20 63
2265 00000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
2266 00000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
2267 00000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
2269 OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
2270 mpls,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
2271 00000000 50 54 00 00 00 07 40 44-44 44 54 58 81 00 20 63
2272 00000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
2273 00000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
2274 00000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
2277 dnl Modified MPLS controller action.
2278 dnl In this test, the input packet in vlan-tagged, which should be modified
2279 dnl before we push MPLS and VLAN tags.
2280 AT_CHECK([ovs-ofctl --protocols=OpenFlow12 monitor br0 65534 -m -P nxm --detach --pidfile 2> ofctl_monitor.log])
2283 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))'
2285 OVS_WAIT_UNTIL([test `grep OFPT_PACKET_IN ofctl_monitor.log | wc -l` -ge 3])
2286 ovs-appctl -t ovs-ofctl exit
2288 AT_CHECK([cat ofctl_monitor.log | ofctl_strip], [0], [dnl
2289 OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
2290 mpls,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
2291 00000000 50 54 00 00 00 07 40 44-44 44 54 59 81 00 20 63
2292 00000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
2293 00000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
2294 00000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
2296 OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
2297 mpls,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
2298 00000000 50 54 00 00 00 07 40 44-44 44 54 59 81 00 20 63
2299 00000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
2300 00000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
2301 00000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
2303 OFPT_PACKET_IN (OF1.2): total_len=64 in_port=1 (via action) data_len=64 (unbuffered)
2304 mpls,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
2305 00000000 50 54 00 00 00 07 40 44-44 44 54 59 81 00 20 63
2306 00000010 88 47 00 00 a1 40 45 00-00 28 00 00 00 00 40 06
2307 00000020 f9 7c c0 a8 00 01 c0 a8-00 02 00 00 00 00 00 00
2308 00000030 00 00 00 00 00 00 50 00-00 00 00 00 00 00 00 00
2311 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
2312 AT_CHECK([ovs-ofctl --protocols=OpenFlow12 dump-flows br0 | ofctl_strip | sort], [0], [dnl
2313 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
2314 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
2315 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
2316 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
2317 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
2318 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
2319 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
2320 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
2321 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
2322 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
2323 OFPST_FLOW reply (OF1.2):
2329 AT_SETUP([ofproto-dpif - fragment handling])
2331 ADD_OF_PORTS([br0], [1], [2], [3], [4], [5], [6], [90])
2332 AT_DATA([flows.txt], [dnl
2333 priority=75 tcp ip_frag=no tp_dst=80 actions=output:1
2334 priority=75 tcp ip_frag=first tp_dst=80 actions=output:2
2335 priority=75 tcp ip_frag=later tp_dst=80 actions=output:3
2336 priority=50 tcp ip_frag=no actions=output:4
2337 priority=50 tcp ip_frag=first actions=output:5
2338 priority=50 tcp ip_frag=later actions=output:6
2340 AT_CHECK([ovs-ofctl replace-flows br0 flows.txt])
2342 base_flow="in_port(90),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=6,tos=0,ttl=128"
2343 no_flow="$base_flow,frag=no),tcp(src=12345,dst=80)"
2344 first_flow="$base_flow,frag=first),tcp(src=12345,dst=80)"
2345 later_flow="$base_flow,frag=later)"
2347 # mode no first later
2350 'drop 1 drop drop' \
2359 AT_CHECK([ovs-ofctl set-frags br0 $mode])
2360 for type in no first later; do
2361 eval flow=\$${type}_flow exp_output=\$$type
2362 printf "\n%s\n" "----$mode $type-----"
2363 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
2365 if test $mode = drop && test $type != no; then
2366 echo 'Packets dropped because they are IP fragments and the fragment handling mode is "drop".' >> expout
2368 echo "Datapath actions: $exp_output" >> expout
2369 AT_CHECK([grep 'IP fragments' stdout; tail -1 stdout], [0], [expout])
2375 AT_SETUP([ofproto-dpif - exit])
2377 ADD_OF_PORTS([br0], [1], [2], [3], [10], [11], [12], [13], [14])
2378 AT_DATA([flows.txt], [dnl
2379 in_port=1 actions=output:10,exit,output:11
2380 in_port=2 actions=output:12,resubmit:1,output:12
2381 in_port=3 actions=output:13,resubmit:2,output:14
2383 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
2384 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)'], [0], [stdout])
2385 AT_CHECK([tail -1 stdout], [0],
2386 [Datapath actions: 10
2388 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(2),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)'], [0], [stdout])
2389 AT_CHECK([tail -1 stdout], [0],
2390 [Datapath actions: 12,10
2392 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy 'in_port(3),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)'], [0], [stdout])
2393 AT_CHECK([tail -1 stdout], [0],
2394 [Datapath actions: 13,12,10
2400 AT_SETUP([ofproto-dpif - mirroring, select_all])
2402 ADD_OF_PORTS([br0], 1, 2, 3)
2404 set Bridge br0 mirrors=@m --\
2405 --id=@p3 get Port p3 --\
2406 --id=@m create Mirror name=mymirror select_all=true output_port=@p3
2408 AT_DATA([flows.txt], [dnl
2409 in_port=1 actions=output:2
2410 in_port=2 actions=output:1
2412 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
2414 flow="in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)"
2415 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
2416 AT_CHECK_UNQUOTED([tail -1 stdout], [0],
2417 [Datapath actions: 2,3
2420 flow="in_port(2),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)"
2421 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
2422 AT_CHECK_UNQUOTED([tail -1 stdout], [0],
2423 [Datapath actions: 1,3
2430 AT_SETUP([ofproto-dpif - mirroring, select_src])
2432 ADD_OF_PORTS([br0], 1, 2, 3)
2434 set Bridge br0 mirrors=@m --\
2435 --id=@p1 get Port p1 -- --id=@p3 get Port p3 --\
2436 --id=@m create Mirror name=mymirror select_src_port=@p1 output_port=@p3
2438 AT_DATA([flows.txt], [dnl
2439 in_port=1 actions=output:2
2440 in_port=2 actions=output:1
2442 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
2444 flow="in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)"
2445 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
2446 AT_CHECK_UNQUOTED([tail -1 stdout], [0],
2447 [Datapath actions: 2,3
2450 flow="in_port(2),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)"
2451 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
2452 AT_CHECK_UNQUOTED([tail -1 stdout], [0],
2453 [Datapath actions: 1
2458 AT_SETUP([ofproto-dpif - mirroring, OFPP_NONE ingress port])
2460 ADD_OF_PORTS([br0], 1, 2)
2462 set Bridge br0 mirrors=@m --\
2463 --id=@p2 get Port p2 --\
2464 --id=@m create Mirror name=mymirror select_all=true output_port=@p2
2466 AT_CHECK([ovs-ofctl add-flow br0 action=output:1])
2468 # "in_port" defaults to OFPP_NONE if it's not specified.
2469 flow="icmp,dl_src=50:54:00:00:00:05,dl_dst=50:54:00:00:00:07,nw_src=192.168.0.1,nw_dst=192.168.0.2,nw_ttl=128,icmp_type=8,icmp_code=0"
2470 AT_CHECK([ovs-appctl ofproto/trace br0 "$flow"], [0], [stdout])
2471 AT_CHECK_UNQUOTED([tail -1 stdout], [0],
2472 [Datapath actions: 1,2
2479 AT_SETUP([ofproto-dpif - mirroring, select_dst])
2481 ADD_OF_PORTS([br0], 1, 2, 3)
2483 set Bridge br0 mirrors=@m --\
2484 --id=@p2 get Port p2 -- --id=@p3 get Port p3 --\
2485 --id=@m create Mirror name=mymirror select_dst_port=@p2 output_port=@p3
2487 AT_DATA([flows.txt], [dnl
2488 in_port=1 actions=output:2
2489 in_port=2 actions=output:1
2491 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
2493 flow="in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)"
2494 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
2495 AT_CHECK_UNQUOTED([tail -1 stdout], [0],
2496 [Datapath actions: 2,3
2499 flow="in_port(2),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)"
2500 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
2501 AT_CHECK_UNQUOTED([tail -1 stdout], [0],
2502 [Datapath actions: 1
2509 AT_SETUP([ofproto-dpif - mirroring, select_vlan])
2511 ADD_OF_PORTS([br0], 1, 2, 3)
2513 set Bridge br0 mirrors=@m --\
2514 --id=@p2 get Port p2 -- --id=@p3 get Port p3 --\
2515 --id=@m create Mirror name=mymirror select_all=true select_vlan=11 output_port=@p3
2517 AT_DATA([flows.txt], [dnl
2518 in_port=1, actions=output:2
2520 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
2522 flow="in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)"
2523 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
2524 AT_CHECK_UNQUOTED([tail -1 stdout], [0],
2525 [Datapath actions: 2
2528 flow="in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x8100),vlan(vid=10,pcp=0),encap(eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0))"
2529 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
2530 AT_CHECK_UNQUOTED([tail -1 stdout], [0],
2531 [Datapath actions: 2
2534 flow="in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x8100),vlan(vid=11,pcp=0),encap(eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0))"
2535 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
2536 AT_CHECK_UNQUOTED([tail -1 stdout], [0],
2537 [Datapath actions: 2,3
2544 AT_SETUP([ofproto-dpif - mirroring, output_port])
2546 ADD_OF_PORTS([br0], 1, 2, 3)
2548 set Bridge br0 mirrors=@m --\
2549 --id=@p3 get Port p3 --\
2550 --id=@m create Mirror name=mymirror select_all=true output_port=@p3
2552 AT_DATA([flows.txt], [dnl
2553 in_port=1 actions=mod_vlan_vid:17,output:2
2554 in_port=2 actions=output:1
2556 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
2558 flow="in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)"
2559 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
2560 AT_CHECK_UNQUOTED([tail -1 stdout], [0],
2561 [Datapath actions: push_vlan(vid=17,pcp=0),2,pop_vlan,3
2564 flow="in_port(2),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)"
2565 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
2566 AT_CHECK_UNQUOTED([tail -1 stdout], [0],
2567 [Datapath actions: 1,3
2573 AT_SETUP([ofproto-dpif - mirroring, output_vlan])
2575 ADD_OF_PORTS([br0], 1, 2)
2577 set Bridge br0 mirrors=@m --\
2578 --id=@m create Mirror name=mymirror select_all=true output_vlan=12
2580 AT_DATA([flows.txt], [dnl
2581 in_port=1 actions=output:2
2582 in_port=2 actions=mod_vlan_vid:17,output:1
2584 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
2586 flow="in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)"
2587 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
2588 actual=`tail -1 stdout | sed 's/Datapath actions: //'`
2590 expected="2,push_vlan(vid=12,pcp=0),1,2,100"
2591 AT_CHECK([ovs-dpctl normalize-actions "$flow" "$expected"], [0], [stdout])
2593 AT_CHECK([ovs-dpctl normalize-actions "$flow" "$actual"], [0], [expout])
2595 flow="in_port(2),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=128,frag=no),icmp(type=8,code=0)"
2596 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$flow"], [0], [stdout])
2597 actual=`tail -1 stdout | sed 's/Datapath actions: //'`
2599 expected="push_vlan(vid=17,pcp=0),1,pop_vlan,push_vlan(vid=12,pcp=0),1,2,100"
2600 AT_CHECK([ovs-dpctl normalize-actions "$flow" "$expected"], [0], [stdout])
2602 AT_CHECK([ovs-dpctl normalize-actions "$flow" "$actual"], [0], [expout])
2607 # Two testcases below are for the ofproto/trace command
2608 # The first one tests all correct syntax:
2609 # ofproto/trace [dp_name] odp_flow [-generate|packet]
2610 # ofproto/trace br_name br_flow [-generate|packet]
2611 AT_SETUP([ofproto-dpif - ofproto/trace command 1])
2612 OVS_VSWITCHD_START([set bridge br0 fail-mode=standalone])
2613 ADD_OF_PORTS([br0], 1, 2, 3)
2615 AT_DATA([flows.txt], [dnl
2616 in_port=1 actions=output:2
2617 in_port=2 actions=output:1
2619 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
2621 odp_flow="in_port(1)"
2623 # Test command: ofproto/trace odp_flow with in_port as a name.
2624 AT_CHECK([ovs-appctl ofproto/trace "$odp_flow"], [0], [stdout])
2625 AT_CHECK([tail -1 stdout], [0], [dnl
2629 odp_flow="in_port(1)"
2630 # Test command: ofproto/trace odp_flow
2631 AT_CHECK([ovs-appctl ofproto/trace "$odp_flow"], [0], [stdout])
2632 AT_CHECK([tail -1 stdout], [0], [dnl
2636 # Test command: ofproto/trace dp_name odp_flow
2637 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$odp_flow"], [0], [stdout])
2638 AT_CHECK([tail -1 stdout], [0], [dnl
2641 # Test commmand: ofproto/trace br_name br_flow
2642 AT_CHECK([ovs-appctl ofproto/trace br0 "$br_flow"], [0], [stdout])
2643 AT_CHECK([tail -1 stdout], [0], [dnl
2647 # Delete the inserted flows
2648 AT_CHECK([ovs-ofctl del-flows br0 "in_port=1"], [0], [stdout])
2649 AT_CHECK([ovs-ofctl del-flows br0 "in_port=2"], [0], [stdout])
2651 # This section beflow tests the [-generate] option
2652 odp_flow="in_port(3),eth(src=50:54:00:00:00:05,dst=ff:ff:ff:ff:ff:ff)"
2653 br_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"
2655 # Test command: ofproto/trace odp_flow
2656 AT_CHECK([ovs-appctl ofproto/trace "$odp_flow"], [0], [stdout])
2657 # Check for no MAC learning entry
2658 AT_CHECK_UNQUOTED([ovs-appctl fdb/show br0 | sed 's/[[0-9]]\{1,\}$/?/'], [0], [dnl
2662 # Test command: ofproto/trace br_name br_flow
2663 AT_CHECK([ovs-appctl ofproto/trace br0 "$br_flow"], [0], [stdout])
2664 # Check for no MAC learning entry
2665 AT_CHECK_UNQUOTED([ovs-appctl fdb/show br0 | sed 's/[[0-9]]\{1,\}$/?/'], [0], [dnl
2669 # Test command: ofproto/trace odp_flow -generate
2670 AT_CHECK([ovs-appctl ofproto/trace "$odp_flow" -generate], [0], [stdout])
2671 # Check for the MAC learning entry
2672 AT_CHECK_UNQUOTED([ovs-appctl fdb/show br0 | sed 's/[[0-9]]\{1,\}$/?/'], [0], [dnl
2674 3 0 50:54:00:00:00:05 ?
2677 # Test command: ofproto/trace dp_name odp_flow -generate
2678 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy \
2679 "in_port(1),eth(src=50:54:00:00:00:06,dst=50:54:00:00:00:05)" \
2680 -generate], [0], [stdout])
2681 # Check for both MAC learning entries
2682 AT_CHECK_UNQUOTED([ovs-appctl fdb/show br0 | sed 's/[[0-9]]\{1,\}$/?/'], [0], [dnl
2684 3 0 50:54:00:00:00:05 ?
2685 1 0 50:54:00:00:00:06 ?
2688 # Test command: ofproto/trace br_name br_flow -generate
2689 AT_CHECK([ovs-appctl ofproto/trace br0 \
2690 "in_port=2,dl_src=50:54:00:00:00:07,dl_dst=50:54:00:00:00:06" \
2691 -generate], [0], [stdout])
2692 # Check for both MAC learning entries.
2693 AT_CHECK_UNQUOTED([ovs-appctl fdb/show br0 | sed 's/[[0-9]]\{1,\}$/?/'], [0], [dnl
2695 3 0 50:54:00:00:00:05 ?
2696 1 0 50:54:00:00:00:06 ?
2697 2 0 50:54:00:00:00:07 ?
2700 # This section beflow tests the [packet] option
2701 # The ovs-tcpundump of packets between port1 and port2
2702 pkt1to2="50540000000250540000000108064500001C000100004001F98CC0A80001C0A800020800F7FF00000000"
2703 pkt2to1="50540000000150540000000208064500001C000100004001F98CC0A80002C0A800010800F7FF00000000"
2705 # Construct the MAC learning table
2706 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy \
2707 "in_port(1),eth(src=50:54:00:00:00:01,dst=ff:ff:ff:ff:ff:ff)" \
2708 -generate], [0], [stdout])
2710 # Construct the MAC learning table
2711 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy \
2712 "in_port(2),eth(src=50:54:00:00:00:02,dst=ff:ff:ff:ff:ff:ff)" \
2713 -generate], [0], [stdout])
2715 # Test command: ofproto/trace odp_flow packet
2716 AT_CHECK([ovs-appctl ofproto/trace \
2717 "in_port(1),skb_priority(1),skb_mark(2)" "$pkt1to2"], [0], [stdout])
2718 AT_CHECK([tail -1 stdout], [0], [dnl
2721 AT_CHECK([head -n 2 stdout], [0], [dnl
2723 Flow: 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
2726 # Test command: ofproto/trace dp_name odp_flow packet
2727 AT_CHECK([ovs-appctl ofproto/trace ovs-dummy \
2728 "in_port(1),skb_priority(1),skb_mark(2)" "$pkt1to2"], [0], [stdout])
2729 AT_CHECK([tail -1 stdout], [0], [dnl
2732 AT_CHECK([head -n 2 stdout], [0], [dnl
2734 Flow: 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
2737 # Test command: ofproto/trace br_name br_flow packet
2738 AT_CHECK([ovs-appctl ofproto/trace br0 \
2739 "in_port=2,skb_priority=2,pkt_mark=1" "$pkt2to1"], [0], [stdout],[stderr])
2740 AT_CHECK([tail -1 stdout], [0], [dnl
2743 AT_CHECK([head -n 2 stdout], [0], [dnl
2745 Flow: 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
2751 # The second test tests the corner cases
2752 AT_SETUP([ofproto-dpif - ofproto/trace command 2])
2754 ADD_OF_PORTS([br0], 1, 2)
2757 odp_flow="in_port(1),eth(src=50:54:00:00:00:01,dst=50:54:00:00:00:02)"
2758 br_flow="in_port=1,dl_src=50:54:00:00:00:01,dl_dst=50:54:00:00:00:02"
2760 generate="-generate"
2761 pkt="50540000000250540000000108064500001C000100004001F98CC0A80001C0A800020800F7FF00000000"
2763 # Test incorrect command: ofproto/trace wrong_name odp_flow [-generate|packet]
2769 [AT_CHECK([ovs-appctl ofproto/trace wrong_name "$odp_flow" option],
2771 AT_CHECK([tail -2 stderr], [0], [dnl
2772 Cannot find the datapath
2773 ovs-appctl: ovs-vswitchd: server returned an error
2776 # Test incorrect command: ofproto/trace empty_string odp_flow [-generate|packet]
2782 [AT_CHECK([ovs-appctl ofproto/trace "" "$odp_flow" option],
2784 AT_CHECK([tail -2 stderr], [0], [dnl
2785 Cannot find the datapath
2786 ovs-appctl: ovs-vswitchd: server returned an error
2789 # Test incorrect command: ofproto/trace nonexist_dp_name odp_flow [-generate|packet]
2795 [AT_CHECK([ovs-appctl ofproto/trace ovs-system "$odp_flow" option],
2797 AT_CHECK([tail -2 stderr], [0], [dnl
2798 Cannot find the datapath
2799 ovs-appctl: ovs-vswitchd: server returned an error
2802 # Test incorrect command: ofproto/trace br_name odp_flow [-generate|packet]
2808 [AT_CHECK([ovs-appctl ofproto/trace br0 "$odp_flow" option],
2810 AT_CHECK([tail -2 stderr], [0], [dnl
2811 Cannot find the datapath
2812 ovs-appctl: ovs-vswitchd: server returned an error
2815 # Test incorrect command: ofproto/trace dp_name br_flow [-generate|packet]
2821 [AT_CHECK([ovs-appctl ofproto/trace ovs-dummy "$br_flow" option],
2823 AT_CHECK([tail -2 stderr], [0], [dnl
2825 ovs-appctl: ovs-vswitchd: server returned an error
2828 # Test incorrect command: ofproto/trace br_flow [-generate|packet]
2834 [AT_CHECK([ovs-appctl ofproto/trace "$br_flow" option],
2836 AT_CHECK([tail -2 stderr], [0], [dnl
2837 Must specify bridge name
2838 ovs-appctl: ovs-vswitchd: server returned an error
2841 # Test incorrect command: ofproto/trace dp_name odp_flow garbage_option
2842 AT_CHECK([ovs-appctl ofproto/trace \
2843 ovs-dummy "$odp_flow" garbage_option],
2844 [2], [stdout],[stderr])
2845 AT_CHECK([tail -2 stderr], [0], [dnl
2846 Trailing garbage in packet data
2847 ovs-appctl: ovs-vswitchd: server returned an error
2850 # Test incorrect command: ofproto/trace with 4 arguments
2851 AT_CHECK([ovs-appctl ofproto/trace \
2852 arg1, arg2, arg3, arg4], [2], [stdout],[stderr])
2853 AT_CHECK([tail -2 stderr], [0], [dnl
2854 "ofproto/trace" command takes at most 3 arguments
2855 ovs-appctl: ovs-vswitchd: server returned an error
2858 # Test incorrect command: ofproto/trace with 0 argument
2859 AT_CHECK([ovs-appctl ofproto/trace ], [2], [stdout],[stderr])
2860 AT_CHECK([tail -2 stderr], [0], [dnl
2861 "ofproto/trace" command requires at least 1 arguments
2862 ovs-appctl: ovs-vswitchd: server returned an error
2868 AT_SETUP([ofproto-dpif - ofproto/trace-packet-out])
2870 ADD_OF_PORTS([br0], 1, 2, 3)
2872 AT_DATA([flows.txt], [dnl
2873 in_port=1 actions=output:2
2874 in_port=2 actions=output:1
2876 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
2878 AT_CHECK([ovs-appctl ofproto/trace-packet-out br0 in_port=1 'mod_vlan_vid:123,resubmit(,0)'], [0], [stdout])
2879 AT_CHECK([tail -1 stdout], [0], [dnl
2880 Datapath actions: push_vlan(vid=123,pcp=0),2
2887 m4_define([OFPROTO_TRACE],
2889 AT_CHECK([ovs-appctl ofproto/trace $1 "$flow" $3], [0], [stdout])
2890 actual=`tail -1 stdout | sed 's/Datapath actions: //'`
2892 AT_CHECK([ovs-dpctl normalize-actions "$flow" "$expected" $5],
2895 AT_CHECK([ovs-dpctl normalize-actions "$flow" "$actual" $5],
2898 AT_SETUP([ofproto-dpif - MAC learning])
2899 OVS_VSWITCHD_START([set bridge br0 fail-mode=standalone])
2900 ADD_OF_PORTS([br0], 1, 2, 3)
2902 arp='eth_type(0x0806),arp(sip=192.168.0.1,tip=192.168.0.2,op=1,sha=50:54:00:00:00:05,tha=00:00:00:00:00:00)'
2904 # Trace an ARP packet arriving on p3, to create a MAC learning entry.
2907 [in_port(3),eth(src=50:54:00:00:00:05,dst=ff:ff:ff:ff:ff:ff),$arp],
2911 # Check for the MAC learning entry.
2912 AT_CHECK_UNQUOTED([ovs-appctl fdb/show br0 | sed 's/[[0-9]]\{1,\}$/?/'], [0], [dnl
2914 3 0 50:54:00:00:00:05 ?
2917 # Trace a packet arrival destined for the learned MAC.
2918 # (This will also learn a MAC.)
2921 [in_port(1),eth(src=50:54:00:00:00:06,dst=50:54:00:00:00:05),$arp],
2925 # Check for both MAC learning entries.
2926 AT_CHECK_UNQUOTED([ovs-appctl fdb/show br0 | sed 's/[[0-9]]\{1,\}$/?/'], [0], [dnl
2928 3 0 50:54:00:00:00:05 ?
2929 1 0 50:54:00:00:00:06 ?
2932 # Trace a packet arrival that updates the first learned MAC entry.
2935 [in_port(2),eth(src=50:54:00:00:00:05,dst=ff:ff:ff:ff:ff:ff),$arp],
2939 # Check that the MAC learning entry was updated.
2940 AT_CHECK_UNQUOTED([ovs-appctl fdb/show br0 | sed 's/[[0-9]]\{1,\}$/?/'], [0], [dnl
2942 1 0 50:54:00:00:00:06 ?
2943 2 0 50:54:00:00:00:05 ?
2946 # Add another bridge.
2950 -- set bridge br1 datapath-type=dummy])
2951 ADD_OF_PORTS([br1], 4, 5)
2953 # Trace some packet arrivals in br1 to create MAC learning entries there too.
2956 [in_port(4),eth(src=50:54:00:00:00:06,dst=ff:ff:ff:ff:ff:ff),$arp],
2961 [in_port(5),eth(src=50:54:00:00:00:07,dst=ff:ff:ff:ff:ff:ff),$arp],
2965 # Check that the MAC learning entries were added.
2966 AT_CHECK_UNQUOTED([ovs-appctl fdb/show br1 | sed 's/[[0-9]]\{1,\}$/?/'], [0], [dnl
2968 4 0 50:54:00:00:00:06 ?
2969 5 0 50:54:00:00:00:07 ?
2972 # Delete port p1 and see that its MAC learning entry disappeared, and
2973 # that the MAC learning entry for the same MAC was also deleted from br1.
2974 AT_CHECK([ovs-vsctl del-port p1])
2975 AT_CHECK_UNQUOTED([ovs-appctl fdb/show br0 | sed 's/[[0-9]]\{1,\}$/?/'], [0], [dnl
2977 2 0 50:54:00:00:00:05 ?
2979 AT_CHECK_UNQUOTED([ovs-appctl fdb/show br1 | sed 's/[[0-9]]\{1,\}$/?/'], [0], [dnl
2981 5 0 50:54:00:00:00:07 ?
2987 AT_SETUP([ofproto-dpif - MAC table overflow])
2989 [set bridge br0 fail-mode=standalone other-config:mac-table-size=10])
2990 ADD_OF_PORTS([br0], 1, 2, 3)
2992 arp='eth_type(0x0806),arp(sip=192.168.0.1,tip=192.168.0.2,op=1,sha=50:54:00:00:00:05,tha=00:00:00:00:00:00)'
2994 AT_CHECK([ovs-appctl time/stop])
2996 # Trace 10 ARP packets arriving on p3, to create MAC learning entries.
2997 for i in 0 1 2 3 4 5 6 7 8 9; do
3000 [in_port(3),eth(src=50:54:00:00:00:0$i,dst=ff:ff:ff:ff:ff:ff),$arp],
3003 ovs-appctl time/warp 1000
3006 # Check for the MAC learning entries.
3007 AT_CHECK_UNQUOTED([ovs-appctl fdb/show br0 | sed 's/ *[[0-9]]\{1,\}$//' | sort],
3009 3 0 50:54:00:00:00:00
3010 3 0 50:54:00:00:00:01
3011 3 0 50:54:00:00:00:02
3012 3 0 50:54:00:00:00:03
3013 3 0 50:54:00:00:00:04
3014 3 0 50:54:00:00:00:05
3015 3 0 50:54:00:00:00:06
3016 3 0 50:54:00:00:00:07
3017 3 0 50:54:00:00:00:08
3018 3 0 50:54:00:00:00:09
3022 # Trace another ARP packet on another MAC.
3025 [in_port(3),eth(src=50:54:00:00:00:10,dst=ff:ff:ff:ff:ff:ff),$arp],
3029 # Check that the new one chased the oldest one out of the table.
3030 AT_CHECK_UNQUOTED([ovs-appctl fdb/show br0 | sed 's/[[0-9]]\{1,\}$/?/' | sort],
3032 3 0 50:54:00:00:00:01 ?
3033 3 0 50:54:00:00:00:02 ?
3034 3 0 50:54:00:00:00:03 ?
3035 3 0 50:54:00:00:00:04 ?
3036 3 0 50:54:00:00:00:05 ?
3037 3 0 50:54:00:00:00:06 ?
3038 3 0 50:54:00:00:00:07 ?
3039 3 0 50:54:00:00:00:08 ?
3040 3 0 50:54:00:00:00:09 ?
3041 3 0 50:54:00:00:00:10 ?
3047 # CHECK_SFLOW_SAMPLING_PACKET(LOOPBACK_ADDR, ADDR_WITHOUT_BRACKETS)
3049 # Test that sFlow samples packets correctly using IPv4/IPv6 sFlow collector
3051 # IP_VERSION_TYPE is used in AT_SETUP
3052 m4_define([CHECK_SFLOW_SAMPLING_PACKET],
3053 [AT_SETUP([ofproto-dpif - sFlow packet sampling - $2 collector])
3054 OVS_VSWITCHD_START([set Bridge br0 fail-mode=standalone])
3056 ON_EXIT([kill `cat test-sflow.pid`])
3057 AT_CHECK([ovstest test-sflow --log-file --detach --no-chdir --pidfile 0:$1 > sflow.log], [0], [], [ignore])
3058 AT_CAPTURE_FILE([sflow.log])
3059 SFLOW_PORT=`parse_listening_port < test-sflow.log`
3060 ovs-appctl time/stop
3062 ADD_OF_PORTS([br0], 1, 2)
3064 set Interface br0 options:ifindex=1002 -- \
3065 set Interface p1 options:ifindex=1004 -- \
3066 set Interface p2 options:ifindex=1003 -- \
3067 set Bridge br0 sflow=@sf -- \
3068 --id=@sf create sflow targets=\"$1:$SFLOW_PORT\" \
3069 header=128 sampling=1 polling=1 agent=$LOOPBACK_INTERFACE
3071 dnl open with ARP packets to seed the bridge-learning. The output
3072 dnl ifIndex numbers should be reported predictably after that.
3073 dnl Since we set sampling=1 we should see all of these packets
3074 dnl reported. Sorting the output by data-source and seqNo makes
3075 dnl it deterministic. Ensuring that we send at least two packets
3076 dnl into each port means we get to check the seq nos are
3077 dnl incrementing correctly.
3078 dnl because packets from different ports can be handled by separate
3079 dnl threads, put some sleeps
3081 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)'
3083 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)'
3085 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)'
3087 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)'
3088 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)'
3090 dnl sleep long enough to get more than one counter sample
3091 dnl from each datasource so we can check sequence numbers
3092 for i in `seq 1 30`; do
3093 ovs-appctl time/warp 100
3096 ovs-appctl -t test-sflow exit
3098 AT_CHECK_UNQUOTED([[sort sflow.log | $EGREP 'HEADER|ERROR' | sed 's/ /\
3119 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
3139 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
3159 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
3179 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
3199 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
3202 AT_CHECK_UNQUOTED([[sort sflow.log | $EGREP 'IFCOUNTERS|ERROR' | head -6 | sed 's/ /\
3216 in_broadcasts=4294967295
3219 in_unknownprotos=4294967295
3222 out_multicasts=4294967295
3223 out_broadcasts=4294967295
3239 in_broadcasts=4294967295
3242 in_unknownprotos=4294967295
3245 out_multicasts=4294967295
3246 out_broadcasts=4294967295
3262 in_broadcasts=4294967295
3265 in_unknownprotos=4294967295
3268 out_multicasts=4294967295
3269 out_broadcasts=4294967295
3285 in_broadcasts=4294967295
3288 in_unknownprotos=4294967295
3291 out_multicasts=4294967295
3292 out_broadcasts=4294967295
3308 in_broadcasts=4294967295
3311 in_unknownprotos=4294967295
3314 out_multicasts=4294967295
3315 out_broadcasts=4294967295
3331 in_broadcasts=4294967295
3334 in_unknownprotos=4294967295
3337 out_multicasts=4294967295
3338 out_broadcasts=4294967295
3345 CHECK_SFLOW_SAMPLING_PACKET([127.0.0.1], [IPv4])
3346 CHECK_SFLOW_SAMPLING_PACKET([[[::1]]], [IPv6])
3348 # CHECK_NETFLOW_EXPIRATION(LOOPBACK_ADDR, IP_VERSION_TYPE)
3350 # Test that basic NetFlow reports flow statistics correctly:
3351 # The initial packet of a flow are correctly accounted.
3352 # Later packets within a flow are correctly accounted.
3353 # Flow actions changing (in this case, due to MAC learning)
3354 # cause a record to be sent.
3356 # IP_VERSION_TYPE is used in AT_SETUP
3357 m4_define([CHECK_NETFLOW_EXPIRATION],
3358 [AT_SETUP([ofproto-dpif - NetFlow flow expiration - $2 collector])
3359 OVS_VSWITCHD_START([set Bridge br0 fail-mode=standalone])
3360 ADD_OF_PORTS([br0], 1, 2)
3362 ovs-appctl time/stop
3363 ON_EXIT([kill `cat test-netflow.pid`])
3364 AT_CHECK([ovstest test-netflow --log-file --detach --no-chdir --pidfile 0:$1 > netflow.log], [0], [], [ignore])
3365 AT_CAPTURE_FILE([netflow.log])
3366 NETFLOW_PORT=`parse_listening_port < test-netflow.log`
3369 set Bridge br0 netflow=@nf -- \
3370 --id=@nf create NetFlow targets=\"$1:$NETFLOW_PORT\" \
3371 engine_id=1 engine_type=2 active_timeout=30 add-id-to-interface=false
3373 for delay in 1000 30000; do
3374 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)'
3375 sleep 1 # ensure the order in which these two packets are processed
3376 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)'
3378 ovs-appctl time/warp $delay
3381 ovs-appctl time/warp 6000
3384 ovs-appctl -t test-netflow exit
3386 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])
3388 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])
3390 combined=`grep "192.168.0.2 > 192.168.0.1, if 2 > 1, 2 pkts, 120 bytes, ICMP 0:0" netflow.log | wc -l`
3391 separate=`grep "192.168.0.2 > 192.168.0.1, if 2 > 1, 1 pkts, 60 bytes, ICMP 0:0" netflow.log | wc -l`
3392 AT_CHECK([test $separate = 2 || test $combined = 1], [0])
3396 CHECK_NETFLOW_EXPIRATION([127.0.0.1], [IPv4])
3397 CHECK_NETFLOW_EXPIRATION([[[::1]]], [IPv6])
3399 # CHECK_NETFLOW_ACTIVE_EXPIRATION(LOOPBACK_ADDR, IP_VERSION_TYPE)
3401 # Test that basic NetFlow reports active expirations correctly.
3403 # IP_VERSION_TYPE is used in AT_SETUP
3404 m4_define([CHECK_NETFLOW_ACTIVE_EXPIRATION],
3405 [AT_SETUP([ofproto-dpif - NetFlow active expiration - $2 collector])
3407 OVS_VSWITCHD_START([set Bridge br0 fail-mode=standalone])
3408 ADD_OF_PORTS([br0], 1, 2)
3410 ON_EXIT([kill `cat test-netflow.pid`])
3411 AT_CHECK([ovstest test-netflow --log-file --detach --no-chdir --pidfile 0:$1 > netflow.log], [0], [], [ignore])
3412 AT_CAPTURE_FILE([netflow.log])
3413 NETFLOW_PORT=`parse_listening_port < test-netflow.log`
3416 set Bridge br0 netflow=@nf -- \
3417 --id=@nf create NetFlow targets=\"$1:$NETFLOW_PORT\" \
3418 engine_id=1 engine_type=2 active_timeout=10 add-id-to-interface=false
3420 AT_CHECK([ovs-appctl time/stop])
3422 while test $n -le 60; do
3425 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)'
3426 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)'
3428 ovs-appctl time/warp 1000
3431 ovs-appctl time/warp 10000
3435 ovs-appctl -t test-netflow exit
3437 # Count the number of reported packets:
3438 # - From source to destination before MAC learning kicks in (just one).
3439 # - From source to destination after that.
3440 # - From destination to source.
3448 pkts=`echo "$line" | sed 's/.*, \([[0-9]]*\) pkts,.*/\1/'`
3455 "seq "*": 192.168.0.1 > 192.168.0.2, if 1 > 65535, "*" pkts, "*" bytes, TCP 1234 > 80, time "*)
3458 "seq "*": 192.168.0.1 > 192.168.0.2, if 1 > 2, "*" pkts, "*" bytes, TCP 1234 > 80, time "*)
3461 "seq "*": 192.168.0.2 > 192.168.0.1, if 2 > 1, "*" pkts, "*" bytes, TCP 80 > 1234, time "*)
3468 eval $counter=\`expr \$$counter + \$pkts\`
3469 n_recs=`expr $n_recs + 1`
3472 # There should be exactly 1 MAC learning packet,
3473 # exactly 59 other packets in that direction,
3474 # and exactly 60 packets in the other direction.
3475 AT_CHECK([echo $n_learn $n_in $n_out $n_other], [0], [1 59 60 0
3480 CHECK_NETFLOW_ACTIVE_EXPIRATION([127.0.0.1], [IPv4])
3481 CHECK_NETFLOW_ACTIVE_EXPIRATION([[[::1]]], [IPv6])
3483 AT_SETUP([ofproto-dpif - flow stats])
3485 AT_CHECK([ovs-ofctl add-flow br0 "ip,actions=NORMAL"])
3486 AT_CHECK([ovs-ofctl add-flow br0 "icmp,actions=NORMAL"])
3488 ovs-appctl time/stop
3490 for i in `seq 1 10`; do
3491 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)'
3494 ovs-appctl time/warp 1000
3495 sleep 1 # wait for revalidator to update stats
3497 AT_CHECK([ovs-ofctl dump-flows br0], [0], [stdout])
3498 AT_CHECK([STRIP_XIDS stdout | sed -n 's/duration=[[0-9]]*\.[[0-9]]*s/duration=0.0s/p' | sort], [0], [dnl
3499 cookie=0x0, duration=0.0s, table=0, n_packets=0, n_bytes=0, idle_age=1, icmp actions=NORMAL
3500 cookie=0x0, duration=0.0s, table=0, n_packets=10, n_bytes=600, idle_age=1, ip actions=NORMAL
3505 AT_SETUP([ofproto-dpif - flow stats, set-n-threads])
3507 AT_CHECK([ovs-ofctl add-flow br0 "ip,actions=NORMAL"])
3508 AT_CHECK([ovs-ofctl add-flow br0 "icmp,actions=NORMAL"])
3510 ovs-appctl time/stop
3512 for i in `seq 1 10`; do
3513 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)'
3516 ovs-appctl time/warp 100
3517 AT_CHECK([ovs-vsctl set Open_vSwitch . other-config:n-revalidator-threads=2])
3518 ovs-appctl time/warp 1000
3520 AT_CHECK([ovs-ofctl dump-flows br0], [0], [stdout])
3521 AT_CHECK([STRIP_XIDS stdout | sed -n 's/duration=[[0-9]]*\.[[0-9]]*s/duration=0.0s/p' | sort], [0], [dnl
3522 cookie=0x0, duration=0.0s, table=0, n_packets=0, n_bytes=0, idle_age=1, icmp actions=NORMAL
3523 cookie=0x0, duration=0.0s, table=0, n_packets=10, n_bytes=600, idle_age=1, ip actions=NORMAL
3528 AT_SETUP([idle_age and hard_age increase over time])
3531 # get_ages DURATION HARD IDLE
3533 # Fetch the flow duration, hard age, and idle age into the variables
3534 # whose names are given as arguments. Rounds DURATION down to the
3535 # nearest integer. If hard_age doesn't appear in the output, sets
3536 # HARD to "none". If idle_age doesn't appear in the output, sets IDLE
3539 AT_CHECK([ovs-ofctl dump-flows br0], [0], [stdout])
3541 duration=`sed -n 's/.*duration=\([[0-9]]*\)\(\.[[0-9]]*\)\{0,1\}s.*/\1/p' stdout`
3542 AT_CHECK([[expr X"$duration" : 'X[0-9][0-9]*$']], [0], [ignore])
3543 AS_VAR_COPY([$1], [duration])
3545 hard=`sed -n 's/.*hard_age=\([[0-9]]*\),.*/\1/p' stdout`
3546 if test X"$hard" = X; then
3549 AT_CHECK([[expr X"$hard" : 'X[0-9][0-9]*$']], [0], [ignore])
3551 AS_VAR_COPY([$2], [hard])
3553 idle=`sed -n 's/.*idle_age=\([[0-9]]*\),.*/\1/p' stdout`
3554 if test X"$idle" = X; then
3557 AT_CHECK([[expr X"$idle" : 'X[0-9][0-9]*$']], [0], [ignore])
3559 AS_VAR_COPY([$3], [idle])
3562 # Add a flow and get its initial hard and idle age.
3563 AT_CHECK([ovs-ofctl add-flow br0 hard_timeout=199,idle_timeout=188,actions=drop])
3564 get_ages duration1 hard1 idle1
3566 ovs-appctl time/stop
3567 # Warp time forward by 10 seconds, then modify the flow's actions.
3568 ovs-appctl time/warp 10000
3569 get_ages duration2 hard2 idle2
3570 AT_CHECK([ovs-ofctl mod-flows br0 actions=flood])
3572 # Warp time forward by 10 seconds.
3573 ovs-appctl time/warp 10000
3574 get_ages duration3 hard3 idle3
3576 # Warp time forward 10 more seconds, then pass some packets through the flow,
3577 # then warp forward a few more times because idle times are only updated
3579 ovs-appctl time/warp 10000
3580 ovs-appctl netdev-dummy/receive br0 'in_port(0),eth(src=50:54:00:00:00:07,dst=50:54:00:00:00:05),eth_type(0x0800),ipv4(src=192.168.0.2,dst=192.168.0.1,proto=6,tos=0,ttl=64,frag=no),tcp(src=80,dst=1234)'
3581 ovs-appctl time/warp 1000
3582 ovs-appctl time/warp 1000
3583 ovs-appctl time/warp 1000
3585 get_ages duration4 hard4 idle4
3587 printf "duration: %4s => %4s => %4s => %4s\n" $duration1 $duration2 $duration3 $duration4
3588 printf "hard_age: %4s => %4s => %4s => %4s\n" $hard1 $hard2 $hard3 $hard4
3589 printf "idle_age: %4s => %4s => %4s => %4s\n" $idle1 $idle2 $idle3 $idle4
3591 # Duration should increase steadily over time.
3592 AT_CHECK([test $duration1 -lt $duration2])
3593 AT_CHECK([test $duration2 -lt $duration3])
3594 AT_CHECK([test $duration3 -lt $duration4])
3596 # Hard age should be "none" initially because it's the same as flow_duration,
3597 # then it should increase.
3598 AT_CHECK([test $hard1 = none])
3599 AT_CHECK([test $hard2 = none])
3600 AT_CHECK([test $hard3 != none])
3601 AT_CHECK([test $hard4 != none])
3602 AT_CHECK([test $hard3 -lt $hard4])
3604 # Idle age should increase from 1 to 2 to 3, then decrease.
3605 AT_CHECK([test $idle1 -lt $idle2])
3606 AT_CHECK([test $idle2 -lt $idle3])
3607 AT_CHECK([test $idle3 -gt $idle4])
3609 # Check some invariant relationships.
3610 AT_CHECK([test $duration1 = $idle1])
3611 AT_CHECK([test $duration2 = $idle2])
3612 AT_CHECK([test $duration3 = $idle3])
3613 AT_CHECK([test $idle3 -gt $hard3])
3614 AT_CHECK([test $idle4 -lt $hard4])
3615 AT_CHECK([test $hard4 -lt $duration4])
3620 AT_SETUP([ofproto-dpif - fin_timeout])
3622 ovs-appctl time/stop
3623 AT_CHECK([ovs-ofctl add-flow br0 'idle_timeout=60,actions=fin_timeout(idle_timeout=5)'])
3624 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip], [0],
3626 idle_timeout=60, actions=fin_timeout(idle_timeout=5)
3629 # Check that a TCP SYN packet does not change the timeout. (Because
3630 # flow stats updates are mainly what implements the fin_timeout
3631 # feature, we warp forward a couple of times to ensure that flow stats
3632 # run before re-checking the flow table.)
3633 AT_CHECK([ovs-appctl netdev-dummy/receive br0 0021853763af0026b98cb0f908004500003c2e2440004006465dac11370dac11370b828b0016751e267b00000000a00216d017360000020405b40402080a2d25085f0000000001030307])
3634 AT_CHECK([ovs-appctl time/warp 1000 && ovs-appctl time/warp 1000], [0], [warped
3638 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip], [0],
3640 n_packets=1, n_bytes=74, idle_timeout=60, actions=fin_timeout(idle_timeout=5)
3642 # Check that a TCP FIN packet does change the timeout.
3643 AT_CHECK([ovs-appctl netdev-dummy/receive br0 0021853763af0026b98cb0f90800451000342e3e40004006463bac11370dac11370b828b0016751e319dfc96399b801100717ae800000101080a2d250a9408579588])
3644 AT_CHECK([ovs-appctl time/warp 1000 && ovs-appctl time/warp 1000], [0], [warped
3647 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip], [0],
3649 n_packets=2, n_bytes=140, idle_timeout=5, actions=fin_timeout(idle_timeout=5)
3654 AT_SETUP([ofproto-dpif - ovs-appctl dpif/dump-dps])
3655 OVS_VSWITCHD_START([add-br br1 -- set bridge br1 datapath-type=dummy])
3656 ADD_OF_PORTS([br0], [1], [2])
3657 ADD_OF_PORTS([br1], [3])
3659 AT_CHECK([ovs-appctl dpif/dump-dps], [0], [dnl
3666 AT_SETUP([ofproto-dpif - ovs-appctl dpif/show])
3667 OVS_VSWITCHD_START([add-br br1 -- set bridge br1 datapath-type=dummy])
3668 ADD_OF_PORTS([br0], [1], [2])
3669 ADD_OF_PORTS([br1], [3])
3671 AT_CHECK([ovs-appctl dpif/show], [0], [dnl
3672 dummy@ovs-dummy: hit:0 missed:0
3674 br0 65534/100: (dummy)
3678 br1 65534/101: (dummy)
3684 AT_SETUP([ofproto-dpif - ovs-appctl dpif/dump-flows])
3685 # bump max-idle to avoid the flows being reclaimed behind us
3686 OVS_VSWITCHD_START([add-br br1 -- \
3687 set bridge br1 datapath-type=dummy fail-mode=secure -- \
3688 set Open_vSwitch . other_config:max-idle=10000])
3689 ADD_OF_PORTS([br0], [1], [2])
3690 ADD_OF_PORTS([br1], [3])
3692 AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:05,dst=50:54:00:00:00:07),eth_type(0x0800),ipv4(src=192.168.0.1,dst=192.168.0.2,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
3693 AT_CHECK([ovs-appctl netdev-dummy/receive p2 'in_port(2),eth(src=50:54:00:00:00:07,dst=50:54:00:00:00:05),eth_type(0x0800),ipv4(src=192.168.0.2,dst=192.168.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=0,code=0)'])
3694 AT_CHECK([ovs-appctl netdev-dummy/receive p3 'in_port(3),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
3695 sleep 1 # wait for upcall handlers
3696 AT_CHECK([ovs-appctl dpif/dump-flows br0 | sort | STRIP_USED], [0], [dnl
3697 skb_priority(0),recirc_id(0),in_port(1),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/0xff), packets:0, bytes:0, used:never, actions:drop
3698 skb_priority(0),recirc_id(0),in_port(2),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/0xff), packets:0, bytes:0, used:never, actions:drop
3701 AT_CHECK([ovs-appctl dpif/dump-flows br1 | sort | STRIP_USED], [0], [dnl
3702 skb_priority(0),recirc_id(0),in_port(3),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/0xff), packets:0, bytes:0, used:never, actions:drop
3705 AT_CHECK([ovs-appctl dpif/dump-flows -m br0 | sort | STRIP_USED], [0], [dnl
3706 skb_priority(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/0xff),icmp(type=8/0,code=0/0), packets:0, bytes:0, used:never, actions:drop
3707 skb_priority(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/0xff),icmp(type=0/0,code=0/0), packets:0, bytes:0, used:never, actions:drop
3710 AT_CHECK([ovs-appctl dpif/dump-flows -m br1 | sort | STRIP_USED], [0], [dnl
3711 skb_priority(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/0xff),icmp(type=8/0,code=0/0), packets:0, bytes:0, used:never, actions:drop
3717 AT_SETUP([ofproto-dpif - MPLS actions that result in a userspace action])
3718 OVS_VSWITCHD_START([dnl
3719 add-port br0 p1 -- set Interface p1 type=dummy
3721 AT_CHECK([ovs-appctl vlog/set dpif:dbg])
3722 ON_EXIT([kill `cat ovs-ofctl.pid`])
3724 AT_CAPTURE_FILE([ofctl_monitor.log])
3725 AT_DATA([flows.txt], [dnl
3726 dl_src=60:66:66:66:66:00 actions=push_mpls:0x8847,controller
3727 dl_src=60:66:66:66:66:01 actions=pop_mpls:0x8849,controller
3729 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
3731 dnl Packet is sent to userspace because a MPLS push or pop action is applied to
3732 dnl a packet with 2 MPLS LSEs but dpif-netdev can't handle any labels.
3734 dnl The input is a frame with two MPLS labels which tcpdump -vve shows as:
3735 dnl 60:66:66:66:66:00 > 50:54:00:00:00:07, ethertype MPLS unicast (0x8847), length 74: MPLS (label 20, exp 0, ttl 32)
3736 dnl (label 20, exp 0, [S], ttl 32)
3737 dnl (tos 0x0, ttl 64, id 0, offset 0, flags [none], proto TCP (6), length 44, bad cksum 3b78 (->f978)!)
3738 dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x7744 (correct), seq 42:46, win 10000, length 4
3740 for dl_src in 00 01; do
3741 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"])
3743 sleep 1 # wait for the datapath flow installed
3744 for dl_src in 00 01; do
3745 AT_CHECK_UNQUOTED([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | grep ":$dl_src/" | STRIP_USED], [0], [dnl
3746 skb_priority(0),skb_mark(0/0),recirc_id(0),dp_hash(0/0),in_port(1),eth(src=60:66:66:66:66:$dl_src/ff:ff:ff:ff:ff:ff,dst=50:54:00:00:00:07/00:00:00:00:00:00),eth_type(0x8847),mpls(lse0=0x14020,lse1=0x14120), actions:userspace(pid=0,slow_path(controller))
3754 AT_SETUP([ofproto-dpif - MPLS actions that result in a drop])
3755 OVS_VSWITCHD_START([dnl
3756 add-port br0 p1 -- set Interface p1 type=dummy
3758 AT_CHECK([ovs-appctl vlog/set dpif:dbg])
3759 ON_EXIT([kill `cat ovs-ofctl.pid`])
3761 AT_CAPTURE_FILE([ofctl_monitor.log])
3762 AT_DATA([flows.txt], [dnl
3763 dl_src=60:66:66:66:66:00 actions=push_mpls:0x8847,controller
3764 dl_src=60:66:66:66:66:01 actions=pop_mpls:0x8849,controller
3766 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
3768 dnl Packet is dropped because an MPLS PUSH action is applied to a packet with
3769 dnl 4 MPLS LSEs but ovs-vswtichd can only handle up to 3 MPLS LSEs and thus
3770 dnl can't determine the resulting MPLS label after MPLS push/pop actions.
3772 dnl The input is a frame with two MPLS headers which tcpdump -vve shows as:
3773 dnl 60:66:66:66:66:01 > 50:54:00:00:00:07, ethertype MPLS unicast (0x8847), length 74: MPLS (label 20, exp 0, ttl 32)
3774 dnl (label 20, exp 0, ttl 32)
3775 dnl (label 20, exp 0, ttl 32)
3776 dnl (label 20, exp 0, [S], ttl 32)
3777 dnl (tos 0x0, ttl 64, id 0, offset 0, flags [none], proto TCP (6), length 44, bad cksum 3b78 (->f978)!)
3778 dnl 192.168.0.1.80 > 192.168.0.2.0: Flags [none], cksum 0x7744 (correct), seq 42:46, win 10000, length 4
3780 for dl_src in 00 01; do
3781 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"])
3783 sleep 1 # wait for the datapath flow installed
3784 for dl_src in 00 01; do
3785 AT_CHECK_UNQUOTED([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | grep ":$dl_src/" | STRIP_USED], [0], [dnl
3786 skb_priority(0),skb_mark(0/0),recirc_id(0),dp_hash(0/0),in_port(1),eth(src=60:66:66:66:66:$dl_src/ff:ff:ff:ff:ff:ff,dst=50:54:00:00:00:07/00:00:00:00:00:00),eth_type(0x8847),mpls(lse0=0x14020,lse1=0x14120), actions:userspace(pid=0,slow_path(controller))
3793 AT_SETUP([ofproto-dpif - patch ports])
3794 OVS_VSWITCHD_START([add-br br1 \
3795 -- set bridge br1 datapath-type=dummy fail-mode=secure \
3796 -- add-port br1 pbr1 -- set int pbr1 type=patch options:peer=pbr0 \
3797 -- add-port br0 pbr0 -- set int pbr0 type=patch options:peer=pbr1])
3799 ADD_OF_PORTS([br0], [2])
3800 ADD_OF_PORTS([br1], [3])
3802 AT_CHECK([ovs-appctl time/stop])
3803 AT_CHECK([ovs-appctl vlog/set dpif:dbg])
3805 AT_CHECK([ovs-ofctl add-flow br0 actions=LOCAL,output:1,output:2])
3806 AT_CHECK([ovs-ofctl add-flow br1 actions=LOCAL,output:1,output:3])
3808 for i in $(seq 1 10); do
3809 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)'
3810 if [[ $i -eq 1 ]]; then
3815 for i in $(seq 1 5); do
3816 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)'
3817 if [[ $i -eq 1 ]]; then
3822 AT_CHECK([ovs-appctl time/warp 500], [0],
3825 sleep 1 # wait for log writer
3827 AT_CHECK([ovs-appctl dpif/show], [0], [dnl
3828 dummy@ovs-dummy: hit:13 missed:2
3830 br0 65534/100: (dummy)
3832 pbr0 1/none: (patch: peer=pbr1)
3834 br1 65534/101: (dummy)
3836 pbr1 1/none: (patch: peer=pbr0)
3839 AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_USED], [0], [dnl
3840 skb_priority(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/0xff),icmp(type=8/0,code=0/0), actions:101,3,2
3841 skb_priority(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/0xff),icmp(type=8/0,code=0/0), actions:100,2,3
3844 AT_CHECK([cat ovs-vswitchd.log | grep -e 'in_port(100).*packets:9' | FILTER_FLOW_DUMP], [0], [dnl
3845 skb_priority(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/0xff),icmp(type=8/0,code=0/0), packets:9, bytes:540, used:0.0s, actions:101,3,2
3847 AT_CHECK([cat ovs-vswitchd.log | grep -e 'in_port(101).*packets:4' | FILTER_FLOW_DUMP], [0], [dnl
3848 skb_priority(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/0xff),icmp(type=8/0,code=0/0), packets:4, bytes:240, used:0.0s, actions:100,2,3
3851 AT_CHECK([ovs-ofctl dump-ports br0 pbr0], [0], [dnl
3852 OFPST_PORT reply (xid=0x4): 1 ports
3853 port 1: rx pkts=5, bytes=300, drop=0, errs=0, frame=0, over=0, crc=0
3854 tx pkts=10, bytes=600, drop=0, errs=0, coll=0
3857 AT_CHECK([ovs-ofctl dump-ports br1 pbr1], [0], [dnl
3858 OFPST_PORT reply (xid=0x4): 1 ports
3859 port 1: rx pkts=10, bytes=600, drop=0, errs=0, frame=0, over=0, crc=0
3860 tx pkts=5, bytes=300, drop=0, errs=0, coll=0
3866 AT_SETUP([ofproto-dpif - port duration])
3867 OVS_VSWITCHD_START([set Bridge br0 protocols=OpenFlow13])
3868 ADD_OF_PORTS([br0], 1, 2)
3870 ovs-appctl time/stop
3871 ovs-appctl time/warp 10000
3873 AT_CHECK([ovs-ofctl -O openflow13 dump-ports br0], [0], [stdout])
3874 AT_CHECK([sed -n 's/=[[0-9]][[0-9]]\(\.[[0-9]][[0-9]]*\)\{0,1\}s/=?s/p' stdout], [0],
3883 dnl ----------------------------------------------------------------------
3884 AT_BANNER([ofproto-dpif -- megaflows])
3886 AT_SETUP([ofproto-dpif megaflow - port classification])
3888 AT_CHECK([ovs-appctl vlog/set dpif:dbg])
3889 ADD_OF_PORTS([br0], [1], [2])
3890 AT_DATA([flows.txt], [dnl
3891 table=0 in_port=1 actions=output(2)
3893 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
3894 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)'])
3896 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)'])
3898 AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl
3899 skb_priority(0),skb_mark(0/0),recirc_id(0),dp_hash(0/0),in_port(1),eth(src=50:54:00:00:00:09/00:00:00:00:00:00,dst=50:54:00:00:00:0a/00:00:00:00:00:00),eth_type(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/0xff),icmp(type=8/0,code=0/0), actions: <del>
3904 AT_SETUP([ofproto-dpif megaflow - L2 classification])
3906 AT_CHECK([ovs-appctl vlog/set dpif:dbg])
3907 ADD_OF_PORTS([br0], [1], [2])
3908 AT_DATA([flows.txt], [dnl
3909 table=0 in_port=1,dl_src=50:54:00:00:00:09 actions=output(2)
3911 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
3912 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)'])
3913 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)'])
3915 AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl
3916 skb_priority(0),skb_mark(0/0),recirc_id(0),dp_hash(0/0),in_port(1),eth(src=50:54:00:00:00:09/ff:ff:ff:ff:ff:ff,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/0xff),icmp(type=8/0,code=0/0), actions: <del>
3917 skb_priority(0),skb_mark(0/0),recirc_id(0),dp_hash(0/0),in_port(1),eth(src=50:54:00:00:00:0b/ff:ff:ff:ff:ff:ff,dst=50:54:00:00:00:0c/00:00:00:00:00:00),eth_type(0x0800),ipv4(src=10.0.0.4/0.0.0.0,dst=10.0.0.3/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no/0xff),icmp(type=8/0,code=0/0), actions: <del>
3922 AT_SETUP([ofproto-dpif megaflow - L3 classification])
3924 AT_CHECK([ovs-appctl vlog/set dpif:dbg])
3925 ADD_OF_PORTS([br0], [1], [2])
3926 AT_CHECK([ovs-vsctl set Bridge br0 flow_tables:0=@N1 -- --id=@N1 create Flow_Table name=t0 prefixes=nw_dst,nw_src], [0], [ignore], [])
3927 AT_DATA([flows.txt], [dnl
3928 table=0 in_port=1,icmp,nw_src=10.0.0.4 actions=output(2)
3930 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
3931 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)'])
3932 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)'])
3934 AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl
3935 skb_priority(0),skb_mark(0/0),recirc_id(0),dp_hash(0/0),in_port(1),eth(src=50:54:00:00:00:09/00:00:00:00:00:00,dst=50:54:00:00:00:0a/00:00:00:00:00:00),eth_type(0x0800),ipv4(src=10.0.0.2/255.255.255.252,dst=10.0.0.1/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no/0xff),icmp(type=8/0,code=0/0), actions: <del>
3936 skb_priority(0),skb_mark(0/0),recirc_id(0),dp_hash(0/0),in_port(1),eth(src=50:54:00:00:00:0b/00:00:00:00:00:00,dst=50:54:00:00:00:0c/00:00:00:00:00:00),eth_type(0x0800),ipv4(src=10.0.0.4/255.255.255.255,dst=10.0.0.3/0.0.0.0,proto=1/0xff,tos=0/0,ttl=64/0,frag=no/0xff),icmp(type=8/0,code=0/0), actions: <del>
3941 AT_SETUP([ofproto-dpif megaflow - IPv6 classification])
3943 AT_CHECK([ovs-appctl vlog/set dpif:dbg])
3944 ADD_OF_PORTS([br0], [1], [2])
3945 AT_CHECK([ovs-vsctl set Bridge br0 flow_tables:0=@N1 -- --id=@N1 create Flow_Table name=t0 prefixes=ipv6_dst,ipv6_src], [0], [ignore], [])
3946 AT_DATA([flows.txt], [dnl
3947 table=0 in_port=1,ipv6,ipv6_src=2001:db8:3c4d:1:2:3:4:5 actions=output(2)
3949 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
3950 AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:07,dst=50:54:00:00:00:05),eth_type(0x86dd),ipv6(src=2001:db8:3c4d:1:2:3:4:5,dst=fe80::2,label=0,proto=10,tclass=0x70,hlimit=128,frag=no)'])
3951 AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x86dd),ipv6(src=2001:db8:3c4d:5:4:3:2:1,dst=2001:db8:3c4d:1:2:3:4:1,label=0,proto=99,tclass=0x70,hlimit=64,frag=no)'])
3953 AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl
3954 skb_priority(0),skb_mark(0/0),recirc_id(0),dp_hash(0/0),in_port(1),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(0x86dd),ipv6(src=2001:db8:3c4d:1:2:3:4:5/ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff,dst=fe80::2/::,label=0/0,proto=10/0,tclass=0x70/0,hlimit=128/0,frag=no/0xff), actions: <del>
3955 skb_priority(0),skb_mark(0/0),recirc_id(0),dp_hash(0/0),in_port(1),eth(src=50:54:00:00:00:09/00:00:00:00:00:00,dst=50:54:00:00:00:0a/00:00:00:00:00:00),eth_type(0x86dd),ipv6(src=2001:db8:3c4d:5:4:3:2:1/ffff:ffff:ffff:fffc::,dst=2001:db8:3c4d:1:2:3:4:1/::,label=0/0,proto=99/0,tclass=0x70/0,hlimit=64/0,frag=no/0xff), actions: <del>
3960 AT_SETUP([ofproto-dpif megaflow - L4 classification])
3962 AT_CHECK([ovs-appctl vlog/set dpif:dbg])
3963 ADD_OF_PORTS([br0], [1], [2])
3964 AT_DATA([flows.txt], [dnl
3965 table=0 in_port=1,icmp,icmp_type=8 actions=output(2)
3967 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
3968 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)'])
3970 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)'])
3972 AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl
3973 skb_priority(0),skb_mark(0/0),recirc_id(0),dp_hash(0/0),in_port(1),eth(src=50:54:00:00:00:09/00:00:00:00:00:00,dst=50:54:00:00:00:0a/00:00:00:00:00:00),eth_type(0x0800),ipv4(src=10.0.0.2/0.0.0.0,dst=10.0.0.1/0.0.0.0,proto=1/0xff,tos=0/0,ttl=64/0,frag=no/0xff),icmp(type=8/0xff,code=0/0), actions: <del>
3978 AT_SETUP([ofproto-dpif megaflow - normal])
3980 AT_CHECK([ovs-appctl vlog/set dpif:dbg])
3981 ADD_OF_PORTS([br0], [1], [2])
3982 AT_CHECK([ovs-ofctl add-flow br0 action=normal])
3983 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)'])
3984 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)'])
3986 AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl
3987 skb_priority(0),skb_mark(0/0),recirc_id(0),dp_hash(0/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/0.0.0.0,dst=10.0.0.1/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no/0xff),icmp(type=8/0,code=0/0), actions: <del>
3988 skb_priority(0),skb_mark(0/0),recirc_id(0),dp_hash(0/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/0.0.0.0,dst=10.0.0.3/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no/0xff),icmp(type=8/0,code=0/0), actions: <del>
3993 AT_SETUP([ofproto-dpif megaflow - mpls])
3995 AT_CHECK([ovs-appctl vlog/set dpif:dbg])
3996 ADD_OF_PORTS([br0], [1], [2])
3997 AT_DATA([flows.txt], [dnl
3998 table=0 dl_src=50:54:00:00:00:09 actions=push_mpls:0x8847,2
3999 table=0 dl_src=50:54:00:00:00:0b actions=pop_mpls:0x0800,2
4001 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
4002 AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x8847),mpls(label=11,tc=3,ttl=64,bos=1)'])
4003 AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0a),eth_type(0x8847),mpls(label=11,tc=3,ttl=64,bos=1)'])
4005 AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl
4006 skb_priority(0),skb_mark(0/0),recirc_id(0),dp_hash(0/0),in_port(1),eth(src=50:54:00:00:00:09/ff:ff:ff:ff:ff:ff,dst=50:54:00:00:00:0a/00:00:00:00:00:00),eth_type(0x8847),mpls(label=11,tc=3,ttl=64,bos=1), actions: <del>
4007 skb_priority(0),skb_mark(0/0),recirc_id(0),dp_hash(0/0),in_port(1),eth(src=50:54:00:00:00:0b/ff:ff:ff:ff:ff:ff,dst=50:54:00:00:00:0a/00:00:00:00:00:00),eth_type(0x8847),mpls(label=11,tc=3,ttl=64,bos=1), actions: <del>
4012 # CHECK_MEGAFLOW_NETFLOW(LOOPBACK_ADDR, IP_VERSION_TYPE)
4014 # IP_VERSION_TYPE is used in AT_SETUP
4015 m4_define([CHECK_MEGAFLOW_NETFLOW],
4016 [AT_SETUP([ofproto-dpif megaflow - netflow - $2 collector])
4018 AT_CHECK([ovs-appctl vlog/set dpif:dbg])
4019 ADD_OF_PORTS([br0], [1], [2])
4021 dnl NetFlow configuration disables wildcarding relevant fields
4022 ON_EXIT([kill `cat test-netflow.pid`])
4023 AT_CHECK([ovstest test-netflow --log-file --detach --no-chdir --pidfile 0:$1 > netflow.log], [0], [], [ignore])
4024 AT_CAPTURE_FILE([netflow.log])
4025 NETFLOW_PORT=`parse_listening_port < test-netflow.log`
4027 set Bridge br0 netflow=@nf -- \
4028 --id=@nf create NetFlow targets=\"$1:$NETFLOW_PORT\" \
4029 engine_id=1 engine_type=2 active_timeout=30 add-id-to-interface=false
4031 AT_CHECK([ovs-ofctl add-flow br0 action=normal])
4032 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)'])
4033 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)'])
4035 AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl
4036 skb_priority(0),skb_mark(0/0),recirc_id(0),dp_hash(0/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/255.255.255.255,dst=10.0.0.1/255.255.255.255,proto=1/0xff,tos=0/0xfc,ttl=64/0,frag=no/0xff),icmp(type=8,code=0), actions: <del>
4037 skb_priority(0),skb_mark(0/0),recirc_id(0),dp_hash(0/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/255.255.255.255,dst=10.0.0.3/255.255.255.255,proto=1/0xff,tos=0/0xfc,ttl=64/0,frag=no/0xff),icmp(type=8,code=0), actions: <del>
4042 CHECK_MEGAFLOW_NETFLOW([127.0.0.1], [IPv4])
4043 CHECK_MEGAFLOW_NETFLOW([[[::1]]], [IPv6])
4045 AT_SETUP([ofproto-dpif megaflow - normal, active-backup bonding])
4047 [add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1 -- \
4048 add-bond br0 bond0 p2 p3 bond_mode=active-backup -- \
4049 set interface p2 type=dummy ofport_request=2 -- \
4050 set interface p3 type=dummy ofport_request=3])
4051 AT_CHECK([ovs-appctl netdev-dummy/set-admin-state up], 0, [OK
4053 AT_CHECK([ovs-appctl vlog/set dpif:dbg])
4055 AT_CHECK([ovs-ofctl add-flow br0 action=normal])
4056 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)'])
4057 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)'])
4059 AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl
4060 skb_priority(0),skb_mark(0/0),recirc_id(0),dp_hash(0/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/0.0.0.0,dst=10.0.0.1/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no/0xff),icmp(type=8/0,code=0/0), actions: <del>
4061 skb_priority(0),skb_mark(0/0),recirc_id(0),dp_hash(0/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/0.0.0.0,dst=10.0.0.3/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no/0xff),icmp(type=8/0,code=0/0), actions: <del>
4066 AT_SETUP([ofproto-dpif megaflow - normal, balance-slb bonding])
4068 [add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1 -- \
4069 add-bond br0 bond0 p2 p3 bond_mode=balance-slb -- \
4070 set interface p2 type=dummy ofport_request=2 -- \
4071 set interface p3 type=dummy ofport_request=3])
4072 AT_CHECK([ovs-appctl netdev-dummy/set-admin-state up], 0, [OK
4074 AT_CHECK([ovs-appctl vlog/set dpif:dbg])
4076 AT_CHECK([ovs-ofctl add-flow br0 action=normal])
4077 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)'])
4078 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)'])
4080 AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl
4081 skb_priority(0),skb_mark(0/0),recirc_id(0),dp_hash(0/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/0.0.0.0,dst=10.0.0.1/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no/0xff),icmp(type=8/0,code=0/0), actions: <del>
4082 skb_priority(0),skb_mark(0/0),recirc_id(0),dp_hash(0/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/0.0.0.0,dst=10.0.0.3/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no/0xff),icmp(type=8/0,code=0/0), actions: <del>
4087 AT_SETUP([ofproto-dpif megaflow - normal, balance-tcp bonding])
4088 # Create bond0 on br0 with interfaces p0 and p1
4089 # and bond1 on br1 with interfaces p2 and p3
4090 # with p0 patched to p2 and p1 patched to p3.
4092 [add-bond br0 bond0 p0 p1 bond_mode=balance-tcp lacp=active \
4093 other-config:lacp-time=fast \
4094 other-config:bond-rebalance-interval=0 -- \
4095 set interface p0 type=patch options:peer=p2 ofport_request=1 -- \
4096 set interface p1 type=patch options:peer=p3 ofport_request=2 -- \
4098 set bridge br1 other-config:hwaddr=aa:66:aa:66:00:00 -- \
4099 set bridge br1 datapath-type=dummy other-config:datapath-id=1234 \
4100 fail-mode=secure -- \
4101 add-bond br1 bond1 p2 p3 bond_mode=balance-tcp lacp=active \
4102 other-config:lacp-time=fast \
4103 other-config:bond-rebalance-interval=0 -- \
4104 set interface p2 type=patch options:peer=p0 ofport_request=3 -- \
4105 set interface p3 type=patch options:peer=p1 ofport_request=4 --])
4107 AT_CHECK([ovs-appctl netdev-dummy/set-admin-state up], 0, [OK
4109 AT_CHECK([ovs-appctl vlog/set dpif:dbg])
4110 ADD_OF_PORTS([br0], [7])
4111 AT_CHECK([ovs-ofctl add-flow br0 action=normal])
4112 AT_CHECK([ovs-ofctl add-flow br1 action=normal])
4113 ovs-appctl time/stop
4114 ovs-appctl time/warp 5000
4115 AT_CHECK([ovs-appctl netdev-dummy/receive p7 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
4116 AT_CHECK([ovs-appctl netdev-dummy/receive p7 'in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.4,dst=10.0.0.3,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
4118 AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl
4119 skb_priority(0),skb_mark(0/0),recirc_id(0),dp_hash(0/0),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/0.0.0.0,dst=10.0.0.1/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no/0xff),icmp(type=8/0,code=0/0), actions: <del>
4120 skb_priority(0),skb_mark(0/0),recirc_id(0),dp_hash(0/0),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.4/0.0.0.0,dst=10.0.0.3/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no/0xff),icmp(type=8/0,code=0/0), actions: <del>
4125 AT_SETUP([ofproto-dpif megaflow - resubmit port action])
4127 AT_CHECK([ovs-appctl vlog/set dpif:dbg])
4128 ADD_OF_PORTS([br0], [1], [2])
4129 AT_DATA([flows.txt], [dnl
4130 table=0 in_port=1,ip actions=resubmit(90)
4131 table=0 in_port=90,dl_src=50:54:00:00:00:09 actions=output(2)
4133 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
4134 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)'])
4135 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)'])
4137 AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl
4138 skb_priority(0),skb_mark(0/0),recirc_id(0),dp_hash(0/0),in_port(1),eth(src=50:54:00:00:00:09/ff:ff:ff:ff:ff:ff,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/0xff),icmp(type=8/0,code=0/0), actions: <del>
4139 skb_priority(0),skb_mark(0/0),recirc_id(0),dp_hash(0/0),in_port(1),eth(src=50:54:00:00:00:0b/ff:ff:ff:ff:ff:ff,dst=50:54:00:00:00:0c/00:00:00:00:00:00),eth_type(0x0800),ipv4(src=10.0.0.4/0.0.0.0,dst=10.0.0.3/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no/0xff),icmp(type=8/0,code=0/0), actions: <del>
4144 AT_SETUP([ofproto-dpif megaflow - resubmit table action])
4146 AT_CHECK([ovs-appctl vlog/set dpif:dbg])
4147 ADD_OF_PORTS([br0], [1], [2])
4148 AT_DATA([flows.txt], [dnl
4149 table=0 in_port=1,ip actions=resubmit(,1)
4150 table=1 dl_src=50:54:00:00:00:09 actions=output(2)
4152 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
4153 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)'])
4154 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=
4155 1,tos=0,ttl=64,frag=no),icmp(type=8,code=0)'])
4157 AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl
4158 skb_priority(0),skb_mark(0/0),recirc_id(0),dp_hash(0/0),in_port(1),eth(src=50:54:00:00:00:09/ff:ff:ff:ff:ff:ff,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/0xff),icmp(type=8/0,code=0/0), actions: <del>
4159 skb_priority(0),skb_mark(0/0),recirc_id(0),dp_hash(0/0),in_port(1),eth(src=50:54:00:00:00:0b/ff:ff:ff:ff:ff:ff,dst=50:54:00:00:00:0c/00:00:00:00:00:00),eth_type(0x0800),ipv4(src=10.0.0.4/0.0.0.0,dst=10.0.0.3/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no/0xff),icmp(type=8/0,code=0/0), actions: <del>
4164 AT_SETUP([ofproto-dpif megaflow - goto_table action])
4166 AT_CHECK([ovs-appctl vlog/set dpif:dbg])
4167 ADD_OF_PORTS([br0], [1], [2])
4168 AT_DATA([flows.txt], [dnl
4169 table=0 in_port=1,ip actions=goto_table(1)
4170 table=1 dl_src=50:54:00:00:00:09 actions=output(2)
4172 AT_CHECK([ovs-ofctl -O OpenFlow12 add-flows br0 flows.txt])
4173 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)'])
4174 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)'])
4176 AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl
4177 skb_priority(0),skb_mark(0/0),recirc_id(0),dp_hash(0/0),in_port(1),eth(src=50:54:00:00:00:09/ff:ff:ff:ff:ff:ff,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/0xff),icmp(type=8/0,code=0/0), actions: <del>
4178 skb_priority(0),skb_mark(0/0),recirc_id(0),dp_hash(0/0),in_port(1),eth(src=50:54:00:00:00:0b/ff:ff:ff:ff:ff:ff,dst=50:54:00:00:00:0c/00:00:00:00:00:00),eth_type(0x0800),ipv4(src=10.0.0.4/0.0.0.0,dst=10.0.0.3/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no/0xff),icmp(type=8/0,code=0/0), actions: <del>
4183 AT_SETUP([ofproto-dpif megaflow - mirroring, select_all])
4185 AT_CHECK([ovs-appctl vlog/set dpif:dbg])
4186 ADD_OF_PORTS([br0], [1], [2], [3])
4188 set Bridge br0 mirrors=@m --\
4189 --id=@p3 get Port p3 --\
4190 --id=@m create Mirror name=mymirror select_all=true output_port=@p3
4192 AT_DATA([flows.txt], [dnl
4193 in_port=1 actions=output:2
4195 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
4196 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)'])
4198 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)'])
4200 AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl
4201 skb_priority(0),skb_mark(0/0),recirc_id(0),dp_hash(0/0),in_port(1),eth(src=50:54:00:00:00:09/00:00:00:00:00:00,dst=50:54:00:00:00:0a/00:00:00:00:00:00),eth_type(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/0xff),icmp(type=8/0,code=0/0), actions: <del>
4206 AT_SETUP([ofproto-dpif megaflow - mirroring, select_vlan])
4208 AT_CHECK([ovs-appctl vlog/set dpif:dbg])
4209 ADD_OF_PORTS([br0], [1], [2], [3])
4211 set Bridge br0 mirrors=@m --\
4212 --id=@p2 get Port p2 -- --id=@p3 get Port p3 --\
4213 --id=@m create Mirror name=mymirror select_all=true select_vlan=11 output_port=@p3
4215 AT_DATA([flows.txt], [dnl
4216 in_port=1 actions=output:2
4218 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
4219 AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x8100),vlan(vid=11,pcp=7),encap(eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0))'])
4220 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)'])
4222 AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl
4223 skb_priority(0),skb_mark(0/0),recirc_id(0),dp_hash(0/0),in_port(1),eth(src=50:54:00:00:00:09/00:00:00:00:00:00,dst=50:54:00:00:00:0a/00:00:00:00:00:00),eth_type(0x8100),vlan(vid=11/0xfff,pcp=7/0x0,cfi=1/1),encap(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/0xff),icmp(type=8/0,code=0/0)), actions: <del>
4224 skb_priority(0),skb_mark(0/0),recirc_id(0),dp_hash(0/0),in_port(1),eth(src=50:54:00:00:00:0b/00:00:00:00:00:00,dst=50:54:00:00:00:0c/00:00:00:00:00:00),eth_type(0x0800),ipv4(src=10.0.0.4/0.0.0.0,dst=10.0.0.3/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no/0xff),icmp(type=8/0,code=0/0), actions: <del>
4229 AT_SETUP([ofproto-dpif megaflow - move action])
4231 AT_CHECK([ovs-appctl vlog/set dpif:dbg])
4232 ADD_OF_PORTS([br0], [1], [2])
4233 AT_DATA([flows.txt], [dnl
4234 table=0 in_port=1 ip,actions=move:NXM_OF_IP_SRC[[]]->NXM_NX_REG0[[]],resubmit(90)
4235 table=0 in_port=90 ip,actions=move:NXM_NX_REG0[[]]->NXM_NX_REG1[[]],resubmit(91)
4236 table=0 in_port=91 reg0=0x0a000002,actions=output(2)
4238 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
4239 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)'])
4240 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)'])
4242 AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl
4243 skb_priority(0),skb_mark(0/0),recirc_id(0),dp_hash(0/0),in_port(1),eth(src=50:54:00:00:00:09/00:00:00:00:00:00,dst=50:54:00:00:00:0a/00:00:00:00:00:00),eth_type(0x0800),ipv4(src=10.0.0.2/255.255.255.255,dst=10.0.0.1/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no/0xff),icmp(type=8/0,code=0/0), actions: <del>
4244 skb_priority(0),skb_mark(0/0),recirc_id(0),dp_hash(0/0),in_port(1),eth(src=50:54:00:00:00:0b/00:00:00:00:00:00,dst=50:54:00:00:00:0c/00:00:00:00:00:00),eth_type(0x0800),ipv4(src=10.0.0.4/255.255.255.255,dst=10.0.0.3/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no/0xff),icmp(type=8/0,code=0/0), actions: <del>
4249 AT_SETUP([ofproto-dpif megaflow - push action])
4251 AT_CHECK([ovs-appctl vlog/set dpif:dbg])
4252 ADD_OF_PORTS([br0], [1], [2])
4253 AT_DATA([flows.txt], [dnl
4254 table=0 in_port=1 ip,actions=push:NXM_OF_IP_SRC[[]],output(2)
4256 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
4257 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)'])
4258 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)'])
4260 AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl
4261 skb_priority(0),skb_mark(0/0),recirc_id(0),dp_hash(0/0),in_port(1),eth(src=50:54:00:00:00:09/00:00:00:00:00:00,dst=50:54:00:00:00:0a/00:00:00:00:00:00),eth_type(0x0800),ipv4(src=10.0.0.2/255.255.255.255,dst=10.0.0.1/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no/0xff),icmp(type=8/0,code=0/0), actions: <del>
4262 skb_priority(0),skb_mark(0/0),recirc_id(0),dp_hash(0/0),in_port(1),eth(src=50:54:00:00:00:0b/00:00:00:00:00:00,dst=50:54:00:00:00:0c/00:00:00:00:00:00),eth_type(0x0800),ipv4(src=10.0.0.4/255.255.255.255,dst=10.0.0.3/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no/0xff),icmp(type=8/0,code=0/0), actions: <del>
4267 AT_SETUP([ofproto-dpif megaflow - learning])
4269 AT_CHECK([ovs-appctl vlog/set dpif:dbg])
4270 ADD_OF_PORTS([br0], [1], [2])
4271 AT_DATA([flows.txt], [dnl
4272 table=0 in_port=1 actions=load:2->NXM_NX_REG0[[0..15]],learn(table=1,priority=65535,NXM_OF_ETH_SRC[[]],NXM_OF_VLAN_TCI[[0..11]],output:NXM_NX_REG0[[0..15]]),output:2
4274 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
4275 ovs-appctl time/stop
4276 # We send each packet twice because the first packet in each flow causes the
4277 # flow table to change and thus revalidations, which (depending on timing)
4278 # can keep a megaflow from being installed. The revalidations are done by
4279 # the second iteration, allowing the flows to be installed.
4281 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)'])
4282 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)'])
4283 ovs-appctl time/warp 100
4286 dnl The original flow is missing due to a revalidation.
4287 AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl
4288 skb_priority(0),skb_mark(0/0),recirc_id(0),dp_hash(0/0),in_port(1),eth(src=50:54:00:00:00:09/ff:ff:ff:ff:ff:ff,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/0xff),icmp(type=8/0,code=0/0), actions: <del>
4289 skb_priority(0),skb_mark(0/0),recirc_id(0),dp_hash(0/0),in_port(1),eth(src=50:54:00:00:00:0b/ff:ff:ff:ff:ff:ff,dst=50:54:00:00:00:0c/00:00:00:00:00:00),eth_type(0x0800),ipv4(src=10.0.0.4/0.0.0.0,dst=10.0.0.3/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no/0xff),icmp(type=8/0,code=0/0), actions: <del>
4294 AT_SETUP([ofproto-dpif megaflow - tunnels])
4296 [add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1])
4297 AT_CHECK([ovs-appctl vlog/set dpif:dbg])
4298 AT_CHECK([ovs-vsctl add-port br0 p2 -- set Interface p2 type=gre \
4299 options:remote_ip=1.1.1.1 ofport_request=2 options:key=flow])
4300 AT_CHECK([ovs-vsctl add-port br0 p3 -- set Interface p3 type=dummy \
4302 AT_CHECK([ovs-vsctl add-port br0 p4 -- set Interface p4 type=gre \
4303 options:remote_ip=1.1.1.2 options:tos=inherit options:ttl=inherit \
4304 ofport_request=4 options:key=flow])
4305 AT_DATA([flows.txt], [dnl
4306 in_port=1,actions=output(2)
4307 in_port=3,actions=output(4)
4309 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
4310 dnl ECN bits are always copied out, but don't use 0x3 (CE), since that
4311 dnl will cause the packet to be dropped.
4312 AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0xfd,ttl=128,frag=no),icmp(type=8,code=0)'])
4314 AT_CHECK([ovs-appctl netdev-dummy/receive p1 'in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.4,dst=10.0.0.3,proto=1,tos=0x1,ttl=64,frag=no),icmp(type=8,code=0)'])
4315 AT_CHECK([ovs-appctl netdev-dummy/receive p3 'in_port(3),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0xfd,ttl=128,frag=no),icmp(type=8,code=0)'])
4317 AT_CHECK([ovs-appctl netdev-dummy/receive p3 'in_port(3),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.4,dst=10.0.0.3,proto=1,tos=0x1,ttl=64,frag=no),icmp(type=8,code=0)'])
4319 AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl
4320 skb_priority(0),skb_mark(0/0),recirc_id(0),dp_hash(0/0),in_port(1),eth(src=50:54:00:00:00:09/00:00:00:00:00:00,dst=50:54:00:00:00:0a/00:00:00:00:00:00),eth_type(0x0800),ipv4(src=10.0.0.2/0.0.0.0,dst=10.0.0.1/0.0.0.0,proto=1/0,tos=0xfd/0x3,ttl=128/0,frag=no/0xff),icmp(type=8/0,code=0/0), actions: <del>
4321 skb_priority(0),skb_mark(0/0),recirc_id(0),dp_hash(0/0),in_port(3),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=0xfd/0xff,ttl=128/0xff,frag=no/0xff),icmp(type=8/0,code=0/0), actions: <del>
4322 skb_priority(0),skb_mark(0/0),recirc_id(0),dp_hash(0/0),in_port(3),eth(src=50:54:00:00:00:0b/00:00:00:00:00:00,dst=50:54:00:00:00:0c/00:00:00:00:00:00),eth_type(0x0800),ipv4(src=10.0.0.4/0.0.0.0,dst=10.0.0.3/0.0.0.0,proto=1/0,tos=0x1/0xff,ttl=64/0xff,frag=no/0xff),icmp(type=8/0,code=0/0), actions: <del>
4327 AT_SETUP([ofproto-dpif megaflow - dec_ttl])
4329 AT_CHECK([ovs-appctl vlog/set dpif:dbg])
4330 ADD_OF_PORTS([br0], [1], [2])
4331 AT_CHECK([ovs-vsctl set Bridge br0 flow_tables:0=@N1 -- --id=@N1 create Flow_Table name=t0 prefixes=nw_dst,nw_src], [0], [ignore], [])
4332 AT_DATA([flows.txt], [dnl
4333 table=0 in_port=1,icmp,nw_src=10.0.0.4 actions=dec_ttl,output(2)
4335 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
4336 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)'])
4337 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)'])
4339 AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_XOUT], [0], [dnl
4340 skb_priority(0),skb_mark(0/0),recirc_id(0),dp_hash(0/0),in_port(1),eth(src=50:54:00:00:00:09/00:00:00:00:00:00,dst=50:54:00:00:00:0a/00:00:00:00:00:00),eth_type(0x0800),ipv4(src=10.0.0.2/255.255.255.252,dst=10.0.0.1/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no/0xff),icmp(type=8/0,code=0/0), actions: <del>
4341 skb_priority(0),skb_mark(0/0),recirc_id(0),dp_hash(0/0),in_port(1),eth(src=50:54:00:00:00:0b/00:00:00:00:00:00,dst=50:54:00:00:00:0c/00:00:00:00:00:00),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/0,code=0/0), actions: <del>
4346 AT_SETUP([ofproto-dpif megaflow - set dl_dst])
4348 AT_CHECK([ovs-appctl vlog/set dpif:dbg])
4349 ADD_OF_PORTS([br0], [1], [2])
4350 AT_DATA([flows.txt], [dnl
4351 table=0 in_port=1 actions=mod_dl_dst(50:54:00:00:00:0a),output(2)
4353 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
4354 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)'])
4355 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)'])
4357 dnl The megaflows do not match the same fields, since the first packet
4358 dnl is essentially a no-op. (The new destination MAC is the same as the
4359 dnl original.) The ofproto-dpif library un-wildcards the destination MAC
4360 dnl so that a packet that doesn't need its MAC address changed doesn't
4361 dnl hide one that does. Since the first entry doesn't need to change,
4362 dnl only the destination MAC address is matched (as decided by
4363 dnl ofproto-dpif). The second entry actually updates the destination
4364 dnl MAC, so both the source and destination MAC addresses are
4365 dnl un-wildcarded, since the ODP commit functions update both the source
4366 dnl and destination MAC addresses.
4367 AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_USED], [0], [dnl
4368 skb_priority(0),skb_mark(0/0),recirc_id(0),dp_hash(0/0),in_port(1),eth(src=50:54:00:00:00:09/00:00:00:00:00:00,dst=50:54:00:00:00:0a/ff:ff:ff:ff:ff:ff),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/0xff),icmp(type=8/0,code=0/0), actions:2
4369 skb_priority(0),skb_mark(0/0),recirc_id(0),dp_hash(0/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/0.0.0.0,dst=10.0.0.3/0.0.0.0,proto=1/0,tos=0/0,ttl=64/0,frag=no/0xff),icmp(type=8/0,code=0/0), actions:set(eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0a)),2
4374 AT_SETUP([ofproto-dpif megaflow - disabled])
4376 AT_CHECK([ovs-appctl vlog/set dpif:dbg])
4377 ADD_OF_PORTS([br0], [1], [2])
4378 AT_DATA([flows.txt], [dnl
4379 table=0 in_port=1,ip,nw_dst=10.0.0.1 actions=output(2)
4380 table=0 in_port=1,ip,nw_dst=10.0.0.3 actions=drop
4382 AT_CHECK([ovs-appctl upcall/disable-megaflows], [0], [megaflows disabled
4384 AT_CHECK([ovs-appctl vlog/set dpif_netdev:dbg], [0], [], [])
4385 AT_CHECK([ovs-ofctl add-flows br0 flows.txt])
4386 for i in 1 2 3 4; do
4387 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)'])
4388 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)'])
4389 if [[ $i -eq 1 ]]; then
4394 AT_CHECK([cat ovs-vswitchd.log | FILTER_FLOW_INSTALL | STRIP_USED], [0], [dnl
4395 skb_priority(0),skb_mark(0),recirc_id(0),dp_hash(0),in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0), actions:2
4396 skb_priority(0),skb_mark(0),recirc_id(0),dp_hash(0),in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.4,dst=10.0.0.3,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0), actions:drop
4398 AT_CHECK([cat ovs-vswitchd.log | grep '00:09.*packets:3' | FILTER_FLOW_DUMP], [0], [dnl
4399 skb_priority(0),skb_mark(0),recirc_id(0),dp_hash(0),in_port(1),eth(src=50:54:00:00:00:09,dst=50:54:00:00:00:0a),eth_type(0x0800),ipv4(src=10.0.0.2,dst=10.0.0.1,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0), packets:3, bytes:180, used:0.0s, actions:2
4401 AT_CHECK([cat ovs-vswitchd.log | grep '00:0b.*packets:3' | FILTER_FLOW_DUMP], [0], [dnl
4402 skb_priority(0),skb_mark(0),recirc_id(0),dp_hash(0),in_port(1),eth(src=50:54:00:00:00:0b,dst=50:54:00:00:00:0c),eth_type(0x0800),ipv4(src=10.0.0.4,dst=10.0.0.3,proto=1,tos=0,ttl=64,frag=no),icmp(type=8,code=0), packets:3, bytes:180, used:0.0s, actions:drop
4407 AT_SETUP([ofproto-dpif - datapath port number change])
4408 OVS_VSWITCHD_START([set Bridge br0 fail-mode=standalone])
4409 ADD_OF_PORTS([br0], 1)
4411 # Trace a flow that should output to p1.
4412 AT_CHECK([ovs-appctl ofproto/trace br0 in_port=LOCAL,dl_src=10:20:30:40:50:60],
4414 AT_CHECK([tail -1 stdout], [0], [Datapath actions: 1
4417 # Change p1's port number to 5.
4418 AT_CHECK([ovs-appctl dpif-dummy/change-port-number ovs-dummy p1 5])
4420 # Trace a flow that should output to p1 in its new location.
4421 AT_CHECK([ovs-appctl ofproto/trace br0 in_port=LOCAL,dl_src=10:20:30:40:50:60],
4423 AT_CHECK([tail -1 stdout], [0], [Datapath actions: 5
4428 # Tests the bundling with various bfd and cfm configurations.
4429 AT_SETUP([ofproto - bundle with variable bfd/cfm config])
4430 OVS_VSWITCHD_START([add-br br1 -- set bridge br1 datapath-type=dummy -- \
4431 add-bond br0 br0bond p0 p2 bond-mode=active-backup -- \
4432 add-bond br1 br1bond p1 p3 bond-mode=active-backup -- \
4433 set Interface p1 type=patch options:peer=p0 ofport_request=2 -- \
4434 set Interface p3 type=patch options:peer=p2 ofport_request=4 -- \
4435 set Interface p0 type=patch options:peer=p1 ofport_request=1 -- \
4436 set Interface p2 type=patch options:peer=p3 ofport_request=3 -- \
4437 set Interface p0 bfd:enable=true bfd:min_tx=300 bfd:min_rx=300 -- \
4438 set Interface p0 cfm_mpid=1 -- \
4439 set Interface p1 bfd:enable=true bfd:min_tx=500 bfd:min_rx=500])
4441 ovs-appctl time/stop
4442 # advance the clock to stablize everything.
4443 for i in `seq 0 49`; do ovs-appctl time/warp 100; done
4444 # cfm/show should show 'recv' fault.
4445 AT_CHECK([ovs-appctl cfm/show | sed -n '/^.*fault:.*/p'], [0], [dnl
4448 # bfd/show should show 'up'.
4449 AT_CHECK([ovs-appctl bfd/show | sed -n '/^.*Session State:.*/p'], [0], [dnl
4450 Local Session State: up
4451 Remote Session State: up
4452 Local Session State: up
4453 Remote Session State: up
4455 # bond/show should show 'may-enable: true' for all slaves.
4456 AT_CHECK([ovs-appctl bond/show | sed -n '/^.*may_enable:.*/p'], [0], [dnl
4463 # now disable the bfd on p1.
4464 AT_CHECK([ovs-vsctl set Interface p1 bfd:enable=false])
4465 # advance the clock to stablize everything.
4466 for i in `seq 0 49`; do ovs-appctl time/warp 100; done
4467 # cfm/show should show 'recv' fault.
4468 AT_CHECK([ovs-appctl cfm/show | sed -n '/^.*fault:.*/p'], [0], [dnl
4471 # bfd/show should show 'down'.
4472 AT_CHECK([ovs-appctl bfd/show | sed -n '/^.*Session State:.*/p'], [0], [dnl
4473 Local Session State: down
4474 Remote Session State: down
4476 # bond/show should show 'may-enable: false' for p0.
4477 AT_CHECK([ovs-appctl bond/show br0bond | sed -n '/^.*may_enable:.*/p'], [0], [dnl
4482 # now enable the bfd on p1 and disable bfd on p0.
4483 AT_CHECK([ovs-vsctl set Interface p1 bfd:enable=true])
4484 AT_CHECK([ovs-vsctl set Interface p0 bfd:enable=false])
4485 # advance the clock to stablize everything.
4486 for i in `seq 0 49`; do ovs-appctl time/warp 100; done
4487 # cfm/show should show 'recv' fault.
4488 AT_CHECK([ovs-appctl cfm/show | sed -n '/^.*fault:.*/p'], [0], [dnl
4491 # bfd/show should show 'down'.
4492 AT_CHECK([ovs-appctl bfd/show | sed -n '/^.*Session State:.*/p'], [0], [dnl
4493 Local Session State: down
4494 Remote Session State: down
4496 # bond/show should show 'may-enable: false' for p0 and p1.
4497 AT_CHECK([ovs-appctl bond/show | sed -n '/^.*may_enable:.*/p'], [0], [dnl
4507 AT_SETUP([ofproto-dpif - ofproto-dpif-monitor 1])
4508 OVS_VSWITCHD_START([add-port br0 p0 -- set interface p0 type=gre options:remote_ip=1.2.3.4])
4511 AT_CHECK([ovs-vsctl set interface p0 bfd:enable=true])
4513 OVS_WAIT_UNTIL([grep "monitor thread created" ovs-vswitchd.log])
4514 # disable bfd on p0.
4515 AT_CHECK([ovs-vsctl set interface p0 bfd:enable=false])
4517 OVS_WAIT_UNTIL([grep "monitor thread terminated" ovs-vswitchd.log])
4518 AT_CHECK([cat ovs-vswitchd.log | sed -e '/^.*ofproto_dpif_monitor.*$/d' > ovs-vswitchd.log])
4521 AT_CHECK([ovs-vsctl set interface p0 cfm_mpid=10])
4523 OVS_WAIT_UNTIL([grep "monitor thread created" ovs-vswitchd.log])
4524 # disable cfm on p0.
4525 AT_CHECK([ovs-vsctl remove interface p0 cfm_mpid 10])
4527 OVS_WAIT_UNTIL([grep "monitor thread terminated" ovs-vswitchd.log])
4528 AT_CHECK([cat ovs-vswitchd.log | sed -e '/^.*ofproto_dpif_monitor.*$/d' > ovs-vswitchd.log])
4530 # enable both bfd and cfm on p0.
4531 AT_CHECK([ovs-vsctl set interface p0 bfd:enable=true cfm_mpid=10])
4533 OVS_WAIT_UNTIL([grep "monitor thread created" ovs-vswitchd.log])
4534 # disable bfd on p0.
4535 AT_CHECK([ovs-vsctl set interface p0 bfd:enable=false])
4536 # check log, there should not be the log of thread terminated.
4537 AT_CHECK([sed -n "s/^.*|ofproto_dpif_monitor(monitor[[0-9]]*)|INFO|\(.* terminated\)$/\1/p" ovs-vswitchd.log], [0], [dnl
4539 # reenable bfd on p0.
4540 AT_CHECK([ovs-vsctl set interface p0 bfd:enable=true])
4541 # check log, should still be on log of thread created.
4542 AT_CHECK([sed -n "s/^.*|ofproto_dpif_monitor(monitor[[0-9]]*)|INFO|\(.* created\)$/\1/p" ovs-vswitchd.log], [0], [dnl
4543 monitor thread created
4545 # disable bfd and cfm together.
4546 AT_CHECK([ovs-vsctl set interface p0 bfd:enable=false -- remove interface p0 cfm_mpid 10])
4548 OVS_WAIT_UNTIL([grep "monitor thread terminated" ovs-vswitchd.log])
4553 # this test helps avoid the deadlock between the main thread and monitor thread.
4554 AT_SETUP([ofproto-dpif - ofproto-dpif-monitor 2])
4557 for i in `seq 1 199`
4559 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])
4565 AT_BANNER([ofproto-dpif - flow translation resource limits])
4567 AT_SETUP([ofproto-dpif - infinite resubmit])
4569 AT_CHECK([ovs-ofctl add-flow br0 actions=resubmit:1,resubmit:2,output:3])
4570 AT_CHECK([ovs-appctl ofproto/trace br0 'eth_dst=ff:ff:ff:ff:ff:ff'],
4572 AT_CHECK([tail -1 stdout], [0], [Datapath actions: drop
4574 AT_CHECK([grep -c 'resubmit actions recursed over 64 times' ovs-vswitchd.log],
4577 OVS_VSWITCHD_STOP(["/resubmit actions recursed/d"])
4580 AT_SETUP([ofproto-dpif - exponential resubmit chain])
4582 ADD_OF_PORTS([br0], 1)
4583 (for i in `seq 1 64`; do
4585 echo "in_port=$i, actions=resubmit:$j, resubmit:$j, local"
4587 echo "in_port=65, actions=local") > flows
4588 AT_CHECK([ovs-ofctl add-flows br0 flows])
4589 AT_CHECK([ovs-appctl ofproto/trace br0 'in_port=1'], [0], [stdout])
4590 AT_CHECK([grep -c 'over 4096 resubmit actions' ovs-vswitchd.log], [0], [1
4592 OVS_VSWITCHD_STOP(["/over.*resubmit actions/d"])
4595 AT_SETUP([ofproto-dpif - too many output actions])
4597 ADD_OF_PORTS([br0], 1)
4598 (for i in `seq 1 12`; do
4600 echo "in_port=$i, actions=resubmit:$j, resubmit:$j, local"
4602 echo "in_port=13, actions=local,local,local,local,local,local,local,local") > flows
4603 AT_CHECK([ovs-ofctl add-flows br0 flows])
4604 AT_CHECK([ovs-appctl ofproto/trace br0 'in_port=1'], [0], [stdout])
4605 AT_CHECK([grep -c -e '- Uses action(s) not supported by datapath' stdout],
4608 AT_CHECK([grep -c 'resubmits yielded over 64 kB of actions' ovs-vswitchd.log], [0], [1
4610 OVS_VSWITCHD_STOP(["/resubmits yielded over 64 kB of actions/d"])
4613 AT_SETUP([ofproto-dpif - stack too deep])
4615 ADD_OF_PORTS([br0], 1)
4616 (for i in `seq 1 12`; do
4618 echo "in_port=$i, actions=resubmit:$j, resubmit:$j, local"
4620 push="push:NXM_NX_REG0[[]]"
4621 echo "in_port=13, actions=$push,$push,$push,$push,$push,$push,$push,$push") > flows
4622 AT_CHECK([ovs-ofctl add-flows br0 flows])
4623 AT_CHECK([ovs-appctl ofproto/trace br0 'in_port=1'], [0], [stdout])
4624 AT_CHECK([grep -c 'resubmits yielded over 64 kB of stack' ovs-vswitchd.log], [0], [1
4626 OVS_VSWITCHD_STOP(["/resubmits yielded over 64 kB of stack/d"])
4630 AT_SETUP([ofproto-dpif packet-out controller])
4632 ADD_OF_PORTS([br0], 1, 2)
4634 AT_CHECK([ovs-ofctl add-flow br0 'dl_dst=50:54:00:00:00:0a actions=controller'])
4636 AT_CAPTURE_FILE([ofctl_monitor.log])
4637 AT_CHECK([ovs-ofctl monitor br0 65534 invalid_ttl --detach --no-chdir --pidfile 2> ofctl_monitor.log])
4640 AT_CHECK([ovs-ofctl -O OpenFlow13 packet-out br0 CONTROLLER controller '50540000000a5054000000091234'])
4643 OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
4644 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
4645 NXT_PACKET_IN (xid=0x0): total_len=14 in_port=CONTROLLER (via action) data_len=14 (unbuffered)
4646 metadata=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
4648 NXT_PACKET_IN (xid=0x0): total_len=14 in_port=CONTROLLER (via action) data_len=14 (unbuffered)
4649 metadata=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
4651 NXT_PACKET_IN (xid=0x0): total_len=14 in_port=CONTROLLER (via action) data_len=14 (unbuffered)
4652 metadata=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
4655 AT_CHECK([ovs-ofctl dump-flows br0 | ofctl_strip | sort], [0], [dnl
4656 dl_dst=50:54:00:00:00:0a actions=CONTROLLER:65535
4660 (echo "OFPST_TABLE reply (OF1.3) (xid=0x2): 254 tables"
4661 echo " 0: active=1, lookup=0, matched=0"
4663 while test $x -lt 254; do
4664 echo " $x: active=0, lookup=0, matched=0"
4667 AT_CHECK([ovs-ofctl -O OpenFlow13 dump-tables br0 ], [0], [expout])
4673 AT_SETUP([ofproto-dpif packet-out controller (patch port)])
4676 add-port br0 p1 -- \
4677 set interface p1 type=patch options:peer=p2 -- \
4679 set bridge br1 datapath-type=dummy -- \
4680 set bridge br1 fail-mode=secure -- \
4681 set bridge br1 protocols='[OpenFlow10,OpenFlow11,OpenFlow12,OpenFlow13]' -- \
4682 add-port br1 p2 -- \
4683 set interface p2 type=patch options:peer=p1 --])
4685 AT_CAPTURE_FILE([ofctl_monitor.log])
4686 AT_CHECK([ovs-ofctl monitor br1 65534 invalid_ttl --detach --no-chdir --pidfile 2> ofctl_monitor.log])
4689 AT_CHECK([ovs-ofctl -O OpenFlow13 packet-out br0 CONTROLLER output:1 '50540000000a5054000000091234'])
4692 OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
4693 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
4694 NXT_PACKET_IN (xid=0x0): cookie=0x0 total_len=14 in_port=1 (via no_match) data_len=14 (unbuffered)
4695 metadata=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
4697 NXT_PACKET_IN (xid=0x0): cookie=0x0 total_len=14 in_port=1 (via no_match) data_len=14 (unbuffered)
4698 metadata=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
4700 NXT_PACKET_IN (xid=0x0): cookie=0x0 total_len=14 in_port=1 (via no_match) data_len=14 (unbuffered)
4701 metadata=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
4704 (echo "OFPST_TABLE reply (OF1.3) (xid=0x2): 254 tables"
4706 while test $x -lt 254; do
4707 echo " $x: active=0, lookup=0, matched=0"
4710 AT_CHECK([ovs-ofctl -O OpenFlow13 dump-tables br0 ], [0], [expout])
4712 (echo "OFPST_TABLE reply (OF1.3) (xid=0x2): 254 tables"
4713 echo " 0: active=0, lookup=3, matched=0"
4715 while test $x -lt 254; do
4716 echo " $x: active=0, lookup=0, matched=0"
4719 AT_CHECK([ovs-ofctl -O OpenFlow13 dump-tables br1 ], [0], [expout])
4725 AT_SETUP([ofproto-dpif packet-out goto_table])
4727 ADD_OF_PORTS([br0], 1, 2)
4729 AT_DATA([flows.txt], [dnl
4730 table=0 dl_dst=50:54:00:00:00:0a actions=goto_table(1)
4731 table=1 dl_dst=50:54:00:00:00:0a actions=controller
4733 AT_CHECK([ovs-ofctl -O OpenFlow13 add-flows br0 flows.txt])
4735 AT_CAPTURE_FILE([ofctl_monitor.log])
4736 AT_CHECK([ovs-ofctl monitor br0 65534 invalid_ttl --detach --no-chdir --pidfile 2> ofctl_monitor.log])
4739 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)'
4742 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
4743 OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
4744 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
4745 NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
4746 metadata=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
4748 NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
4749 metadata=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
4751 NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
4752 metadata=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
4755 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
4757 AT_CHECK([ovs-ofctl -O OpenFlow13 dump-flows br0 | ofctl_strip | sort], [0], [dnl
4758 n_packets=3, n_bytes=180, dl_dst=50:54:00:00:00:0a actions=goto_table:1
4759 table=1, n_packets=3, n_bytes=180, dl_dst=50:54:00:00:00:0a actions=CONTROLLER:65535
4760 OFPST_FLOW reply (OF1.3):
4763 (echo "OFPST_TABLE reply (OF1.3) (xid=0x2): 254 tables"
4764 echo " 0: active=1, lookup=3, matched=3"
4765 echo " 1: active=1, lookup=3, matched=3"
4767 while test $x -lt 254; do
4768 echo " $x: active=0, lookup=0, matched=0"
4771 AT_CHECK([ovs-ofctl -O OpenFlow13 dump-tables br0 ], [0], [expout])
4777 AT_SETUP([ofproto-dpif packet-out table-miss (continue)])
4779 ADD_OF_PORTS([br0], 1, 2)
4781 AT_CHECK([ovs-ofctl -O OpenFlow13 add-flow br0 'table=1 dl_dst=50:54:00:00:00:0a actions=controller'])
4782 AT_CHECK([ovs-ofctl -O OpenFlow13 mod-table br0 all continue])
4784 AT_CAPTURE_FILE([ofctl_monitor.log])
4785 AT_CHECK([ovs-ofctl monitor br0 65534 invalid_ttl --detach --no-chdir --pidfile 2> ofctl_monitor.log])
4788 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)'
4791 OVS_WAIT_UNTIL([test `wc -l < ofctl_monitor.log` -ge 6])
4792 OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
4793 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
4794 NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
4795 metadata=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
4797 NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
4798 metadata=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
4800 NXT_PACKET_IN (xid=0x0): table_id=1 cookie=0x0 total_len=60 in_port=1 (via action) data_len=60 (unbuffered)
4801 metadata=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
4804 AT_CHECK([ovs-appctl time/warp 5000], [0], [ignore])
4806 AT_CHECK([ovs-ofctl -O OpenFlow13 dump-flows br0 | ofctl_strip | sort], [0], [dnl
4807 table=1, n_packets=3, n_bytes=180, dl_dst=50:54:00:00:00:0a actions=CONTROLLER:65535
4808 OFPST_FLOW reply (OF1.3):
4811 (echo "OFPST_TABLE reply (OF1.3) (xid=0x2): 254 tables"
4812 echo " 0: active=0, lookup=3, matched=0"
4813 echo " 1: active=1, lookup=3, matched=3"
4815 while test $x -lt 254; do
4816 echo " $x: active=0, lookup=0, matched=0"
4819 AT_CHECK([ovs-ofctl -O OpenFlow13 dump-tables br0 ], [0], [expout])
4824 AT_SETUP([ofproto-dpif - ICMPv6])
4826 ADD_OF_PORTS([br0], 1)
4828 AT_CAPTURE_FILE([ofctl_monitor.log])
4830 AT_CHECK([ovs-ofctl monitor br0 65534 --detach --no-chdir --pidfile 2> ofctl_monitor.log])
4832 ovs-appctl netdev-dummy/receive p1 '0060970769ea0000860580da86dd6000000000203afffe80000000000000020086fffe0580dafe80000000000000026097fffe0769ea870068bd00000000fe80000000000000026097fffe0769ea01010000860580da'
4834 OVS_WAIT_UNTIL([ovs-appctl -t ovs-ofctl exit])
4836 AT_CHECK([cat ofctl_monitor.log], [0], [dnl
4837 NXT_PACKET_IN (xid=0x0): cookie=0x0 total_len=86 in_port=1 (via no_match) data_len=86 (unbuffered)
4838 icmp6,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