2 This file is part of GNUnet.
3 (C) 2011, 2012 Christian Grothoff (and other contributing authors)
5 GNUnet is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published
7 by the Free Software Foundation; either version 3, or (at your
8 option) any later version.
10 GNUnet is distributed in the hope that it will be useful, but
11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with GNUnet; see the file COPYING. If not, write to the
17 Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA.
22 * @file stream/perf_stream_api.c
23 * @brief performance benchmarks for stream api
24 * @author Sree Harsha Totakura
27 #define LOG(kind, ...) \
28 GNUNET_log (kind, __VA_ARGS__);
30 /****************************************************************************************/
31 /* Test is setup into the following major steps: */
32 /* 1. Measurements over loopback (1 hop). i.e. we use only one peer and open */
33 /* stream connections over loopback. Messages will go through */
34 /* STREAM_API->MESH_API->MESH_SERVICE->MESH_API->STREAM_API. */
35 /* 2. Measurements over 2 peers (2 hops). We use testbed to create 2 peers, */
36 /* connect them and then create stream connections. Messages will go through */
37 /* STREAM_API->MESH_API->MESH_SERVICE->CORE1.....CORE2->MESH_API->STREAM_API */
38 /* 3. Measurements over 3 peers (3 hops). We use testbed to create 3 peers, */
39 /* connect them in a line topology: peer1->peer2->peer3. Messages will go */
41 /* STREAM_API->MESH_API->MESH_SERVICE->CORE1..CORE2..CORE3->MESH_API->STREAM_API. */
42 /****************************************************************************************/
45 #include "gnunet_common.h"
46 #include "gnunet_util_lib.h"
47 #include "gnunet_testing_lib.h"
48 #include "gnunet_testbed_service.h"
49 #include "gnunet_stream_lib.h"
54 * Simple struct to keep track of progress, and print a
55 * nice little percentage meter for long running tasks.
65 unsigned int completed;
79 * Single hop loopback testing
84 * Testing with 2 peers
89 * Testing with 3 peers
96 * Structure for holding peer's sockets and IO Handles
101 * Peer's stream socket
103 struct GNUNET_STREAM_Socket *socket;
106 * Peer's io write handle
108 struct GNUNET_STREAM_IOWriteHandle *io_write_handle;
111 * Peer's io read handle
113 struct GNUNET_STREAM_IOReadHandle *io_read_handle;
116 * The peer handle when we use the testbed servie
118 struct GNUNET_TESTBED_Peer *peer;
121 * Handle to peer specific opearations while using testbed service
123 struct GNUNET_TESTBED_Operation *op;
126 * The identity of this peer
128 struct GNUNET_PeerIdentity id;
131 * Bytes the peer has written
133 unsigned int bytes_wrote;
136 * Byte the peer has read
138 unsigned int bytes_read;
143 * Enumeration of stages in this testing
153 * Uplink testing stage
158 * Downlink testing stage
165 * Maximum size of the data which we will transfer during tests
167 #define DATA_SIZE 5000000 /* 5mB */
170 * Listen socket of peer2
172 struct GNUNET_STREAM_ListenSocket *peer2_listen_socket;
175 * Handle to configuration during TEST_STEP_1_HOP
177 const struct GNUNET_CONFIGURATION_Handle *config;
180 * Handle for the progress meter
182 static struct ProgressMeter *meter;
185 * Placeholder for peer data
187 static struct PeerData peer_data[3];
190 * Handle to common operations while using testbed
192 static struct GNUNET_TESTBED_Operation *common_op;
195 * Task ID for abort task
197 static GNUNET_SCHEDULER_TaskIdentifier abort_task;
200 * Task ID for write task
202 static GNUNET_SCHEDULER_TaskIdentifier write_task;
205 * Task ID for read task
207 static GNUNET_SCHEDULER_TaskIdentifier read_task;
210 * Absolute time when profiling starts
212 static struct GNUNET_TIME_Absolute prof_start_time;
215 * Test time taken for sending the data
217 static struct GNUNET_TIME_Relative prof_time;
220 * Random data block. Should generate data first
222 static uint32_t data[DATA_SIZE / 4];
225 * Payload sizes to test each major test with
227 static uint16_t payload_size[] =
228 { 20, 500, 2000, 7000, 13000, 25000, 50000, 60000, 63000, 64000 };
231 * Current step of testing
233 static enum TestStep test_step;
236 * Index for choosing payload size
238 static unsigned int payload_size_index;
241 * Number of peers we want to create while using the testbed service
243 static int num_peers;
246 * Testing result of a major test
248 static enum TestStage result;
251 * Create a meter to keep track of the progress of some task.
253 * @param total the total number of items to complete
254 * @param start_string a string to prefix the meter with (if printing)
255 * @param print GNUNET_YES to print the meter, GNUNET_NO to count
258 * @return the progress meter
260 static struct ProgressMeter *
261 create_meter (unsigned int total, char *start_string, int print)
263 struct ProgressMeter *ret;
265 ret = GNUNET_malloc (sizeof (struct ProgressMeter));
268 ret->modnum = total / 4;
269 if (ret->modnum == 0) /* Divide by zero check */
271 ret->dotnum = (total / 50) + 1;
272 if (start_string != NULL)
273 ret->startup_string = GNUNET_strdup (start_string);
275 ret->startup_string = GNUNET_strdup ("");
282 * Update progress meter (increment by one).
284 * @param meter the meter to update and print info for
286 * @return GNUNET_YES if called the total requested,
287 * GNUNET_NO if more items expected
290 update_meter (struct ProgressMeter *meter)
292 if (meter->print == GNUNET_YES)
294 if (meter->completed % meter->modnum == 0)
296 if (meter->completed == 0)
298 FPRINTF (stdout, "%sProgress: [0%%", meter->startup_string);
301 FPRINTF (stdout, "%d%%",
302 (int) (((float) meter->completed / meter->total) * 100));
304 else if (meter->completed % meter->dotnum == 0)
305 FPRINTF (stdout, "%s", ".");
307 if (meter->completed + 1 == meter->total)
308 FPRINTF (stdout, "%d%%]\n", 100);
313 if (meter->completed == meter->total)
315 if (meter->completed > meter->total)
316 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "Progress meter overflow!!\n");
322 * Reset progress meter.
324 * @param meter the meter to reset
326 * @return GNUNET_YES if meter reset,
327 * GNUNET_SYSERR on error
330 reset_meter (struct ProgressMeter *meter)
333 return GNUNET_SYSERR;
335 meter->completed = 0;
341 * Release resources for meter
343 * @param meter the meter to free
346 free_meter (struct ProgressMeter *meter)
348 GNUNET_free_non_null (meter->startup_string);
357 do_shutdown (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
361 case TEST_STEP_1_HOP:
362 if (NULL != peer_data[0].socket)
363 GNUNET_STREAM_close (peer_data[0].socket);
364 if (NULL != peer_data[1].socket)
365 GNUNET_STREAM_close (peer_data[1].socket);
366 if (NULL != peer2_listen_socket)
367 GNUNET_STREAM_listen_close (peer2_listen_socket); /* Close listen socket */
369 case TEST_STEP_2_HOP:
370 if (NULL != peer_data[1].socket)
371 GNUNET_STREAM_close (peer_data[1].socket);
372 if (NULL != peer_data[0].op)
373 GNUNET_TESTBED_operation_done (peer_data[0].op);
374 if (NULL != peer_data[1].op)
375 GNUNET_TESTBED_operation_done (peer_data[1].op);
377 case TEST_STEP_3_HOP:
380 if (GNUNET_SCHEDULER_NO_TASK != abort_task)
381 GNUNET_SCHEDULER_cancel (abort_task);
382 if (GNUNET_SCHEDULER_NO_TASK != write_task)
383 GNUNET_SCHEDULER_cancel (write_task);
384 GNUNET_SCHEDULER_shutdown (); /* Shutdown this testcase */
394 * Something went wrong and timed out. Kill everything and set error flag
397 do_abort (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
399 abort_task = GNUNET_SCHEDULER_NO_TASK;
400 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "test: ABORT\n");
401 if (GNUNET_SCHEDULER_NO_TASK != read_task)
402 GNUNET_SCHEDULER_cancel (read_task);
403 result = GNUNET_SYSERR;
404 do_shutdown (cls, tc);
409 * Scheduler call back; to be executed when a new stream is connected
410 * Called from listen connect for peer2
413 stream_read_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc);
417 * Task for calling STREAM_write with a chunk of random data
419 * @param cls the peer data entity
420 * @param tc the task context
423 stream_write_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc);
427 * The write completion function; called upon writing some data to stream or
430 * @param cls the closure from GNUNET_STREAM_write/read
431 * @param status the status of the stream at the time this function is called
432 * @param size the number of bytes read or written
435 write_completion (void *cls, enum GNUNET_STREAM_Status status, size_t size)
437 struct PeerData *pdata = cls;
439 double prof_time_sec;
441 if (GNUNET_STREAM_OK != status)
443 GNUNET_SCHEDULER_cancel (abort_task);
444 abort_task = GNUNET_SCHEDULER_add_now (&do_abort, NULL);
447 GNUNET_assert (size <= DATA_SIZE);
448 pdata->bytes_wrote += size;
449 for (;size > 0; size--)
450 update_meter (meter);
451 if (pdata->bytes_wrote < DATA_SIZE) /* Have more data to send */
453 pdata->io_write_handle =
454 GNUNET_STREAM_write (pdata->socket,
455 ((void *) data) + pdata->bytes_wrote,
456 sizeof (data) - pdata->bytes_wrote,
457 GNUNET_TIME_UNIT_FOREVER_REL, &write_completion,
459 GNUNET_assert (NULL != pdata->io_write_handle);
465 prof_time = GNUNET_TIME_absolute_get_duration (prof_start_time);
466 prof_time_sec = (((double) prof_time.rel_value)/ ((double) 1000));
467 throughput = (((float) sizeof (data)) / prof_time_sec);
468 PRINTF ("Throughput %.2f kB/sec\n", throughput / 1000.00);
473 GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == read_task);
474 GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == write_task);
475 pdata->bytes_read = 0;
476 meter = create_meter (sizeof (data), "Testing Downlink\n", GNUNET_YES);
477 read_task = GNUNET_SCHEDULER_add_now (&stream_read_task, &peer_data[0]);
478 write_task = GNUNET_SCHEDULER_add_now (&stream_write_task, &peer_data[1]);
481 result = DOWNLINK_OK;
482 GNUNET_SCHEDULER_add_now (&do_shutdown, NULL);
492 * Task for calling STREAM_write with a chunk of random data
494 * @param cls the peer data entity
495 * @param tc the task context
498 stream_write_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
500 struct PeerData *pdata = cls;
502 if (GNUNET_SCHEDULER_NO_TASK != abort_task)
504 GNUNET_SCHEDULER_cancel (abort_task);
506 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_multiply
507 (GNUNET_TIME_UNIT_SECONDS, 300), &do_abort,
510 write_task = GNUNET_SCHEDULER_NO_TASK;
511 prof_start_time = GNUNET_TIME_absolute_get ();
512 pdata->bytes_wrote = 0;
513 pdata->io_write_handle = GNUNET_STREAM_write (pdata->socket, data,
515 GNUNET_TIME_UNIT_FOREVER_REL,
516 &write_completion, pdata);
517 GNUNET_assert (NULL != pdata->io_write_handle);
522 * Scheduler call back; to be executed when a new stream is connected
523 * Called from listen connect for peer2
526 stream_read_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc);
533 * @param status the status of the stream at the time this function is called
534 * @param data traffic from the other side
535 * @param size the number of bytes available in data read
536 * @return number of bytes of processed from 'data' (any data remaining should be
537 * given to the next time the read processor is called).
540 input_processor (void *cls, enum GNUNET_STREAM_Status status,
541 const void *input_data, size_t size)
543 struct PeerData *pdata = cls;
545 if (GNUNET_STREAM_OK != status)
547 GNUNET_SCHEDULER_cancel (abort_task);
548 abort_task = GNUNET_SCHEDULER_add_now (&do_abort, NULL);
551 GNUNET_assert (size < DATA_SIZE);
552 GNUNET_assert (0 == memcmp (((void *)data ) + pdata->bytes_read,
554 pdata->bytes_read += size;
555 if (pdata->bytes_read < DATA_SIZE)
557 GNUNET_assert (GNUNET_SCHEDULER_NO_TASK == read_task);
558 read_task = GNUNET_SCHEDULER_add_now (&stream_read_task, pdata);
562 LOG (GNUNET_ERROR_TYPE_DEBUG, "Reading finished successfully\n");
569 * Scheduler call back; to be executed when a new stream is connected
570 * Called from listen connect for peer2
573 stream_read_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
575 struct PeerData *pdata = cls;
577 read_task = GNUNET_SCHEDULER_NO_TASK;
578 pdata->io_read_handle =
579 GNUNET_STREAM_read (pdata->socket, GNUNET_TIME_UNIT_FOREVER_REL,
580 &input_processor, pdata);
581 GNUNET_assert (NULL != pdata->io_read_handle);
586 * Functions of this type are called upon new stream connection from other peers
588 * @param cls the closure from GNUNET_STREAM_listen
589 * @param socket the socket representing the stream
590 * @param initiator the identity of the peer who wants to establish a stream
592 * @return GNUNET_OK to keep the socket open, GNUNET_SYSERR to close the
593 * stream (the socket will be invalid after the call)
596 stream_listen_cb (void *cls, struct GNUNET_STREAM_Socket *socket,
597 const struct GNUNET_PeerIdentity *initiator)
599 struct PeerData *pdata = cls;
602 if ((NULL == socket) || (NULL == initiator))
604 GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "Binding error\n");
605 if (GNUNET_SCHEDULER_NO_TASK != abort_task)
606 GNUNET_SCHEDULER_cancel (abort_task);
607 abort_task = GNUNET_SCHEDULER_add_now (&do_abort, NULL);
610 GNUNET_assert (NULL != socket);
611 GNUNET_assert (pdata == &peer_data[1]);
612 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Peer connected: %s\n",
613 GNUNET_i2s(initiator));
614 pdata->socket = socket;
615 pdata->bytes_read = 0;
616 read_task = GNUNET_SCHEDULER_add_now (&stream_read_task, pdata);
622 * Function executed after stream has been established
624 * @param cls the closure from GNUNET_STREAM_open
625 * @param socket socket to use to communicate with the other side (read/write)
628 stream_open_cb (void *cls,
629 struct GNUNET_STREAM_Socket *socket)
631 struct PeerData *pdata = cls;
633 GNUNET_assert (socket == pdata->socket);
634 meter = create_meter (sizeof (data), "Testing Uplink\n", GNUNET_YES);
635 write_task = GNUNET_SCHEDULER_add_now (&stream_write_task, pdata);
640 * Listen success callback; connects a peer to stream as client
643 stream_connect (void)
645 peer_data[0].socket =
646 GNUNET_STREAM_open (config, &peer_data[1].id, 10, &stream_open_cb,
648 GNUNET_STREAM_OPTION_MAX_PAYLOAD_SIZE,
649 payload_size[payload_size_index],
650 GNUNET_STREAM_OPTION_END);
651 GNUNET_assert (NULL != peer_data[0].socket);
656 * Initialize framework and start test
659 * @param cfg configuration of the peer that was started
660 * @param peer identity of the peer that was created
664 const struct GNUNET_CONFIGURATION_Handle *cfg,
665 struct GNUNET_TESTING_Peer *peer)
667 struct GNUNET_PeerIdentity id;
669 GNUNET_TESTING_peer_get_identity (peer, &id);
671 peer2_listen_socket =
672 GNUNET_STREAM_listen (config, 10, &stream_listen_cb, &peer_data[1],
673 GNUNET_STREAM_OPTION_SIGNAL_LISTEN_SUCCESS,
675 GNUNET_STREAM_OPTION_MAX_PAYLOAD_SIZE,
676 payload_size[payload_size_index],
677 GNUNET_STREAM_OPTION_END);
678 GNUNET_assert (NULL != peer2_listen_socket);
679 peer_data[0].id = id;
680 peer_data[1].id = id;
682 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_multiply
683 (GNUNET_TIME_UNIT_SECONDS, 300), &do_abort,
689 * Adapter function called to establish a connection to
693 * @param cfg configuration of the peer to connect to; will be available until
694 * GNUNET_TESTBED_operation_done() is called on the operation returned
695 * from GNUNET_TESTBED_service_connect()
696 * @return service handle to return in 'op_result', NULL on error
699 stream_ca (void *cls, const struct GNUNET_CONFIGURATION_Handle *cfg);
703 * Adapter function called to destroy a connection to
707 * @param op_result service handle returned from the connect adapter
710 stream_da (void *cls, void *op_result)
712 if (&peer_data[1] == cls)
714 GNUNET_STREAM_listen_close (op_result);
717 else if (&peer_data[0] == cls)
719 GNUNET_STREAM_close (op_result);
727 * Listen success callback; connects a peer to stream as client. Called from
731 stream_connect2 (void)
733 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Stream listen open successful\n");
735 GNUNET_TESTBED_service_connect (&peer_data[0], peer_data[0].peer,
736 "stream", NULL, NULL, stream_ca,
737 stream_da, &peer_data[0]);
742 * Adapter function called to establish a connection to
746 * @param cfg configuration of the peer to connect to; will be available until
747 * GNUNET_TESTBED_operation_done() is called on the operation returned
748 * from GNUNET_TESTBED_service_connect()
749 * @return service handle to return in 'op_result', NULL on error
752 stream_ca (void *cls, const struct GNUNET_CONFIGURATION_Handle *cfg)
754 struct PeerData *pdata = cls;
756 if (&peer_data[1] == pdata)
758 peer2_listen_socket = NULL;
759 peer2_listen_socket =
760 GNUNET_STREAM_listen (cfg, 10, &stream_listen_cb, &peer_data[1],
761 GNUNET_STREAM_OPTION_SIGNAL_LISTEN_SUCCESS,
763 GNUNET_STREAM_OPTION_MAX_PAYLOAD_SIZE,
764 payload_size[payload_size_index],
765 GNUNET_STREAM_OPTION_END);
766 GNUNET_assert (NULL != peer2_listen_socket);
767 return peer2_listen_socket;
769 if (&peer_data[0] == pdata)
772 GNUNET_STREAM_open (cfg, &peer_data[1].id, 10, &stream_open_cb,
774 GNUNET_STREAM_OPTION_MAX_PAYLOAD_SIZE,
775 payload_size[payload_size_index],
776 GNUNET_STREAM_OPTION_END);
777 GNUNET_assert (NULL != pdata->socket);
778 return pdata->socket;
786 * Callback to be called when the requested peer information is available
788 * @param cb_cls the closure from GNUNET_TETSBED_peer_get_information()
789 * @param op the operation this callback corresponds to
790 * @param pinfo the result; will be NULL if the operation has failed
791 * @param emsg error message if the operation has failed; will be NULL if the
792 * operation is successfull
795 peerinfo_cb (void *cb_cls, struct GNUNET_TESTBED_Operation *op,
796 const struct GNUNET_TESTBED_PeerInformation *pinfo,
799 struct PeerData *pdata = cb_cls;
801 GNUNET_assert (NULL == emsg);
802 GNUNET_assert (common_op == op);
803 GNUNET_assert (NULL != pdata);
804 memcpy (&pdata->id, pinfo->result.id, sizeof (struct GNUNET_PeerIdentity));
805 GNUNET_TESTBED_operation_done (op);
806 if (pdata == &peer_data[0])
808 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Peer 1 id: %s\n",
809 GNUNET_i2s (&pdata->id));
810 common_op = GNUNET_TESTBED_peer_get_information (peer_data[1].peer,
811 GNUNET_TESTBED_PIT_IDENTITY,
812 &peerinfo_cb, &peer_data[1]);
814 else if (pdata == &peer_data[1])
816 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Peer 2 id: %s\n",
817 GNUNET_i2s (&pdata->id));
818 if (TEST_STEP_2_HOP == test_step)
820 GNUNET_TESTBED_service_connect (&peer_data[1], peer_data[1].peer,
821 "stream", NULL, NULL, stream_ca,
822 stream_da, &peer_data[1]);
824 GNUNET_break (0); /* FIXME: 3 hop test case here... */
830 * Controller event callback
833 * @param event the controller event
836 controller_event_cb (void *cls,
837 const struct GNUNET_TESTBED_EventInformation *event)
841 case GNUNET_TESTBED_ET_OPERATION_FINISHED:
842 if (NULL != event->details.operation_finished.emsg)
844 FPRINTF (stderr, "Error while expecting an operation to succeed:%s \n",
845 event->details.operation_finished.emsg);
849 case GNUNET_TESTBED_ET_CONNECT:
850 GNUNET_TESTBED_operation_done (common_op);
851 /* Get the peer identity and configuration of peers */
853 GNUNET_TESTBED_peer_get_information (peer_data[0].peer,
854 GNUNET_TESTBED_PIT_IDENTITY,
855 &peerinfo_cb, &peer_data[0]);
864 * Signature of a main function for a testcase.
867 * @param num_peers number of peers in 'peers'
868 * @param peers handle to peers run in the testbed
871 test_master (void *cls, unsigned int num_peers_,
872 struct GNUNET_TESTBED_Peer **peers)
874 GNUNET_assert (NULL != peers);
875 GNUNET_assert (NULL != peers[0]);
876 GNUNET_assert (NULL != peers[1]);
877 GNUNET_assert (num_peers_ == num_peers);
878 peer_data[0].peer = peers[0];
879 peer_data[1].peer = peers[1];
881 common_op = GNUNET_TESTBED_overlay_connect (NULL, NULL, NULL,
887 GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_relative_multiply
888 (GNUNET_TIME_UNIT_SECONDS, 120), &do_abort,
896 int main (int argc, char **argv)
898 char *test_name = "perf_stream_api";
899 char *cfg_file = "test_stream_local.conf";
904 meter = create_meter ((sizeof (data) / 4), "Generating random data\n", GNUNET_YES);
905 for (count=0; count < (sizeof (data) / 4); count++)
907 data[count] = GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK,
909 update_meter (meter);
914 test_step = TEST_STEP_1_HOP;
915 for (payload_size_index = 0;
916 payload_size_index < (sizeof (payload_size) / sizeof (uint16_t));
917 payload_size_index++)
919 PRINTF ("\nTesting over loopback with payload size %hu\n",
920 payload_size[payload_size_index]);
921 (void) memset (peer_data, 0, sizeof (peer_data));
923 ret = GNUNET_TESTING_peer_run (test_name, cfg_file, &run, NULL);
924 if ((0 != ret) || (DOWNLINK_OK != result))
927 test_step = TEST_STEP_2_HOP;
930 event_mask |= (1LL << GNUNET_TESTBED_ET_CONNECT);
931 event_mask |= (1LL << GNUNET_TESTBED_ET_OPERATION_FINISHED);
932 for (payload_size_index = 0;
933 payload_size_index < (sizeof (payload_size) / sizeof (uint16_t));
934 payload_size_index++)
936 PRINTF ("\nTesting over 1 hop with payload size %hu\n",
937 payload_size[payload_size_index]);
938 (void) memset (peer_data, 0, sizeof (peer_data));
939 result = GNUNET_SYSERR;
940 GNUNET_TESTBED_test_run (test_name, cfg_file, num_peers, event_mask,
941 &controller_event_cb, NULL, &test_master, NULL);
942 if (DOWNLINK_OK != result)
945 test_step = TEST_STEP_3_HOP;
946 for (payload_size_index = 0;
947 payload_size_index < (sizeof (payload_size) / sizeof (uint16_t));
948 payload_size_index++)
950 /* Initialize testbed here */
955 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Test failed\n");
959 /* end of perf_stream_api.c */