INMARSAT-54 Honeycomb configures PBB
[csit.git] / tests / func / ipfix / ipfix_ipv4.robot
1 # Copyright (c) 2016 Cisco and/or its affiliates.
2 # Licensed under the Apache License, Version 2.0 (the "License");
3 # you may not use this file except in compliance with the License.
4 # You may obtain a copy of the License at:
5 #
6 #     http://www.apache.org/licenses/LICENSE-2.0
7 #
8 # Unless required by applicable law or agreed to in writing, software
9 # distributed under the License is distributed on an "AS IS" BASIS,
10 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 # See the License for the specific language governing permissions and
12 # limitations under the License.
13
14 *** Settings ***
15 | Resource | resources/libraries/robot/default.robot
16 | Resource | resources/libraries/robot/interfaces.robot
17 | Resource | resources/libraries/robot/testing_path.robot
18 | Resource | resources/libraries/robot/ipv4.robot
19 | Resource | resources/libraries/robot/ipfix.robot
20 | Library | resources.libraries.python.Classify.Classify
21 | Library | resources.libraries.python.IPFIXSetup
22 | Library | resources.libraries.python.Trace
23
24 | Force Tags | HW_ENV | VM_ENV | 3_NODE_SINGLE_LINK_TOPO | EXPECTED_FAILING
25 # TODO: Remove EXPECTED_FAILING tag once functionality is implemented (VPP-204)
26 | Suite Setup | Run Keywords | Setup all TGs before traffic script
27 | ...         | AND          | Update All Interface Data On All Nodes | ${nodes}
28 | Test Setup | Setup all DUTs before test
29 | Test Teardown | Run Keywords | Show packet trace on all DUTs | ${nodes}
30 | ...           | AND          | Vpp Show Errors | ${nodes['DUT1']}
31 | ...           | AND          | Show vpp trace dump on all DUTs
32 | Documentation | *IPFIX ipv4 test cases*
33 | ...
34 | ... | IPFIX tests use 3-node topology TG - DUT1 - DUT2 - TG with
35 | ... | one link between the nodes. DUT1 is configured with IPv4
36 | ... | routing and static routes. IPFIX is configured on DUT1 with
37 | ... | DUT1->TG interface as collector. Test packets are
38 | ... | sent from TG to DUT1. TG listens for flow report packets
39 | ... | and verifies that they contains flow record of test packets sent.
40
41 *** Variables ***
42 | ${dut1_to_tg_ip}= | 192.168.1.1
43 | ${tg_to_dut1_ip}= | 192.168.1.2
44 | ${dut2_to_dut1_ip}= | 192.168.2.1
45 | ${route_ip}= | 16.0.0.1
46 | ${prefix_length}= | 24
47 | ${ip_version}= | ip4
48 | ${port}= | 80
49 | ${sessions}= | 80
50
51 *** Test Cases ***
52 | TC01: DUT sends IPFIX template and data packets
53 | | [Documentation]
54 | | ... | [Top] TG-DUT1-DUT2-TG. [Cfg] On DUT1 configure IPFIX with TG interface
55 | | ... | address as collector and a basic classify session.
56 | | ... | [Ver] Make TG listen for IPFIX template and data packets, verify
57 | | ... | that packet is received and correct. No packets are sent from TG.
58 | | ... | [Ref] RFC 7011
59 | | Given Path for 3-node testing is set
60 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']}
61 | | And Interfaces in 3-node path are up
62 | | And Set Interface Address | ${dut1_node}
63 | | ... | ${dut1_to_tg} | ${dut1_to_tg_ip} | ${prefix_length}
64 | | And Add ARP on DUT | ${dut1_node} | ${dut1_to_tg} | ${tg_to_dut1_ip}
65 | | ... | ${tg_to_dut1_mac}
66 | | And Vpp Route Add
67 | | ... | ${dut1_node} | ${route_ip} | 32
68 | | ... | ${tg_to_dut1_ip} | ${dut1_to_tg} | resolve_attempts=${NONE}
69 | | ${table_index} | ${skip_n} | ${match_n}=
70 | | ... | And VPP creates classify table L3 | ${dut1_node} | ${ip_version} | src
71 | | And VPP configures classify session L3 | ${dut1_node} | permit
72 | | ... | ${table_index} | ${skip_n} | ${match_n} | ${ip_version} | src
73 | | ... | ${route_ip}
74 | | When Assign interface to flow table | ${dut1_node} | ${dut1_to_tg}
75 | | ... | ${table_index} | ip_version=${ip_version}
76 | | And Setup IPFIX exporter | ${dut1_node} | ${route_ip}
77 | | ... | ${dut1_to_tg_ip} | interval=5
78 | | And Set IPFIX stream | ${dut1_node} | ${1}
79 | | And Assign classify table to exporter | ${dut1_node} | ${table_index}
80 | | ... | ${ip_version}
81 | | Then Send packets and verify IPFIX | ${tg_node} | ${dut1_node}
82 | | ... | ${tg_to_dut1} | ${dut1_to_tg} | ${route_ip} | ${dut1_to_tg_ip}
83 | | ... | count=0
84
85 | TC02: DUT reports packet flow for traffic by source address
86 | | [Documentation]
87 | | ... | [Top] TG-DUT1-DUT2-TG. [Cfg] On DUT1 configure IPFIX with TG interface
88 | | ... | address as collector and add classify session with TG source address.
89 | | ... | [Ver] Make TG send a packet to DUT1, then listen for IPFIX template
90 | | ... | and data packets, verify that IPFIX reported the received packet.
91 | | ... | [Ref] RFC 7011
92 | | Given Path for 3-node testing is set
93 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']}
94 | | And Interfaces in 3-node path are up
95 | | And Set Interface Address | ${dut1_node}
96 | | ... | ${dut1_to_tg} | ${dut1_to_tg_ip} | ${prefix_length}
97 | | And Add ARP on DUT | ${dut1_node} | ${dut1_to_tg} | ${route_ip}
98 | | ... | ${tg_to_dut1_mac}
99 | | And Vpp Route Add
100 | | ... | ${dut1_node} | ${route_ip} | 32
101 | | ... | ${tg_to_dut1_ip} | ${dut1_to_tg} | resolve_attempts=${NONE}
102 | | ${table_index} | ${skip_n} | ${match_n}=
103 | | ... | And VPP creates classify table L3 | ${dut1_node} | ${ip_version} | src
104 | | And VPP configures classify session L3 | ${dut1_node} | permit
105 | | ... | ${table_index} | ${skip_n} | ${match_n} | ${ip_version} | src
106 | | ... | ${route_ip}
107 | | When Assign interface to flow table | ${dut1_node} | ${dut1_to_tg}
108 | | ... | ${table_index} | ip_version=${ip_version}
109 | | And Setup IPFIX exporter | ${dut1_node} | ${route_ip}
110 | | ... | ${dut1_to_tg_ip} | interval=5
111 | | And Set IPFIX stream | ${dut1_node} | ${1}
112 | | And Assign classify table to exporter | ${dut1_node} | ${table_index}
113 | | ... | ${ip_version}
114 | | Then Send packets and verify IPFIX | ${tg_node} | ${dut1_node}
115 | | ... | ${tg_to_dut1} | ${dut1_to_tg} | ${route_ip} | ${dut1_to_tg_ip}
116
117 | TC03: DUT reports packet flow for traffic with local destination address
118 | | [Documentation]
119 | | ... | [Top] TG-DUT1-DUT2-TG. [Cfg] On DUT1 configure IPFIX with TG interface
120 | | ... | address as collector and add classify session with destination
121 | | ... | address of DUT1.
122 | | ... | [Ver] Make TG send a packet to DUT1, then listen for IPFIX template
123 | | ... | and data packets, verify that IPFIX reported the received packet.
124 | | ... | [Ref] RFC 7011
125 | | Given Path for 3-node testing is set
126 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']}
127 | | And Interfaces in 3-node path are up
128 | | And Set Interface Address | ${dut1_node}
129 | | ... | ${dut1_to_tg} | ${dut1_to_tg_ip} | ${prefix_length}
130 | | And Add ARP on DUT | ${dut1_node} | ${dut1_to_tg} | ${route_ip}
131 | | ... | ${tg_to_dut1_mac}
132 | | And Vpp Route Add
133 | | ... | ${dut1_node} | ${route_ip} | 32
134 | | ... | ${tg_to_dut1_ip} | ${dut1_to_tg} | resolve_attempts=${NONE}
135 | | ${table_index} | ${skip_n} | ${match_n}=
136 | | ... | And VPP creates classify table L3 | ${dut1_node} | ${ip_version} | dst
137 | | And VPP configures classify session L3 | ${dut1_node} | permit
138 | | ... | ${table_index} | ${skip_n} | ${match_n} | ${ip_version} | dst
139 | | ... | ${dut1_to_tg_ip}
140 | | When Assign interface to flow table | ${dut1_node} | ${dut1_to_tg}
141 | | ... | ${table_index} | ip_version=${ip_version}
142 | | And Setup IPFIX exporter | ${dut1_node} | ${route_ip}
143 | | ... | ${dut1_to_tg_ip} | interval=5
144 | | And Set IPFIX stream | ${dut1_node} | ${1}
145 | | And Assign classify table to exporter | ${dut1_node} | ${table_index}
146 | | ... | ${ip_version}
147 | | Then Send packets and verify IPFIX | ${tg_node} | ${dut1_node}
148 | | ... | ${tg_to_dut1} | ${dut1_to_tg} | ${route_ip} | ${dut1_to_tg_ip}
149
150 | TC04: DUT reports packet flow for traffic with remote destination address
151 | | [Documentation]
152 | | ... | [Top] TG-DUT1-DUT2-TG. [Cfg] On DUT1 configure IPFIX with TG interface
153 | | ... | address as collector and add classify session with destination
154 | | ... | address of DUT2.
155 | | ... | [Ver] Make TG send a packet to DUT2 through DUT1, then listen
156 | | ... | for IPFIX template and data packets, verify that IPFIX reported
157 | | ... | the received packet.
158 | | ... | [Ref] RFC 7011
159 | | Given Path for 3-node testing is set
160 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']}
161 | | And Interfaces in 3-node path are up
162 | | And Set Interface Address | ${dut1_node}
163 | | ... | ${dut1_to_tg} | ${dut1_to_tg_ip} | ${prefix_length}
164 | | And Add ARP on DUT | ${dut1_node} | ${dut1_to_tg} | ${route_ip}
165 | | ... | ${tg_to_dut1_mac}
166 | | And Vpp Route Add
167 | | ... | ${dut1_node} | ${route_ip} | 32
168 | | ... | ${tg_to_dut1_ip} | ${dut1_to_tg} | resolve_attempts=${NONE}
169 | | And Add ARP on DUT | ${dut1_node} | ${dut1_to_dut2} | ${dut2_to_dut1_ip}
170 | | ... | ${dut2_to_dut1_mac}
171 | | ${table_index} | ${skip_n} | ${match_n}=
172 | | ... | And VPP creates classify table L3 | ${dut1_node} | ${ip_version} | dst
173 | | And VPP configures classify session L3 | ${dut1_node} | permit
174 | | ... | ${table_index} | ${skip_n} | ${match_n} | ${ip_version} | dst
175 | | ... | ${dut2_to_dut1_ip}
176 | | When Assign interface to flow table | ${dut1_node} | ${dut1_to_tg}
177 | | ... | ${table_index} | ip_version=${ip_version}
178 | | And Setup IPFIX exporter | ${dut1_node} | ${route_ip}
179 | | ... | ${dut1_to_tg_ip} | interval=5
180 | | And Set IPFIX stream | ${dut1_node} | ${1}
181 | | And Assign classify table to exporter | ${dut1_node} | ${table_index}
182 | | ... | ${ip_version}
183 | | Then Send packets and verify IPFIX | ${tg_node} | ${dut1_node}
184 | | ... | ${tg_to_dut1} | ${dut1_to_tg} | ${route_ip} | ${dut2_to_dut1_ip}
185
186 | TC05: DUT reports packet flow for traffic by source and destination port
187 | | [Documentation]
188 | | ... | [Top] TG-DUT1-DUT2-TG. [Cfg] On DUT1 configure IPFIX with TG interface
189 | | ... | address as collector and add classify session with TG source address
190 | | ... | and source and destination ports.
191 | | ... | [Ver] Make TG send a packet to DUT1, then listen for IPFIX template
192 | | ... | and data packets, verify that IPFIX reported the received packet.
193 | | ... | [Ref] RFC 7011
194 | | Given Path for 3-node testing is set
195 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']}
196 | | And Interfaces in 3-node path are up
197 | | And Set Interface Address | ${dut1_node}
198 | | ... | ${dut1_to_tg} | ${dut1_to_tg_ip} | ${prefix_length}
199 | | And Add ARP on DUT | ${dut1_node} | ${dut1_to_tg} | ${route_ip}
200 | | ... | ${tg_to_dut1_mac}
201 | | ${table_index} | ${skip_n} | ${match_n}=
202 | | ... | And VPP creates classify table L3 | ${dut1_node} | ${ip_version}
203 | | ... | src proto l4 src_port dst_port
204 | | And VPP configures classify session generic | ${dut1_node}
205 | | ... | acl-hit-next permit | ${table_index} | ${skip_n} | ${match_n}
206 | | ... | l3 ${ip_version} src ${route_ip}
207 | | ... | proto 6 l4 src_port ${port} dst_port ${port}
208 | | When Assign interface to flow table | ${dut1_node} | ${dut1_to_tg}
209 | | ... | ${table_index} | ip_version=${ip_version}
210 | | And Setup IPFIX exporter | ${dut1_node} | ${route_ip}
211 | | ... | ${dut1_to_tg_ip} | interval=5
212 | | And Set IPFIX stream | ${dut1_node} | ${1}
213 | | And Assign classify table to exporter | ${dut1_node} | ${table_index}
214 | | ... | ${ip_version}
215 | | Then Send packets and verify IPFIX | ${tg_node} | ${dut1_node}
216 | | ... | ${tg_to_dut1} | ${dut1_to_tg} | ${route_ip} | ${dut1_to_tg_ip}
217 | | ... | port=${port}
218
219 | TC06: DUT reports packet flow with a large number of packets
220 | | [Documentation]
221 | | ... | [Top] TG-DUT1-DUT2-TG. [Cfg] On DUT1 configure IPFIX with TG interface
222 | | ... | address as collector and add classify session with TG source address.
223 | | ... | [Ver] Make TG send packets to DUT1, then listen for IPFIX template
224 | | ... | and data packets, verify that IPFIX reported the received packets.
225 | | ... | [Ref] RFC 7011
226 | | Given Path for 3-node testing is set
227 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']}
228 | | And Interfaces in 3-node path are up
229 | | And Set Interface Address | ${dut1_node}
230 | | ... | ${dut1_to_tg} | ${dut1_to_tg_ip} | ${prefix_length}
231 | | And Add ARP on DUT | ${dut1_node} | ${dut1_to_tg} | ${route_ip}
232 | | ... | ${tg_to_dut1_mac}
233 | | And Vpp Route Add
234 | | ... | ${dut1_node} | ${route_ip} | 32
235 | | ... | ${tg_to_dut1_ip} | ${dut1_to_tg} | resolve_attempts=${NONE}
236 | | ${table_index} | ${skip_n} | ${match_n}=
237 | | ... | And VPP creates classify table L3 | ${dut1_node} | ${ip_version} | src
238 | | And VPP configures classify session L3 | ${dut1_node} | permit
239 | | ... | ${table_index} | ${skip_n} | ${match_n} | ${ip_version} | src
240 | | ... | ${route_ip}
241 | | When Assign interface to flow table | ${dut1_node} | ${dut1_to_tg}
242 | | ... | ${table_index} | ip_version=${ip_version}
243 | | And setup IPFIX exporter | ${dut1_node} | ${route_ip} | ${dut1_to_tg_ip}
244 | | ... | interval=5
245 | | And Set IPFIX stream | ${dut1_node} | ${1}
246 | | And Assign classify table to exporter | ${dut1_node} | ${table_index}
247 | | ... | ${ip_version}
248 | | Then Send packets and verify IPFIX | ${tg_node} | ${dut1_node}
249 | | ... | ${tg_to_dut1} | ${dut1_to_tg} | ${route_ip} | ${dut1_to_tg_ip}
250 | | ... | count=20000 | timeout=10
251
252 | TC07: DUT reports packet flow when multiple sessions are configured
253 | | [Documentation]
254 | | ... | [Top] TG-DUT1-DUT2-TG. [Cfg] On DUT1 configure IPFIX with TG interface
255 | | ... | address as collector and add several classify sessions with different
256 | | ... | ports.
257 | | ... | [Ver] Make TG send packets to DUT1 using a range of ports matching
258 | | ... | configured sessions, then listen for IPFIX template and data packets,
259 | | ... | verify that IPFIX reported the received packets for each session.
260 | | ... | [Ref] RFC 7011
261 | | Given Path for 3-node testing is set
262 | | ... | ${nodes['TG']} | ${nodes['DUT1']} | ${nodes['DUT2']} | ${nodes['TG']}
263 | | And Interfaces in 3-node path are up
264 | | And Set Interface Address | ${dut1_node}
265 | | ... | ${dut1_to_tg} | ${dut1_to_tg_ip} | ${prefix_length}
266 | | And Add ARP on DUT | ${dut1_node} | ${dut1_to_tg} | ${route_ip}
267 | | ... | ${tg_to_dut1_mac}
268 | | And Vpp Route Add
269 | | ... | ${dut1_node} | ${route_ip} | 32
270 | | ... | ${tg_to_dut1_ip} | ${dut1_to_tg} | resolve_attempts=${NONE}
271 | | ${table_index} | ${skip_n} | ${match_n}=
272 | | ... | And VPP creates classify table L3 | ${dut1_node} | ${ip_version}
273 | | ... | src proto l4 src_port dst_port
274 | | :FOR | ${index} | IN RANGE | ${sessions}
275 | | | VPP configures classify session generic | ${dut1_node}
276 | | | ... | acl-hit-next permit | ${table_index} | ${skip_n} | ${match_n}
277 | | | ... | l3 ${ip_version} src ${route_ip}
278 | | | ... | proto 6 l4 src_port ${index} dst_port ${index}
279 | | When Assign interface to flow table | ${dut1_node} | ${dut1_to_tg}
280 | | ... | ${table_index} | ip_version=${ip_version}
281 | | And setup IPFIX exporter | ${dut1_node} | ${route_ip}
282 | | ... | ${dut1_to_tg_ip}
283 | | ... | mtu=1450 | interval=5
284 | | And Set IPFIX stream | ${dut1_node} | ${1}
285 | | And Assign classify table to exporter | ${dut1_node} | ${table_index}
286 | | ... | ${ip_version}
287 | | Then Send session sweep and verify IPFIX | ${tg_node} | ${dut1_node}
288 | | ... | ${tg_to_dut1} | ${dut1_to_tg} | ${route_ip} | ${dut1_to_tg_ip}
289 | | ... | ${sessions} | timeout=10 | count=3
290 # TODO: DUT reports packet flow when ACL is configured with wildcards