]> git.proxmox.com Git - ovs.git/blob - tests/nsh.at
dpif-netdev: Change polled_queue to use dp_netdev_rxq.
[ovs.git] / tests / nsh.at
1 AT_BANNER([network service header (NSH)])
2
3 ### -----------------------------------------------------------------
4 ### Simple NSH matching test case
5 ### -----------------------------------------------------------------
6
7 AT_SETUP([nsh - matching])
8
9 OVS_VSWITCHD_START([dnl
10 set bridge br0 datapath_type=dummy \
11 protocols=OpenFlow10,OpenFlow13,OpenFlow14,OpenFlow15 -- \
12 add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1 -- \
13 add-port br0 p2 -- set Interface p2 type=dummy ofport_request=2])
14
15 AT_DATA([flows.txt], [dnl
16 table=0,in_port=1,dl_type=0x894f,nsh_mdtype=1,nsh_np=3,nsh_spi=0x123456,nsh_si=255,nsh_c1=0x11223344,actions=set_field:0x80->nsh_flags,set_field:254->nsh_si,set_field:0x44332211->nsh_c1,2
17 ])
18
19 AT_CHECK([
20 ovs-ofctl del-flows br0
21 ovs-ofctl -Oopenflow13 add-flows br0 flows.txt
22 ovs-ofctl -Oopenflow13 dump-flows br0 | ofctl_strip | sort | grep actions
23 ], [0], [dnl
24 in_port=1,dl_type=0x894f,nsh_mdtype=1,nsh_np=3,nsh_spi=0x123456,nsh_si=255,nsh_c1=0x11223344 actions=set_field:128->nsh_flags,set_field:254->nsh_si,set_field:0x44332211->nsh_c1,output:2
25 ])
26
27 AT_CHECK([
28 ovs-appctl ofproto/trace br0 'in_port=1,dl_type=0x894f,nsh_mdtype=1,nsh_np=3,nsh_spi=0x123456,nsh_si=255,nsh_c1=0x11223344,nsh_c2=0x55667788,nsh_c3=0x99aabbcc,nsh_c4=0xddeeff00'
29 ], [0], [dnl
30 Flow: in_port=1,vlan_tci=0x0000,dl_src=00:00:00:00:00:00,dl_dst=00:00:00:00:00:00,dl_type=0x894f,nsh_flags=0,nsh_mdtype=1,nsh_np=3,nsh_spi=0x123456,nsh_si=255,nsh_c1=0x11223344,nsh_c2=0x55667788,nsh_c3=0x99aabbcc,nsh_c4=0xddeeff00,nw_proto=0,nw_tos=0,nw_ecn=0,nw_ttl=0
31
32 bridge("br0")
33 -------------
34 0. in_port=1,dl_type=0x894f,nsh_mdtype=1,nsh_np=3,nsh_spi=0x123456,nsh_si=255,nsh_c1=0x11223344, priority 32768
35 set_field:128->nsh_flags
36 set_field:254->nsh_si
37 set_field:0x44332211->nsh_c1
38 output:2
39
40 Final flow: in_port=1,vlan_tci=0x0000,dl_src=00:00:00:00:00:00,dl_dst=00:00:00:00:00:00,dl_type=0x894f,nsh_flags=128,nsh_mdtype=1,nsh_np=3,nsh_spi=0x123456,nsh_si=254,nsh_c1=0x44332211,nsh_c2=0x55667788,nsh_c3=0x99aabbcc,nsh_c4=0xddeeff00,nw_proto=0,nw_tos=0,nw_ecn=0,nw_ttl=0
41 Megaflow: recirc_id=0,eth,in_port=1,dl_type=0x894f,nsh_flags=0,nsh_mdtype=1,nsh_np=3,nsh_spi=0x123456,nsh_si=255,nsh_c1=0x11223344
42 Datapath actions: set(nsh(flags=128,spi=0x123456,si=254,c1=0x44332211)),2
43 ])
44
45 OVS_VSWITCHD_STOP
46 AT_CLEANUP
47
48
49 ### -----------------------------------------------------------------
50 ### NSH MD1 on Ethernet encapsulation over veth link
51 ### -----------------------------------------------------------------
52
53 AT_SETUP([nsh - md1 encap over a veth link])
54
55 OVS_VSWITCHD_START([])
56
57 AT_CHECK([
58 ovs-vsctl set bridge br0 datapath_type=dummy \
59 protocols=OpenFlow10,OpenFlow13,OpenFlow14,OpenFlow15 -- \
60 add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1 -- \
61 add-port br0 p2 -- set Interface p2 type=dummy ofport_request=2 -- \
62 add-port br0 v3 -- set Interface v3 type=patch options:peer=v4 ofport_request=3 -- \
63 add-port br0 v4 -- set Interface v4 type=patch options:peer=v3 ofport_request=4])
64
65 AT_DATA([flows.txt], [dnl
66 table=0,in_port=1,ip,actions=encap(nsh(md_type=1)),set_field:0x1234->nsh_spi,set_field:0x11223344->nsh_c1,encap(ethernet),set_field:11:22:33:44:55:66->dl_dst,3
67 table=0,in_port=4,dl_type=0x894f,nsh_mdtype=1,nsh_spi=0x1234,nsh_c1=0x11223344,actions=decap(),decap(),2
68 ])
69
70 AT_CHECK([
71 ovs-ofctl del-flows br0
72 ovs-ofctl -Oopenflow13 add-flows br0 flows.txt
73 ovs-ofctl -Oopenflow13 dump-flows br0 | ofctl_strip | sort | grep actions
74 ], [0], [dnl
75 in_port=4,dl_type=0x894f,nsh_mdtype=1,nsh_spi=0x1234,nsh_c1=0x11223344 actions=decap(),decap(),output:2
76 ip,in_port=1 actions=encap(nsh(md_type=1)),set_field:0x1234->nsh_spi,set_field:0x11223344->nsh_c1,encap(ethernet),set_field:11:22:33:44:55:66->eth_dst,output:3
77 ])
78
79 # TODO:
80 # The fields nw_proto, nw_tos, nw_ecn, nw_ttl in final flow seem unnecessary. Can they be avoided?
81 # The match on dl_dst=66:77:88:99:aa:bb in the Megaflow is a side effect of setting the dl_dst in the pushed outer
82 # Ethernet header. It is a consequence of using wc->masks both for tracking matched and set bits and seems hard to
83 # avoid except by using separate masks for both purposes.
84
85 AT_CHECK([
86 ovs-appctl ofproto/trace br0 'in_port=1,icmp,dl_src=00:11:22:33:44:55,dl_dst=66:77:88:99:aa:bb,nw_dst=10.10.10.10,nw_src=20.20.20.20'
87 ], [0], [dnl
88 Flow: icmp,in_port=1,vlan_tci=0x0000,dl_src=00:11:22:33:44:55,dl_dst=66:77:88:99:aa:bb,nw_src=20.20.20.20,nw_dst=10.10.10.10,nw_tos=0,nw_ecn=0,nw_ttl=0,icmp_type=0,icmp_code=0
89
90 bridge("br0")
91 -------------
92 0. ip,in_port=1, priority 32768
93 encap(nsh(md_type=1))
94 set_field:0x1234->nsh_spi
95 set_field:0x11223344->nsh_c1
96 encap(ethernet)
97 set_field:11:22:33:44:55:66->eth_dst
98 output:3
99
100 bridge("br0")
101 -------------
102 0. in_port=4,dl_type=0x894f,nsh_mdtype=1,nsh_spi=0x1234,nsh_c1=0x11223344, priority 32768
103 decap()
104 decap()
105
106 Final flow: in_port=1,vlan_tci=0x0000,dl_src=00:00:00:00:00:00,dl_dst=11:22:33:44:55:66,dl_type=0x894f,nsh_flags=0,nsh_mdtype=1,nsh_np=3,nsh_spi=0x1234,nsh_si=255,nsh_c1=0x11223344,nsh_c2=0x0,nsh_c3=0x0,nsh_c4=0x0,nw_proto=0,nw_tos=0,nw_ecn=0,nw_ttl=0
107 Megaflow: recirc_id=0,eth,ip,in_port=1,dl_dst=66:77:88:99:aa:bb,nw_frag=no
108 Datapath actions: encap_nsh(flags=0,mdtype=1,np=3,spi=0x1234,si=255,c1=0x11223344,c2=0x0,c3=0x0,c4=0x0),push_eth(src=00:00:00:00:00:00,dst=11:22:33:44:55:66),pop_eth,decap_nsh(),set(eth(dst=11:22:33:44:55:66)),recirc(0x1)
109 ])
110
111 AT_CHECK([
112 ovs-appctl ofproto/trace br0 'in_port=4,dl_type=0x894f,nsh_mdtype=1,nsh_np=3,nsh_spi=0x1234,nsh_c1=0x11223344'
113 ], [0], [dnl
114 Flow: in_port=4,vlan_tci=0x0000,dl_src=00:00:00:00:00:00,dl_dst=00:00:00:00:00:00,dl_type=0x894f,nsh_flags=0,nsh_mdtype=1,nsh_np=3,nsh_spi=0x1234,nsh_si=0,nsh_c1=0x11223344,nsh_c2=0x0,nsh_c3=0x0,nsh_c4=0x0,nw_proto=0,nw_tos=0,nw_ecn=0,nw_ttl=0
115
116 bridge("br0")
117 -------------
118 0. in_port=4,dl_type=0x894f,nsh_mdtype=1,nsh_spi=0x1234,nsh_c1=0x11223344, priority 32768
119 decap()
120 decap()
121
122 Final flow: unchanged
123 Megaflow: recirc_id=0,eth,in_port=4,dl_type=0x894f,nsh_mdtype=1,nsh_np=3,nsh_spi=0x1234,nsh_c1=0x11223344
124 Datapath actions: pop_eth,decap_nsh(),recirc(0x2)
125 ])
126
127 # Now send two real ICMP echo request packets in on port p1
128
129 AT_CHECK([
130 ovs-appctl netdev-dummy/receive p1 1e2ce92a669e3a6dd2099cab0800450000548a53400040011addc0a80a0ac0a80a1e08006f200a4d0001fc509a58000000002715020000000000101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f3031323334353637
131 ovs-appctl netdev-dummy/receive p1 1e2ce92a669e3a6dd2099cab0800450000548a83400040011aadc0a80a0ac0a80a1e0800b7170a4d0002fd509a5800000000de1c020000000000101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f3031323334353637
132 ], [0], [ignore])
133
134 ovs-appctl time/warp 1000
135
136 # A packet count of 1 in the megaflow entries means the first packet was processed by
137 # the ofproto slow path and the second successfully by the datapath flow entry.
138
139 AT_CHECK([
140 ovs-appctl dpctl/dump-flows dummy@ovs-dummy | strip_used | grep -v ipv6 | sort
141 ], [0], [flow-dump from non-dpdk interfaces:
142 recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth(dst=1e:2c:e9:2a:66:9e),eth_type(0x0800),ipv4(frag=no), packets:1, bytes:98, used:0.0s, actions:encap_nsh(flags=0,mdtype=1,np=3,spi=0x1234,si=255,c1=0x11223344,c2=0x0,c3=0x0,c4=0x0),push_eth(src=00:00:00:00:00:00,dst=11:22:33:44:55:66),pop_eth,decap_nsh(),set(eth(dst=11:22:33:44:55:66)),recirc(0x3)
143 recirc_id(0x3),in_port(1),packet_type(ns=0,id=0),eth_type(0x0800),ipv4(frag=no), packets:1, bytes:98, used:0.0s, actions:2
144 ])
145
146 # Verify, that VLAN tagged packets can be encapsulated by NSH header.
147 ovs-appctl time/warp 10000
148
149 AT_DATA([flows.txt], [dnl
150 table=0,in_port=1,actions=push_vlan:0x8100,mod_vlan_vid:100,3
151 table=0,in_port=4,actions=encap(nsh),decap(),2
152 ])
153
154 AT_CHECK([
155 ovs-ofctl del-flows br0
156 ovs-ofctl -Oopenflow13 add-flows br0 flows.txt
157 ovs-ofctl -Oopenflow13 dump-flows br0 | ofctl_strip | sort | grep actions
158 ], [0], [dnl
159 in_port=1 actions=push_vlan:0x8100,set_field:4196->vlan_vid,output:3
160 in_port=4 actions=encap(nsh),decap(),output:2
161 ])
162
163 AT_CHECK([
164 ovs-appctl netdev-dummy/receive p1 1e2ce92a669e3a6dd2099cab0800450000548a53400040011addc0a80a0ac0a80a1e08006f200a4d0001fc509a58000000002715020000000000101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f3031323334353637
165 ovs-appctl netdev-dummy/receive p1 1e2ce92a669e3a6dd2099cab0800450000548a83400040011aadc0a80a0ac0a80a1e0800b7170a4d0002fd509a5800000000de1c020000000000101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f3031323334353637
166 ], [0], [ignore])
167
168 ovs-appctl time/warp 1000
169
170 AT_CHECK([
171 ovs-appctl dpctl/dump-flows dummy@ovs-dummy | strip_used | grep -v ipv6 | sort
172 ], [0], [flow-dump from non-dpdk interfaces:
173 recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth_type(0x0800),ipv4(frag=no), packets:1, bytes:98, used:0.0s, actions:push_vlan(vid=100,pcp=0),encap_nsh(flags=0,mdtype=1,np=3,spi=0x0,si=255,c1=0x0,c2=0x0,c3=0x0,c4=0x0),decap_nsh(),recirc(0x4)
174 recirc_id(0x4),in_port(1),packet_type(ns=0,id=0),eth_type(0x8100),vlan(vid=100,pcp=0),encap(eth_type(0x0800),ipv4(frag=no)), packets:1, bytes:102, used:0.0s, actions:2
175 ])
176
177 OVS_VSWITCHD_STOP
178 AT_CLEANUP
179
180
181 ### -----------------------------------------------------------------
182 ### NSH MD2 on Ethernet encapsulation over veth link
183 ### -----------------------------------------------------------------
184
185 AT_SETUP([nsh - md2 encap over a veth link])
186
187 OVS_VSWITCHD_START([])
188
189 AT_CHECK([
190 ovs-vsctl set bridge br0 datapath_type=dummy \
191 protocols=OpenFlow10,OpenFlow13,OpenFlow14,OpenFlow15 -- \
192 add-port br0 p1 -- set Interface p1 type=dummy ofport_request=1 -- \
193 add-port br0 p2 -- set Interface p2 type=dummy ofport_request=2 -- \
194 add-port br0 v3 -- set Interface v3 type=patch options:peer=v4 ofport_request=3 -- \
195 add-port br0 v4 -- set Interface v4 type=patch options:peer=v3 ofport_request=4])
196
197 AT_DATA([flows.txt], [dnl
198 table=0,in_port=1,ip,actions=encap(nsh(md_type=2,tlv(0x1000,10,0x12345678))),set_field:0x1234->nsh_spi,encap(ethernet),set_field:11:22:33:44:55:66->dl_dst,3
199 table=0,in_port=4,dl_type=0x894f,nsh_mdtype=2,nsh_spi=0x1234,actions=decap(),decap(),2
200 ])
201
202 AT_CHECK([
203 ovs-ofctl del-flows br0
204 ovs-ofctl -Oopenflow13 add-flows br0 flows.txt
205 ovs-ofctl -Oopenflow13 dump-flows br0 | ofctl_strip | sort | grep actions
206 ], [0], [dnl
207 in_port=4,dl_type=0x894f,nsh_mdtype=2,nsh_spi=0x1234 actions=decap(),decap(),output:2
208 ip,in_port=1 actions=encap(nsh(md_type=2,tlv(0x1000,10,0x12345678))),set_field:0x1234->nsh_spi,encap(ethernet),set_field:11:22:33:44:55:66->eth_dst,output:3
209 ])
210
211 AT_CHECK([
212 ovs-appctl ofproto/trace br0 'in_port=1,icmp,dl_src=00:11:22:33:44:55,dl_dst=66:77:88:99:aa:bb,nw_dst=10.10.10.10,nw_src=20.20.20.20'
213 ], [0], [dnl
214 Flow: icmp,in_port=1,vlan_tci=0x0000,dl_src=00:11:22:33:44:55,dl_dst=66:77:88:99:aa:bb,nw_src=20.20.20.20,nw_dst=10.10.10.10,nw_tos=0,nw_ecn=0,nw_ttl=0,icmp_type=0,icmp_code=0
215
216 bridge("br0")
217 -------------
218 0. ip,in_port=1, priority 32768
219 encap(nsh(md_type=2,tlv(0x1000,10,0x12345678)))
220 set_field:0x1234->nsh_spi
221 encap(ethernet)
222 set_field:11:22:33:44:55:66->eth_dst
223 output:3
224
225 bridge("br0")
226 -------------
227 0. in_port=4,dl_type=0x894f,nsh_mdtype=2,nsh_spi=0x1234, priority 32768
228 decap()
229 decap()
230
231 Final flow: in_port=1,vlan_tci=0x0000,dl_src=00:00:00:00:00:00,dl_dst=11:22:33:44:55:66,dl_type=0x894f,nsh_flags=0,nsh_mdtype=2,nsh_np=3,nsh_spi=0x1234,nsh_si=255,nw_proto=0,nw_tos=0,nw_ecn=0,nw_ttl=0
232 Megaflow: recirc_id=0,eth,ip,in_port=1,dl_dst=66:77:88:99:aa:bb,nw_frag=no
233 Datapath actions: encap_nsh(flags=0,mdtype=2,np=3,spi=0x1234,si=255,md2=0x10000a0412345678),push_eth(src=00:00:00:00:00:00,dst=11:22:33:44:55:66),pop_eth,decap_nsh(),set(eth(dst=11:22:33:44:55:66)),recirc(0x1)
234 ])
235
236 AT_CHECK([
237 ovs-appctl ofproto/trace br0 'in_port=4,dl_type=0x894f,nsh_mdtype=2,nsh_np=3,nsh_spi=0x1234'
238 ], [0], [dnl
239 Flow: in_port=4,vlan_tci=0x0000,dl_src=00:00:00:00:00:00,dl_dst=00:00:00:00:00:00,dl_type=0x894f,nsh_flags=0,nsh_mdtype=2,nsh_np=3,nsh_spi=0x1234,nsh_si=0,nw_proto=0,nw_tos=0,nw_ecn=0,nw_ttl=0
240
241 bridge("br0")
242 -------------
243 0. in_port=4,dl_type=0x894f,nsh_mdtype=2,nsh_spi=0x1234, priority 32768
244 decap()
245 decap()
246
247 Final flow: unchanged
248 Megaflow: recirc_id=0,eth,in_port=4,dl_type=0x894f,nsh_mdtype=2,nsh_np=3,nsh_spi=0x1234
249 Datapath actions: pop_eth,decap_nsh(),recirc(0x2)
250 ])
251
252 # Now send two real ICMP echo request packets in on port p1
253
254 AT_CHECK([
255 ovs-appctl netdev-dummy/receive p1 1e2ce92a669e3a6dd2099cab0800450000548a53400040011addc0a80a0ac0a80a1e08006f200a4d0001fc509a58000000002715020000000000101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f3031323334353637
256 ovs-appctl netdev-dummy/receive p1 1e2ce92a669e3a6dd2099cab0800450000548a83400040011aadc0a80a0ac0a80a1e0800b7170a4d0002fd509a5800000000de1c020000000000101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f3031323334353637
257 ], [0], [ignore])
258
259 ovs-appctl time/warp 1000
260
261 # A packet count of 1 in the megaflow entries means the first packet was processed by
262 # the ofproto slow path and the second successfully by the datapath flow entry.
263
264 AT_CHECK([
265 ovs-appctl dpctl/dump-flows dummy@ovs-dummy | strip_used | grep -v ipv6 | sort
266 ], [0], [flow-dump from non-dpdk interfaces:
267 recirc_id(0),in_port(1),packet_type(ns=0,id=0),eth(dst=1e:2c:e9:2a:66:9e),eth_type(0x0800),ipv4(frag=no), packets:1, bytes:98, used:0.0s, actions:encap_nsh(flags=0,mdtype=2,np=3,spi=0x1234,si=255,md2=0x10000a0412345678),push_eth(src=00:00:00:00:00:00,dst=11:22:33:44:55:66),pop_eth,decap_nsh(),set(eth(dst=11:22:33:44:55:66)),recirc(0x3)
268 recirc_id(0x3),in_port(1),packet_type(ns=0,id=0),eth_type(0x0800),ipv4(frag=no), packets:1, bytes:98, used:0.0s, actions:2
269 ])
270
271
272 OVS_VSWITCHD_STOP
273 AT_CLEANUP
274
275
276 ### -----------------------------------------------------------------
277 ### Triangle bridge setup with VXLAN-GPE tunnels
278 ### -----------------------------------------------------------------
279
280 ########################
281 # VxLAN-gpe + NSH tunneling test setup for PTAP bridge
282 #
283 # 192.168.10.10 192.168.10.20 192.168.10.30
284 # n1 n2 n3
285 # |ovs-n1 |ovs-n2 |ovs-n3
286 # +------o------+ +------o------+ +------o------+
287 # | br-in1 | | br-in2 | | br-in3 |
288 # | (PTAP) | | (PTAP) | | (PTAP) |
289 # +------o------+ +------o------+ +------o------+
290 # vxlan-gpe vxlan-gpe vxlan-gpe
291 # 10.0.0.1 (10.0.0.2) (10.0.0.3)
292 # (20.0.0.1) 20.0.0.2 (20.0.0.3)
293 # (30.0.0.1) LOCAL (30.0.0.2) LOCAL 30.0.0.3 LOCAL
294 # +-----------o-+ +-----------o-+ +-----------o-+
295 # | br-p1 | | br-p2 | | br-p3 |
296 # +------o------+ +------o------+ +------o------+
297 # p1-0 | | p2-0 | p3-0
298 # p0-1 | | p0-2 | p0-3
299 # +--o------------------------o-------------------------o--+
300 # | br0 |
301 # +--------------------------------------------------------+
302 #
303 # VxLAN-gpe tunnel ports:
304 #
305 # No Bridge Name Packet-type Remote bridge & ports
306 # -----------------------------------------------------------------------
307 # 1020 br-in1 vxlangpe12 ptap br-in2 2010 (ptap)
308 # 1030 br-in1 vxlangpe13 ptap br-in3 3010 (ptap)
309 # 2010 br-in2 vxlangpe21 ptap br-in1 1020 (ptap)
310 # 2030 br-in2 vxlangpe13 ptap br-in3 3020 (ptap)
311 # 3010 br-in1 vxlangpe31 ptap br-in1 1030 (ptap)
312 # 3020 br-in1 vxlangpe32 ptap br-in2 2010 (ptap)
313
314 AT_SETUP([nsh - triangle PTAP bridge setup with NSH over vxlan-gpe])
315
316 OVS_VSWITCHD_START([])
317
318 HWADDR_BRP1=aa:55:00:00:00:01
319 HWADDR_BRP2=aa:55:00:00:00:02
320 HWADDR_BRP3=aa:55:00:00:00:03
321
322 # Setup bridge infrastructure
323 AT_CHECK([
324 ovs-vsctl add-br br-in1 -- \
325 set bridge br-in1 datapath_type=dummy fail-mode=standalone
326 ovs-vsctl add-br br-in2 -- \
327 set bridge br-in2 datapath_type=dummy fail-mode=standalone
328 ovs-vsctl add-br br-in3 -- \
329 set bridge br-in3 datapath_type=dummy fail-mode=standalone
330 ovs-vsctl add-br br-p1 -- \
331 set bridge br-p1 datapath_type=dummy fail-mode=standalone other-config:hwaddr=$HWADDR_BRP1
332 ovs-vsctl add-br br-p2 -- \
333 set bridge br-p2 datapath_type=dummy fail-mode=standalone other-config:hwaddr=$HWADDR_BRP2
334 ovs-vsctl add-br br-p3 -- \
335 set bridge br-p3 datapath_type=dummy fail-mode=standalone other-config:hwaddr=$HWADDR_BRP3
336
337 ovs-vsctl add-port br-p1 p1-0 -- set interface p1-0 type=patch options:peer=p0-1 ofport_request=2
338 ovs-vsctl add-port br-p2 p2-0 -- set interface p2-0 type=patch options:peer=p0-2 ofport_request=2
339 ovs-vsctl add-port br-p3 p3-0 -- set interface p3-0 type=patch options:peer=p0-3 ofport_request=2
340 ovs-vsctl add-port br0 p0-1 -- set interface p0-1 type=patch options:peer=p1-0 ofport_request=10
341 ovs-vsctl add-port br0 p0-2 -- set interface p0-2 type=patch options:peer=p2-0 ofport_request=20
342 ovs-vsctl add-port br0 p0-3 -- set interface p0-3 type=patch options:peer=p3-0 ofport_request=30
343
344 # Populate the MAC table of br0
345 ovs-ofctl del-flows br0
346 ovs-ofctl add-flow br0 dl_dst=$HWADDR_BRP1,actions=10
347 ovs-ofctl add-flow br0 dl_dst=$HWADDR_BRP2,actions=20
348 ovs-ofctl add-flow br0 dl_dst=$HWADDR_BRP3,actions=30
349
350 ovs-ofctl del-flows br-in1
351 ovs-ofctl del-flows br-in2
352 ovs-ofctl del-flows br-in3
353 ovs-ofctl del-flows br-p1
354 ovs-ofctl del-flows br-p2
355 ovs-ofctl del-flows br-p3
356 ], [0])
357
358 ### Setup vxlan-gpe tunnels
359 AT_CHECK([
360 ovs-vsctl add-port br-in1 vxlangpe12 -- \
361 set interface vxlangpe12 type=vxlan options:exts=gpe options:remote_ip=10.0.0.2 options:packet_type=ptap ofport_request=1020
362 ovs-vsctl add-port br-in1 vxlangpe13 -- \
363 set interface vxlangpe13 type=vxlan options:exts=gpe options:remote_ip=10.0.0.3 options:packet_type=ptap ofport_request=1030
364
365 ovs-vsctl add-port br-in2 vxlangpe21 -- \
366 set interface vxlangpe21 type=vxlan options:exts=gpe options:remote_ip=20.0.0.1 options:packet_type=ptap ofport_request=2010
367 ovs-vsctl add-port br-in2 vxlangpe23 -- \
368 set interface vxlangpe23 type=vxlan options:exts=gpe options:remote_ip=20.0.0.3 options:packet_type=ptap ofport_request=2030
369
370 ovs-vsctl add-port br-in3 vxlangpe31 -- \
371 set interface vxlangpe31 type=vxlan options:exts=gpe options:remote_ip=30.0.0.1 options:packet_type=ptap ofport_request=3010
372 ovs-vsctl add-port br-in3 vxlangpe32 -- \
373 set interface vxlangpe32 type=vxlan options:exts=gpe options:remote_ip=30.0.0.2 options:packet_type=ptap ofport_request=3020
374
375 ovs-appctl netdev-dummy/ip4addr br-p1 10.0.0.1/24
376 ovs-appctl ovs/route/add 10.0.0.0/24 br-p1
377 ovs-appctl tnl/arp/set br-p1 10.0.0.1 $HWADDR_BRP1
378 ovs-appctl tnl/arp/set br-p1 10.0.0.2 $HWADDR_BRP2
379 ovs-appctl tnl/arp/set br-p1 10.0.0.3 $HWADDR_BRP3
380
381 ovs-appctl netdev-dummy/ip4addr br-p2 20.0.0.2/24
382 ovs-appctl ovs/route/add 20.0.0.0/24 br-p2
383 ovs-appctl tnl/arp/set br-p2 20.0.0.1 $HWADDR_BRP1
384 ovs-appctl tnl/arp/set br-p2 20.0.0.2 $HWADDR_BRP2
385 ovs-appctl tnl/arp/set br-p2 20.0.0.3 $HWADDR_BRP3
386
387 ovs-appctl netdev-dummy/ip4addr br-p3 30.0.0.3/24
388 ovs-appctl ovs/route/add 30.0.0.0/24 br-p3
389 ovs-appctl tnl/arp/set br-p3 30.0.0.1 $HWADDR_BRP1
390 ovs-appctl tnl/arp/set br-p3 30.0.0.2 $HWADDR_BRP2
391 ovs-appctl tnl/arp/set br-p3 30.0.0.3 $HWADDR_BRP3
392 ], [0], [stdout])
393
394 AT_CHECK([
395 ovs-appctl ovs/route/add 10.0.0.0/24 br-p1
396 ovs-appctl tnl/arp/set br-p1 10.0.0.1 $HWADDR_BRP1
397 ovs-appctl tnl/arp/set br-p1 10.0.0.2 $HWADDR_BRP2
398 ovs-appctl tnl/arp/set br-p1 10.0.0.3 $HWADDR_BRP3
399 ], [0], [stdout])
400
401 AT_CHECK([
402 ovs-appctl ovs/route/add 20.0.0.0/24 br-p2
403 ovs-appctl tnl/arp/set br-p2 20.0.0.1 $HWADDR_BRP1
404 ovs-appctl tnl/arp/set br-p2 20.0.0.2 $HWADDR_BRP2
405 ovs-appctl tnl/arp/set br-p2 20.0.0.3 $HWADDR_BRP3
406 ], [0], [stdout])
407
408 AT_CHECK([
409 ovs-appctl ovs/route/add 30.0.0.0/24 br-p3
410 ovs-appctl tnl/arp/set br-p3 30.0.0.1 $HWADDR_BRP1
411 ovs-appctl tnl/arp/set br-p3 30.0.0.2 $HWADDR_BRP2
412 ovs-appctl tnl/arp/set br-p3 30.0.0.3 $HWADDR_BRP3
413 ], [0], [stdout])
414
415 AT_CHECK([
416 ovs-appctl ovs/route/show | grep User:
417 ], [0], [dnl
418 User: 10.0.0.0/24 dev br-p1 SRC 10.0.0.1
419 User: 20.0.0.0/24 dev br-p2 SRC 20.0.0.2
420 User: 30.0.0.0/24 dev br-p3 SRC 30.0.0.3
421 ])
422
423 AT_CHECK([
424 ovs-appctl tnl/neigh/show | grep br-p | sort
425 ], [0], [stdout])
426
427
428 ### Flows in br-p<x>to twist TEP IP addresses in tunnel IP headers
429 AT_CHECK([
430 ovs-ofctl add-flow br-p1 in_port:LOCAL,actions=2
431 ovs-ofctl add-flow br-p1 in_port:2,ip,nw_dst:20.0.0.1,actions=mod_nw_dst:10.0.0.1,mod_nw_src:10.0.0.2,LOCAL
432 ovs-ofctl add-flow br-p1 in_port:2,ip,nw_dst:30.0.0.1,actions=mod_nw_dst:10.0.0.1,mod_nw_src:10.0.0.3,LOCAL
433
434 ovs-ofctl add-flow br-p2 in_port:LOCAL,actions=2
435 ovs-ofctl add-flow br-p2 in_port:2,ip,nw_dst:10.0.0.2,actions=mod_nw_dst:20.0.0.2,mod_nw_src:20.0.0.1,LOCAL
436 ovs-ofctl add-flow br-p2 in_port:2,ip,nw_dst:30.0.0.2,actions=mod_nw_dst:20.0.0.2,mod_nw_src:20.0.0.3,LOCAL
437
438 ovs-ofctl add-flow br-p3 in_port:LOCAL,actions=2
439 ovs-ofctl add-flow br-p3 in_port:2,ip,nw_dst:10.0.0.3,actions=mod_nw_dst:30.0.0.3,mod_nw_src:30.0.0.1,LOCAL
440 ovs-ofctl add-flow br-p3 in_port:2,ip,nw_dst:20.0.0.3,actions=mod_nw_dst:30.0.0.3,mod_nw_src:30.0.0.2,LOCAL
441 ], [0])
442
443 AT_CHECK([
444 ovs-ofctl dump-flows br-p1 | ofctl_strip | sort | grep actions
445 ovs-ofctl dump-flows br-p2 | ofctl_strip | sort | grep actions
446 ovs-ofctl dump-flows br-p3 | ofctl_strip | sort | grep actions
447 ], [0], [dnl
448 in_port=LOCAL actions=output:2
449 ip,in_port=2,nw_dst=20.0.0.1 actions=mod_nw_dst:10.0.0.1,mod_nw_src:10.0.0.2,LOCAL
450 ip,in_port=2,nw_dst=30.0.0.1 actions=mod_nw_dst:10.0.0.1,mod_nw_src:10.0.0.3,LOCAL
451 in_port=LOCAL actions=output:2
452 ip,in_port=2,nw_dst=10.0.0.2 actions=mod_nw_dst:20.0.0.2,mod_nw_src:20.0.0.1,LOCAL
453 ip,in_port=2,nw_dst=30.0.0.2 actions=mod_nw_dst:20.0.0.2,mod_nw_src:20.0.0.3,LOCAL
454 in_port=LOCAL actions=output:2
455 ip,in_port=2,nw_dst=10.0.0.3 actions=mod_nw_dst:30.0.0.3,mod_nw_src:30.0.0.1,LOCAL
456 ip,in_port=2,nw_dst=20.0.0.3 actions=mod_nw_dst:30.0.0.3,mod_nw_src:30.0.0.2,LOCAL
457 ])
458
459 ### Setup test ports for traffic injection
460 N1_IP=192.168.10.10
461 N2_IP=192.168.10.20
462 N3_IP=192.168.10.30
463 N1_MAC=aa:55:aa:55:00:01
464 N2_MAC=aa:55:aa:55:00:02
465 N3_MAC=aa:55:aa:55:00:03
466 N1_OFPORT=10
467 N2_OFPORT=20
468 N3_OFPORT=30
469
470 AT_CHECK([
471 ovs-vsctl add-port br-in1 n1 -- \
472 set interface n1 type=dummy ofport_request=$N1_OFPORT options:tx_pcap=n1.pcap
473 ovs-vsctl add-port br-in2 n2 -- \
474 set interface n2 type=dummy ofport_request=$N2_OFPORT options:tx_pcap=n2.pcap
475 ovs-vsctl add-port br-in3 n3 -- \
476 set interface n3 type=dummy ofport_request=$N3_OFPORT options:tx_pcap=n3.pcap
477 ], [0])
478
479 #N1_DPPORT=$(ovs-appctl dpif/show | grep "n1 10" | sed 's|.*/\([[0-9]]*\):.*|\1|')
480 #N2_DPPORT=$(ovs-appctl dpif/show | grep "n2 20" | sed 's|.*/\([[0-9]]*\):.*|\1|')
481 #N3_DPPORT=$(ovs-appctl dpif/show | grep "n3 30" | sed 's|.*/\([[0-9]]*\):.*|\1|')
482
483 ### Verify datapath configuration
484 AT_CHECK([
485 ovs-appctl dpif/show | grep -v hit | sed 's/\t/ /g'
486 ], [0], [dnl
487 br-in1:
488 br-in1 65534/101: (dummy-internal)
489 n1 10/4: (dummy)
490 vxlangpe12 1020/4789: (vxlan: packet_type=ptap, remote_ip=10.0.0.2)
491 vxlangpe13 1030/4789: (vxlan: packet_type=ptap, remote_ip=10.0.0.3)
492 br-in2:
493 br-in2 65534/102: (dummy-internal)
494 n2 20/5: (dummy)
495 vxlangpe21 2010/4789: (vxlan: packet_type=ptap, remote_ip=20.0.0.1)
496 vxlangpe23 2030/4789: (vxlan: packet_type=ptap, remote_ip=20.0.0.3)
497 br-in3:
498 br-in3 65534/103: (dummy-internal)
499 n3 30/6: (dummy)
500 vxlangpe31 3010/4789: (vxlan: packet_type=ptap, remote_ip=30.0.0.1)
501 vxlangpe32 3020/4789: (vxlan: packet_type=ptap, remote_ip=30.0.0.2)
502 br-p1:
503 br-p1 65534/1: (dummy-internal)
504 p1-0 2/none: (patch: peer=p0-1)
505 br-p2:
506 br-p2 65534/2: (dummy-internal)
507 p2-0 2/none: (patch: peer=p0-2)
508 br-p3:
509 br-p3 65534/3: (dummy-internal)
510 p3-0 2/none: (patch: peer=p0-3)
511 br0:
512 br0 65534/100: (dummy-internal)
513 p0-1 10/none: (patch: peer=p1-0)
514 p0-2 20/none: (patch: peer=p2-0)
515 p0-3 30/none: (patch: peer=p3-0)
516 ])
517
518 ### Setup SFC flow configuration
519
520 # br-in1 is SFC classifier (table 1) and final SFF (tables 2,3)
521 AT_DATA([br-in1.txt], [dnl
522 table=0,in_port=10,ip,actions=decap(),goto_table:1
523 table=0,in_port=10,packet_type=(1,0x800),actions=goto_table:1
524 table=0,in_port=1020,packet_type=(1,0x894f),actions=goto_table:2
525 table=0,in_port=1030,packet_type=(1,0x894f),actions=goto_table:2
526 table=1,priority=32,packet_type=(1,0x800),nw_dst=192.168.10.30,actions=encap(nsh(md_type=1)),set_field:0x3000->nsh_spi,output:1030
527 table=1,priority=0,packet_type=(1,0x800),nw_dst=0.0.0.0/0,actions=encap(nsh(md_type=1)),set_field:0x3020->nsh_spi,output:1020
528 table=2,packet_type=(1,0x894f),nsh_spi=0x1000,nsh_si=255,actions=decap(),goto_table:3
529 table=2,packet_type=(1,0x894f),nsh_spi=0x1020,nsh_si=254,actions=decap(),goto_table:3
530 table=3,ip,actions=set_field:aa:55:aa:55:00:01->dl_dst,output:10
531 table=3,packet_type=(1,0x800),actions=encap(ethernet),set_field:aa:55:aa:55:00:01->dl_dst,output:10
532 ])
533
534 # br-in2 is intermediate SFF (table 2) and simulated SF (table 4)
535 AT_DATA([br-in2.txt], [dnl
536 table=0,in_port=2010,packet_type=(1,0x894f),actions=goto_table:2
537 table=0,in_port=2030,packet_type=(1,0x894f),actions=goto_table:2
538 table=2,packet_type=(1,0x894f),nsh_spi=0x3020,nsh_si=255,actions=encap(ethernet),set_field:11:22:33:44:55:66->dl_dst,goto_table:4
539 table=2,packet_type=(1,0x894f),nsh_spi=0x3020,nsh_si=254,actions=output:2030
540 table=2,packet_type=(1,0x894f),nsh_spi=0x1020,nsh_si=255,actions=encap(ethernet),set_field:77:88:99:aa:bb:cc->dl_dst,goto_table:4
541 table=2,packet_type=(1,0x894f),nsh_spi=0x1020,nsh_si=254,actions=output:2010
542 table=4,dl_type=0x894f,dl_dst=11:22:33:44:55:66,actions=set_field:254->nsh_si,decap(),resubmit(,2)
543 table=4,dl_type=0x894f,dl_dst=77:88:99:aa:bb:cc,actions=set_field:254->nsh_si,decap(),resubmit(,2)
544 ])
545
546 # br-in3 is SFC classifier (table 1) and final SFF (tables 2,3)
547 AT_DATA([br-in3.txt], [dnl
548 table=0,in_port=30,ip,actions=decap(),goto_table:1
549 table=0,in_port=30,packet_type=(1,0x800),actions=goto_table:1
550 table=0,in_port=3010,packet_type=(1,0x894f),actions=goto_table:2
551 table=0,in_port=3020,packet_type=(1,0x894f),actions=goto_table:2
552 table=1,priority=32,packet_type=(1,0x800),nw_dst=192.168.10.10,actions=encap(nsh(md_type=1)),set_field:0x1000->nsh_spi,3010
553 table=1,priority=0,packet_type=(1,0x800),nw_dst=0.0.0.0/0,actions=encap(nsh(md_type=1)),set_field:0x1020->nsh_spi,3020
554 table=2,packet_type=(1,0x894f),nsh_spi=0x3000,nsh_si=255,actions=decap(),goto_table:3
555 table=2,packet_type=(1,0x894f),nsh_spi=0x3020,nsh_si=254,actions=decap(),goto_table:3
556 table=3,ip,actions=set_field:aa:55:aa:55:00:03->dl_dst,output:30
557 table=3,packet_type=(1,0x800),actions=encap(ethernet),set_field:aa:55:aa:55:00:03->dl_dst,output:30
558 ])
559
560 AT_CHECK([
561 ovs-ofctl -Oopenflow13 add-flows br-in1 br-in1.txt
562 ovs-ofctl -Oopenflow13 add-flows br-in2 br-in2.txt
563 ovs-ofctl -Oopenflow13 add-flows br-in3 br-in3.txt
564 ])
565
566 ### Inject ICMP Echo request test packets
567
568 # N1 to N3, via the direct SF path with spi 0x3000
569 AT_CHECK([
570 ovs-appctl netdev-dummy/receive n1 1e2ce92a669e3a6dd2099cab0800450000548a53400040011addc0a80a0ac0a80a1e08006f200a4d0001fc509a58000000002715020000000000101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f3031323334353637
571 ovs-appctl netdev-dummy/receive n1 1e2ce92a669e3a6dd2099cab0800450000548a83400040011aadc0a80a0ac0a80a1e0800b7170a4d0002fd509a5800000000de1c020000000000101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f3031323334353637
572 ], [0], [ignore])
573
574 ovs-appctl time/warp 1000
575 ovs-appctl time/warp 1000
576
577 AT_CHECK([
578 ovs-appctl dpctl/dump-flows dummy@ovs-dummy | strip_used | grep -v ipv6 | sort
579 ], [0], [flow-dump from non-dpdk interfaces:
580 recirc_id(0),in_port(4),packet_type(ns=0,id=0),eth_type(0x0800),ipv4(dst=192.168.10.30,frag=no), packets:1, bytes:98, used:0.0s, actions:pop_eth,encap_nsh(flags=0,mdtype=1,np=1,spi=0x3000,si=255,c1=0x0,c2=0x0,c3=0x0,c4=0x0),clone(tnl_push(tnl_port(4789),header(size=50,type=4,eth(dst=aa:55:00:00:00:03,src=aa:55:00:00:00:01,dl_type=0x0800),ipv4(src=10.0.0.1,dst=10.0.0.3,proto=17,tos=0,ttl=64,frag=0x4000),udp(src=0,dst=4789,csum=0x0),vxlan(flags=0xc000004,vni=0x0)),out_port(1)),set(ipv4(src=30.0.0.1,dst=30.0.0.3)),tnl_pop(4789))
581 tunnel(tun_id=0x0,src=30.0.0.1,dst=30.0.0.3,flags(-df-csum+key)),recirc_id(0),in_port(4789),packet_type(ns=1,id=0x894f),nsh(np=1,spi=0x3000,si=255), packets:1, bytes:108, used:0.0s, actions:decap_nsh(),recirc(0x1)
582 tunnel(tun_id=0x0,src=30.0.0.1,dst=30.0.0.3,flags(-df-csum+key)),recirc_id(0x1),in_port(4789),packet_type(ns=1,id=0x800),ipv4(frag=no), packets:1, bytes:84, used:0.0s, actions:push_eth(src=00:00:00:00:00:00,dst=aa:55:aa:55:00:03),6
583 ])
584
585 AT_CHECK([
586 ovs-ofctl -Oopenflow13 dump-flows br-in1 | ofctl_strip | sort | grep actions
587 ovs-ofctl -Oopenflow13 dump-flows br-in2 | ofctl_strip | sort | grep actions
588 ovs-ofctl -Oopenflow13 dump-flows br-in3 | ofctl_strip | sort | grep actions
589 ], [0], [dnl
590 n_packets=2, n_bytes=196, ip,in_port=10 actions=decap(),goto_table:1
591 packet_type=(1,0x800),in_port=10 actions=goto_table:1
592 packet_type=(1,0x894f),in_port=1020 actions=goto_table:2
593 packet_type=(1,0x894f),in_port=1030 actions=goto_table:2
594 table=1, n_packets=2, n_bytes=196, priority=32,packet_type=(1,0x800),nw_dst=192.168.10.30 actions=encap(nsh(md_type=1)),set_field:0x3000->nsh_spi,output:1030
595 table=1, priority=0,packet_type=(1,0x800) actions=encap(nsh(md_type=1)),set_field:0x3020->nsh_spi,output:1020
596 table=2, packet_type=(1,0x894f),nsh_spi=0x1000,nsh_si=255 actions=decap(),goto_table:3
597 table=2, packet_type=(1,0x894f),nsh_spi=0x1020,nsh_si=254 actions=decap(),goto_table:3
598 table=3, ip actions=set_field:aa:55:aa:55:00:01->eth_dst,output:10
599 table=3, packet_type=(1,0x800) actions=encap(ethernet),set_field:aa:55:aa:55:00:01->eth_dst,output:10
600 packet_type=(1,0x894f),in_port=2010 actions=goto_table:2
601 packet_type=(1,0x894f),in_port=2030 actions=goto_table:2
602 table=2, packet_type=(1,0x894f),nsh_spi=0x1020,nsh_si=254 actions=output:2010
603 table=2, packet_type=(1,0x894f),nsh_spi=0x1020,nsh_si=255 actions=encap(ethernet),set_field:77:88:99:aa:bb:cc->eth_dst,goto_table:4
604 table=2, packet_type=(1,0x894f),nsh_spi=0x3020,nsh_si=254 actions=output:2030
605 table=2, packet_type=(1,0x894f),nsh_spi=0x3020,nsh_si=255 actions=encap(ethernet),set_field:11:22:33:44:55:66->eth_dst,goto_table:4
606 table=4, dl_dst=11:22:33:44:55:66,dl_type=0x894f actions=set_field:254->nsh_si,decap(),resubmit(,2)
607 table=4, dl_dst=77:88:99:aa:bb:cc,dl_type=0x894f actions=set_field:254->nsh_si,decap(),resubmit(,2)
608 ip,in_port=30 actions=decap(),goto_table:1
609 n_packets=2, n_bytes=216, packet_type=(1,0x894f),in_port=3010 actions=goto_table:2
610 packet_type=(1,0x800),in_port=30 actions=goto_table:1
611 packet_type=(1,0x894f),in_port=3020 actions=goto_table:2
612 table=1, priority=0,packet_type=(1,0x800) actions=encap(nsh(md_type=1)),set_field:0x1020->nsh_spi,output:3020
613 table=1, priority=32,packet_type=(1,0x800),nw_dst=192.168.10.10 actions=encap(nsh(md_type=1)),set_field:0x1000->nsh_spi,output:3010
614 table=2, n_packets=2, n_bytes=216, packet_type=(1,0x894f),nsh_spi=0x3000,nsh_si=255 actions=decap(),goto_table:3
615 table=2, packet_type=(1,0x894f),nsh_spi=0x3020,nsh_si=254 actions=decap(),goto_table:3
616 table=3, ip actions=set_field:aa:55:aa:55:00:03->eth_dst,output:30
617 table=3, n_packets=2, n_bytes=168, packet_type=(1,0x800) actions=encap(ethernet),set_field:aa:55:aa:55:00:03->eth_dst,output:30
618 ])
619
620 # Clear up megaflow cache
621 ovs-appctl time/warp 11000
622
623 # N1 to some other IP destination (192.168.10.20), via the indirect SF path with spi 0x3020
624 AT_CHECK([
625 ovs-appctl netdev-dummy/receive n1 461e7d1a95a13a6dd2099cab080045000054500b40004001552fc0a80a0ac0a80a140800531f09a90001e9509a580000000055ba030000000000101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f3031323334353637
626 ovs-appctl netdev-dummy/receive n1 461e7d1a95a13a6dd2099cab08004500005450934000400154a7c0a80a0ac0a80a140800f41d09a90002ea509a5800000000b3ba030000000000101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f3031323334353637], [0], [ignore])
627
628 ovs-appctl time/warp 1000
629 ovs-appctl time/warp 1000
630
631 AT_CHECK([
632 ovs-appctl dpctl/dump-flows dummy@ovs-dummy | strip_used | grep -v ipv6 | sort
633 ], [0], [flow-dump from non-dpdk interfaces:
634 recirc_id(0),in_port(4),packet_type(ns=0,id=0),eth_type(0x0800),ipv4(dst=192.168.10.20/255.255.255.248,frag=no), packets:1, bytes:98, used:0.0s, actions:pop_eth,encap_nsh(flags=0,mdtype=1,np=1,spi=0x3020,si=255,c1=0x0,c2=0x0,c3=0x0,c4=0x0),clone(tnl_push(tnl_port(4789),header(size=50,type=4,eth(dst=aa:55:00:00:00:02,src=aa:55:00:00:00:01,dl_type=0x0800),ipv4(src=10.0.0.1,dst=10.0.0.2,proto=17,tos=0,ttl=64,frag=0x4000),udp(src=0,dst=4789,csum=0x0),vxlan(flags=0xc000004,vni=0x0)),out_port(1)),set(ipv4(src=20.0.0.1,dst=20.0.0.2)),tnl_pop(4789))
635 tunnel(tun_id=0x0,src=20.0.0.1,dst=20.0.0.2,flags(-df-csum+key)),recirc_id(0),in_port(4789),packet_type(ns=1,id=0x894f),nsh(spi=0x3020,si=255), packets:1, bytes:108, used:0.0s, actions:push_eth(src=00:00:00:00:00:00,dst=11:22:33:44:55:66),set(nsh(spi=0x3020,si=254)),pop_eth,clone(tnl_push(tnl_port(4789),header(size=50,type=4,eth(dst=aa:55:00:00:00:03,src=aa:55:00:00:00:02,dl_type=0x0800),ipv4(src=20.0.0.2,dst=20.0.0.3,proto=17,tos=0,ttl=64,frag=0x4000),udp(src=0,dst=4789,csum=0x0),vxlan(flags=0xc000004,vni=0x0)),out_port(2)),set(ipv4(src=30.0.0.2,dst=30.0.0.3)),tnl_pop(4789))
636 tunnel(tun_id=0x0,src=30.0.0.2,dst=30.0.0.3,flags(-df-csum+key)),recirc_id(0),in_port(4789),packet_type(ns=1,id=0x894f),nsh(np=1,spi=0x3020,si=254), packets:1, bytes:108, used:0.0s, actions:decap_nsh(),recirc(0x2)
637 tunnel(tun_id=0x0,src=30.0.0.2,dst=30.0.0.3,flags(-df-csum+key)),recirc_id(0x2),in_port(4789),packet_type(ns=1,id=0x800),ipv4(frag=no), packets:1, bytes:84, used:0.0s, actions:push_eth(src=00:00:00:00:00:00,dst=aa:55:aa:55:00:03),6
638 ])
639
640 AT_CHECK([
641 ovs-ofctl -Oopenflow13 dump-flows br-in1 | ofctl_strip | sort | grep actions
642 ovs-ofctl -Oopenflow13 dump-flows br-in2 | ofctl_strip | sort | grep actions
643 ovs-ofctl -Oopenflow13 dump-flows br-in3 | ofctl_strip | sort | grep actions
644 ], [0], [dnl
645 n_packets=4, n_bytes=392, ip,in_port=10 actions=decap(),goto_table:1
646 packet_type=(1,0x800),in_port=10 actions=goto_table:1
647 packet_type=(1,0x894f),in_port=1020 actions=goto_table:2
648 packet_type=(1,0x894f),in_port=1030 actions=goto_table:2
649 table=1, n_packets=2, n_bytes=196, priority=0,packet_type=(1,0x800) actions=encap(nsh(md_type=1)),set_field:0x3020->nsh_spi,output:1020
650 table=1, n_packets=2, n_bytes=196, priority=32,packet_type=(1,0x800),nw_dst=192.168.10.30 actions=encap(nsh(md_type=1)),set_field:0x3000->nsh_spi,output:1030
651 table=2, packet_type=(1,0x894f),nsh_spi=0x1000,nsh_si=255 actions=decap(),goto_table:3
652 table=2, packet_type=(1,0x894f),nsh_spi=0x1020,nsh_si=254 actions=decap(),goto_table:3
653 table=3, ip actions=set_field:aa:55:aa:55:00:01->eth_dst,output:10
654 table=3, packet_type=(1,0x800) actions=encap(ethernet),set_field:aa:55:aa:55:00:01->eth_dst,output:10
655 n_packets=2, n_bytes=216, packet_type=(1,0x894f),in_port=2010 actions=goto_table:2
656 packet_type=(1,0x894f),in_port=2030 actions=goto_table:2
657 table=2, n_packets=2, n_bytes=216, packet_type=(1,0x894f),nsh_spi=0x3020,nsh_si=254 actions=output:2030
658 table=2, n_packets=2, n_bytes=216, packet_type=(1,0x894f),nsh_spi=0x3020,nsh_si=255 actions=encap(ethernet),set_field:11:22:33:44:55:66->eth_dst,goto_table:4
659 table=2, packet_type=(1,0x894f),nsh_spi=0x1020,nsh_si=254 actions=output:2010
660 table=2, packet_type=(1,0x894f),nsh_spi=0x1020,nsh_si=255 actions=encap(ethernet),set_field:77:88:99:aa:bb:cc->eth_dst,goto_table:4
661 table=4, dl_dst=77:88:99:aa:bb:cc,dl_type=0x894f actions=set_field:254->nsh_si,decap(),resubmit(,2)
662 table=4, n_packets=2, n_bytes=216, dl_dst=11:22:33:44:55:66,dl_type=0x894f actions=set_field:254->nsh_si,decap(),resubmit(,2)
663 ip,in_port=30 actions=decap(),goto_table:1
664 n_packets=2, n_bytes=216, packet_type=(1,0x894f),in_port=3010 actions=goto_table:2
665 n_packets=2, n_bytes=216, packet_type=(1,0x894f),in_port=3020 actions=goto_table:2
666 packet_type=(1,0x800),in_port=30 actions=goto_table:1
667 table=1, priority=0,packet_type=(1,0x800) actions=encap(nsh(md_type=1)),set_field:0x1020->nsh_spi,output:3020
668 table=1, priority=32,packet_type=(1,0x800),nw_dst=192.168.10.10 actions=encap(nsh(md_type=1)),set_field:0x1000->nsh_spi,output:3010
669 table=2, n_packets=2, n_bytes=216, packet_type=(1,0x894f),nsh_spi=0x3000,nsh_si=255 actions=decap(),goto_table:3
670 table=2, n_packets=2, n_bytes=216, packet_type=(1,0x894f),nsh_spi=0x3020,nsh_si=254 actions=decap(),goto_table:3
671 table=3, ip actions=set_field:aa:55:aa:55:00:03->eth_dst,output:30
672 table=3, n_packets=4, n_bytes=336, packet_type=(1,0x800) actions=encap(ethernet),set_field:aa:55:aa:55:00:03->eth_dst,output:30
673 ])
674
675 OVS_VSWITCHD_STOP
676 AT_CLEANUP