3 /* amok_bandwidth - Bandwidth test facilities */
5 /* Copyright (c) 2003-2005 Martin Quinson. All rights reserved. */
7 /* This program is free software; you can redistribute it and/or modify it
8 * under the terms of the license (GNU LGPL) which comes with this package. */
10 #ifndef AMOK_BANDWIDTH_H
11 #define AMOK_BANDWIDTH_H
13 #include "amok/base.h"
18 /** \addtogroup AMOK_bw
19 * \brief Test the bandwidth between two nodes
21 * This module allows you to retrieve the bandwidth between to arbitrary hosts,
22 * provided that they run some GRAS process which initialized this module.
24 * The API is very simple. Use amok_bw_test() to get the BW between the local host
25 * and the specified peer, or amok_bw_request() to get the BW between two remote
26 * hosts. The elapsed time, as long as the achieved bandwidth is returned in the
27 * last arguments of the functions.
29 * All sizes are in kilo bytes.
31 * \todo Cleanup and implement the link saturation stuff.
36 void amok_bw_init(void);
37 void amok_bw_exit(void);
39 void amok_bw_test(gras_socket_t peer,
40 unsigned long int buf_size,unsigned long int exp_size,unsigned long int msg_size,
41 /*OUT*/ double *sec, double *bw);
43 void amok_bw_request(const char* from_name,unsigned int from_port,
44 const char* to_name,unsigned int to_port,
45 unsigned long int bufSize,unsigned long int expSize,unsigned long int msgSize,
46 /*OUT*/ double *sec, double*bw);
51 /* ***************************************************************************
53 * ***************************************************************************/
56 * grasbw_saturate_start:
57 * @from_name: Name of the host we are asking to do a experiment with (to_name:to_port)
58 * @from_port: port on which the process we are asking for an experiment is listening
59 * (for message, do not give a raw socket here. The needed raw socket will be negociated
61 * @to_name: Name of the host with which we should conduct the experiment
62 * @to_port: port on which the peer process is listening for message
63 * @msgSize: Size of each message sent.
64 * @timeout: How long in maximum should be the saturation.
66 * Ask the process 'from_name:from_port' to start to saturate the link between itself
67 * and to_name:to_name.
69 void grasbw_saturate_start(const char* from_name,unsigned int from_port,
70 const char* to_name,unsigned int to_port,
71 unsigned int msgSize, unsigned int timeout);
74 * grasbw_saturate_stop:
75 * @from_name: Name of the host we are asking to do a experiment with (to_name:to_port)
76 * @from_port: port on which the process we are asking for an experiment is listening
77 * (for message, do not give a raw socket here. The needed raw socket will be negociated
79 * @to_name: Name of the host with which we should conduct the experiment
80 * @to_port: port on which the peer process is listening for message
82 * Ask the process 'from_name:from_port' to stop saturating the link between itself
83 * and to_name:to_name.
85 void grasbw_saturate_stop(const char* from_name,unsigned int from_port,
86 const char* to_name,unsigned int to_port);
90 #endif /* AMOK_BANDWIDTH_H */