feat(doc): update ASTF related methodology
[csit.git] / docs / report / introduction / methodology_dut_state.rst
1 DUT state considerations
2 ------------------------
3
4 This page discusses considerations for Device Under Test (DUT) state.
5 DUTs such as VPP require configuration, to be provided before the aplication
6 starts (via config files) or just after it starts (via API or CLI access).
7
8 During operation DUTs gather various telemetry data, depending on configuration.
9 This internal state handling is part of normal operation,
10 so any performance impact is included in the test results.
11 Accessing telemetry data is additional load on DUT,
12 so we are not doing that in main trial measurements that affect results,
13 but we include separate trials specifically for gathering runtime telemetry.
14
15 But there is one kind of state that needs specific handling.
16 This kind of DUT state is dynamically created based on incoming traffic,
17 it affects how DUT handles the traffic, and (unlike telemetry counters)
18 it has uneven impact on CPU load.
19 Typical example is NAT, where detecting new sessions takes more CPU than
20 forwarding packet on existing (open or recently closed) sessions.
21 We call DUT configurations with this kind of state "stateful",
22 and configurations without them "stateless".
23 (Even though stateless configurations contain state described in previous
24 paragraphs, and some configuration items may have "stateful" in their name,
25 such as stateful ACLs.)
26
27 Stateful DUT configurations
28 ~~~~~~~~~~~~~~~~~~~~~~~~~~~
29
30 Typically, the level of CPU impact of traffic depends on DUT state.
31 The first packets causing DUT state to change have higher impact,
32 subsequent packets matching that state have lower impact.
33
34 From performance point of view, this is similar to traffic phases
35 for stateful protocols, see
36 `NGFW draft <https://tools.ietf.org/html/draft-ietf-bmwg-ngfw-performance-05#section-4.3.4>`.
37 In CSIT we borrow the terminology (even if it does not fit perfectly,
38 see discussion below). Ramp-up traffic causes the state change,
39 sustain traffic does not change the state.
40
41 As the performance is different, each test has to choose which traffic
42 it wants to test, and manipulate the DUT state to achieve the intended impact.
43
44 Ramp-up trial
45 _____________
46
47 Tests aiming at sustain performance need to make sure DUT state is created.
48 We achieve this via a ramp-up trial, specific purpose of which
49 is to create the state.
50
51 Subsequent trials need no specific handling, as long as the state
52 remains the same. But some state can time-out, so additional ramp-up
53 trials are inserted whenever the code detects the state can time-out.
54 Note that a trial with zero loss refreshes the state,
55 so only the time since the last non-zero loss trial is tracked.
56
57 For the state to be set completely, it is important both DUT and TG
58 do not lose any packets. We achieve this by setting the profile multiplier
59 (TPS from now on) to low enough value.
60
61 It is also important each state-affecting packet is sent.
62 For size-limited traffic profile it is guaranteed by the size limit.
63 For continuous traffic, we set a long enough duration (based on TPS).
64
65 At the end of the ramp-up trial, we check DUT state to confirm
66 it has been created as expected.
67 Test fails if the state is not (completely) created.
68
69 State Reset
70 ___________
71
72 Tests aiming at ramp-up performance do not use ramp-up trial,
73 and they need to reset the DUT state before each trial measurement.
74 The way of resetting the state depends on test,
75 usually an API call is used to partially de-configure
76 the part that holds the state, and then re-configure it back.
77
78 In CSIT we control the DUT state behavior via a test variable "resetter".
79 If it is not set, DUT state is not reset.
80 If it is set, each search algorithm (including MRR) will invoke it
81 before all trial measurements (both main and telemetry ones).
82 Any configuration keyword enabling a feature with DUT state
83 will check whether a test variable for ramp-up rate is present.
84 If it is present, resetter is not set.
85 If it is not present, the keyword sets the apropriate resetter value.
86 This logic makes sure either ramp-up or state reset are used.
87
88 ..
89     TODO: Classify trials into main and telemetry, in a separate place.
90
91 Notes: If both ramp-up and state reset were used, the DUT behavior
92 would be identical to just reset, while test would take longer to execute.
93 If neither were used, DUT will show different performance in subsequent trials,
94 violating assumptions of search algorithms.
95
96 DUT versus protocol ramp-up
97 ___________________________
98
99 There are at least three different causes for bandwidth possibly increasing
100 within a single measurement trial.
101
102 The first is DUT switching from state modification phase to constant phase,
103 it is the primary focus of this document.
104 Using ramp-up traffic before main trials eliminates this cause
105 for tests wishing to measure the performance of the next phase.
106 Using size-limited profiles eliminates the next phase
107 for tests wishing to measure performance of this phase.
108
109 The second is protocol such as TCP ramping up their throughput to utilize
110 the bandwidth available. This is the original meaning of "ramp up"
111 in the NGFW draft (see above).
112 In existing tests we are not using this meaning of TCP ramp-up.
113 Instead we use only small transactions, and large enough initial window
114 so TCP acts as ramped-up already.
115
116 The third is TCP increasing offered load due to retransmissions triggered by
117 packet loss. In CSIT we again try to avoid this behavior
118 by using small enough data to transfer, so overlap of multiple transactions
119 (primary cause of packet loss) is unlikely.
120 But in MRR tests, packet loss and non-constant offered load are still expected.
121
122 Stateless DUT configuratons
123 ~~~~~~~~~~~~~~~~~~~~~~~~~~~
124
125 These are simple configurations, which do not set any resetter value
126 (even if ramp-up duration is not configured).
127 Majority of existing tests are of this type, using continuous traffic profiles.
128
129 In order to identify limits of Trex performance,
130 we have added suites with stateless DUT configuration (VPP ip4base)
131 subjected to size-limited ASTF traffic.
132 The discovered rates serve as a basis of comparison
133 for evaluating the results for stateful DUT configurations (VPP NAT44ed)
134 subjected to the same traffic profiles.
135
136 DUT versus TG state
137 ~~~~~~~~~~~~~~~~~~~
138
139 Traffic Generator profiles can be stateful (ASTF) or stateless (STL).
140 DUT configuration can be stateful or stateless (with respect to packet traffic).
141
142 In CSIT we currently use all four possible configurations:
143
144 - Regular stateless VPP tests use stateless traffic profiles.
145
146 - Stateless VPP configuration with stateful profile is used as a base for
147   comparison.
148
149 - Some stateful DUT configurations (NAT44DET, NAT44ED unidirectional)
150   are tested using stateless traffic profiles and continuous traffic.
151
152 - The rest of stateful DUT configurations (NAT44ED bidirectional)
153   are tested using stateful traffic profiles and size limited traffic.