diff options
author | Matthias Wachs <wachs@net.in.tum.de> | 2014-01-22 16:22:53 +0000 |
---|---|---|
committer | Matthias Wachs <wachs@net.in.tum.de> | 2014-01-22 16:22:53 +0000 |
commit | 0c7aa062cb988866f9d859a7c67836707cf1041c (patch) | |
tree | dde37bec39cf05142a36d0dd40d2fb150c7fd595 /src/ats-tests/ats-testing.h | |
parent | 3425604d4fa20375309ec016a6f52f5e57578fac (diff) | |
download | gnunet-0c7aa062cb988866f9d859a7c67836707cf1041c.tar.gz gnunet-0c7aa062cb988866f9d859a7c67836707cf1041c.zip |
changes to traffic generation
Diffstat (limited to 'src/ats-tests/ats-testing.h')
-rw-r--r-- | src/ats-tests/ats-testing.h | 231 |
1 files changed, 52 insertions, 179 deletions
diff --git a/src/ats-tests/ats-testing.h b/src/ats-tests/ats-testing.h index 540f2bd8c..a3d208187 100644 --- a/src/ats-tests/ats-testing.h +++ b/src/ats-tests/ats-testing.h | |||
@@ -31,116 +31,18 @@ | |||
31 | 31 | ||
32 | #define TEST_ATS_PREFERENCE_DEFAULT 1.0 | 32 | #define TEST_ATS_PREFERENCE_DEFAULT 1.0 |
33 | 33 | ||
34 | /** | 34 | #define TEST_MESSAGE_TYPE_PING 12345 |
35 | * Overall state of the performance benchmark | 35 | #define TEST_MESSAGE_TYPE_PONG 12346 |
36 | */ | 36 | #define TEST_MESSAGE_SIZE 1000 |
37 | struct BenchmarkState | ||
38 | { | ||
39 | /** | ||
40 | * Are we connected to ATS service of all peers: GNUNET_YES/NO | ||
41 | */ | ||
42 | int connected_ATS_service; | ||
43 | |||
44 | /** | ||
45 | * Are we connected to CORE service of all peers: GNUNET_YES/NO | ||
46 | */ | ||
47 | int connected_COMM_service; | ||
48 | |||
49 | /** | ||
50 | * Are we connected to all peers: GNUNET_YES/NO | ||
51 | */ | ||
52 | int connected_PEERS; | ||
53 | 37 | ||
54 | /** | 38 | struct BenchmarkPartner; |
55 | * Are we connected to all slave peers on CORE level: GNUNET_YES/NO | 39 | struct BenchmarkPeer; |
56 | */ | 40 | struct GNUNET_ATS_TEST_Topology; |
57 | int connected_CORE; | 41 | struct TrafficGenerator; |
58 | |||
59 | /** | ||
60 | * Are we connected to CORE service of all peers: GNUNET_YES/NO | ||
61 | */ | ||
62 | int benchmarking; | ||
63 | }; | ||
64 | |||
65 | |||
66 | /** | ||
67 | * Information about a benchmarking partner | ||
68 | */ | ||
69 | struct BenchmarkPartner | ||
70 | { | ||
71 | /** | ||
72 | * The peer itself this partner belongs to | ||
73 | */ | ||
74 | struct BenchmarkPeer *me; | ||
75 | |||
76 | /** | ||
77 | * The partner peer | ||
78 | */ | ||
79 | struct BenchmarkPeer *dest; | ||
80 | |||
81 | /** | ||
82 | * Core transmit handles | ||
83 | */ | ||
84 | struct GNUNET_CORE_TransmitHandle *cth; | ||
85 | |||
86 | /** | ||
87 | * Transport transmit handles | ||
88 | */ | ||
89 | struct GNUNET_TRANSPORT_TransmitHandle *tth; | ||
90 | |||
91 | /** | ||
92 | * Timestamp to calculate communication layer delay | ||
93 | */ | ||
94 | struct GNUNET_TIME_Absolute last_message_sent; | ||
95 | |||
96 | /** | ||
97 | * Accumulated RTT for all messages | ||
98 | */ | ||
99 | unsigned int total_app_rtt; | ||
100 | |||
101 | /** | ||
102 | * Number of messages sent to this partner | ||
103 | */ | ||
104 | unsigned int messages_sent; | ||
105 | |||
106 | /** | ||
107 | * Number of bytes sent to this partner | ||
108 | */ | ||
109 | unsigned int bytes_sent; | ||
110 | |||
111 | /** | ||
112 | * Number of messages received from this partner | ||
113 | */ | ||
114 | unsigned int messages_received; | ||
115 | |||
116 | /** | ||
117 | * Number of bytes received from this partner | ||
118 | */ | ||
119 | unsigned int bytes_received; | ||
120 | |||
121 | /* Current ATS properties */ | ||
122 | |||
123 | uint32_t ats_distance; | ||
124 | |||
125 | uint32_t ats_delay; | ||
126 | |||
127 | uint32_t bandwidth_in; | ||
128 | |||
129 | uint32_t bandwidth_out; | ||
130 | |||
131 | uint32_t ats_utilization_up; | ||
132 | |||
133 | uint32_t ats_utilization_down; | ||
134 | |||
135 | uint32_t ats_network_type; | ||
136 | |||
137 | uint32_t ats_cost_wan; | ||
138 | |||
139 | uint32_t ats_cost_lan; | ||
140 | |||
141 | uint32_t ats_cost_wlan; | ||
142 | }; | ||
143 | 42 | ||
43 | typedef void (*GNUNET_ATS_TESTING_TopologySetupDoneCallback) (void *cls, | ||
44 | struct BenchmarkPeer *masters, | ||
45 | struct BenchmarkPeer *slaves); | ||
144 | 46 | ||
145 | /** | 47 | /** |
146 | * Information we track for a peer in the testbed. | 48 | * Information we track for a peer in the testbed. |
@@ -264,121 +166,93 @@ struct BenchmarkPeer | |||
264 | unsigned int total_bytes_received; | 166 | unsigned int total_bytes_received; |
265 | }; | 167 | }; |
266 | 168 | ||
169 | |||
267 | /** | 170 | /** |
268 | * Connect peers with testbed | 171 | * Information about a benchmarking partner |
269 | */ | 172 | */ |
270 | struct TestbedConnectOperation | 173 | struct BenchmarkPartner |
271 | { | 174 | { |
272 | /** | 175 | /** |
273 | * The benchmarking master initiating this connection | 176 | * The peer itself this partner belongs to |
274 | */ | 177 | */ |
275 | struct BenchmarkPeer *master; | 178 | struct BenchmarkPeer *me; |
276 | 179 | ||
277 | /** | 180 | /** |
278 | * The benchmarking slave to connect to | 181 | * The partner peer |
279 | */ | 182 | */ |
280 | struct BenchmarkPeer *slave; | 183 | struct BenchmarkPeer *dest; |
281 | 184 | ||
282 | /** | 185 | /** |
283 | * Testbed operation to connect peers | 186 | * Core transmit handles |
284 | */ | 187 | */ |
285 | struct GNUNET_TESTBED_Operation *connect_op; | 188 | struct GNUNET_CORE_TransmitHandle *cth; |
286 | }; | ||
287 | |||
288 | typedef void (*GNUNET_ATS_TESTING_TopologySetupDoneCallback) (void *cls, | ||
289 | struct BenchmarkPeer *masters, | ||
290 | struct BenchmarkPeer *slaves); | ||
291 | 189 | ||
292 | struct GNUNET_ATS_TEST_Topology | ||
293 | { | ||
294 | /** | 190 | /** |
295 | * Shutdown task | 191 | * Transport transmit handles |
296 | */ | 192 | */ |
297 | GNUNET_SCHEDULER_TaskIdentifier shutdown_task; | 193 | struct GNUNET_TRANSPORT_TransmitHandle *tth; |
298 | 194 | ||
299 | /** | 195 | /** |
300 | * Progress task | 196 | * Timestamp to calculate communication layer delay |
301 | */ | 197 | */ |
302 | GNUNET_SCHEDULER_TaskIdentifier progress_task; | 198 | struct GNUNET_TIME_Absolute last_message_sent; |
303 | 199 | ||
304 | /** | 200 | /** |
305 | * Test result | 201 | * Accumulated RTT for all messages |
306 | */ | 202 | */ |
307 | int result; | 203 | unsigned int total_app_rtt; |
308 | 204 | ||
309 | /** | 205 | /** |
310 | * Test result logging | 206 | * Number of messages sent to this partner |
311 | */ | ||
312 | int logging; | ||
313 | |||
314 | /**Test core (GNUNET_YES) or transport (GNUNET_NO) | ||
315 | */ | 207 | */ |
316 | int test_core; | 208 | unsigned int messages_sent; |
317 | 209 | ||
318 | /** | 210 | /** |
319 | * Solver string | 211 | * Number of bytes sent to this partner |
320 | */ | 212 | */ |
321 | char *solver; | 213 | unsigned int bytes_sent; |
322 | 214 | ||
323 | /** | 215 | /** |
324 | * Preference string | 216 | * Number of messages received from this partner |
325 | */ | 217 | */ |
326 | char *testname; | 218 | unsigned int messages_received; |
327 | 219 | ||
328 | /** | 220 | /** |
329 | * Preference string | 221 | * Number of bytes received from this partner |
330 | */ | 222 | */ |
331 | char *pref_str; | 223 | unsigned int bytes_received; |
332 | 224 | ||
333 | /** | 225 | /* Current ATS properties */ |
334 | * ATS preference value | ||
335 | */ | ||
336 | int pref_val; | ||
337 | 226 | ||
338 | /** | 227 | uint32_t ats_distance; |
339 | * Number master peers | ||
340 | */ | ||
341 | unsigned int num_masters; | ||
342 | 228 | ||
343 | /** | 229 | uint32_t ats_delay; |
344 | * Array of master peers | ||
345 | */ | ||
346 | struct BenchmarkPeer *mps; | ||
347 | 230 | ||
348 | /** | 231 | uint32_t bandwidth_in; |
349 | * Number slave peers | ||
350 | */ | ||
351 | unsigned int num_slaves; | ||
352 | 232 | ||
353 | /** | 233 | uint32_t bandwidth_out; |
354 | * Array of slave peers | ||
355 | */ | ||
356 | struct BenchmarkPeer *sps; | ||
357 | 234 | ||
358 | /** | 235 | uint32_t ats_utilization_up; |
359 | * Benchmark duration | ||
360 | */ | ||
361 | struct GNUNET_TIME_Relative perf_duration; | ||
362 | 236 | ||
363 | /** | 237 | uint32_t ats_utilization_down; |
364 | * Logging frequency | ||
365 | */ | ||
366 | struct GNUNET_TIME_Relative log_frequency; | ||
367 | 238 | ||
368 | /** | 239 | uint32_t ats_network_type; |
369 | * Benchmark state | ||
370 | */ | ||
371 | struct BenchmarkState state; | ||
372 | 240 | ||
373 | struct GNUNET_CORE_MessageHandler *handlers; | 241 | uint32_t ats_cost_wan; |
374 | 242 | ||
375 | GNUNET_TRANSPORT_ReceiveCallback transport_recv_cb; | 243 | uint32_t ats_cost_lan; |
376 | 244 | ||
377 | GNUNET_ATS_TESTING_TopologySetupDoneCallback done_cb; | 245 | uint32_t ats_cost_wlan; |
378 | GNUNET_ATS_AddressInformationCallback ats_perf_cb; | ||
379 | void *done_cb_cls; | ||
380 | }; | 246 | }; |
381 | 247 | ||
248 | struct TrafficGenerator * | ||
249 | GNUNET_ATS_TEST_generate_traffic_start (struct BenchmarkPeer *src, | ||
250 | struct BenchmarkPartner *dest, unsigned int rate, | ||
251 | struct GNUNET_TIME_Relative duration); | ||
252 | |||
253 | void | ||
254 | GNUNET_ATS_TEST_generate_traffic_stop (struct TrafficGenerator *tg); | ||
255 | |||
382 | void | 256 | void |
383 | GNUNET_ATS_TEST_logging_start (struct GNUNET_TIME_Relative log_frequency, | 257 | GNUNET_ATS_TEST_logging_start (struct GNUNET_TIME_Relative log_frequency, |
384 | char * testname, struct BenchmarkPeer *masters, int num_masters); | 258 | char * testname, struct BenchmarkPeer *masters, int num_masters); |
@@ -396,7 +270,6 @@ GNUNET_ATS_TEST_create_topology (char *name, char *cfg_file, | |||
396 | int test_core, | 270 | int test_core, |
397 | GNUNET_ATS_TESTING_TopologySetupDoneCallback done_cb, | 271 | GNUNET_ATS_TESTING_TopologySetupDoneCallback done_cb, |
398 | void *done_cb_cls, | 272 | void *done_cb_cls, |
399 | struct GNUNET_CORE_MessageHandler *handlers, | ||
400 | GNUNET_TRANSPORT_ReceiveCallback transport_recv_cb, | 273 | GNUNET_TRANSPORT_ReceiveCallback transport_recv_cb, |
401 | GNUNET_ATS_AddressInformationCallback ats_perf_cb); | 274 | GNUNET_ATS_AddressInformationCallback ats_perf_cb); |
402 | 275 | ||