Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
convert kademlia example to s4u
[simgrid.git] / examples / s4u / dht-kademlia / s4u-dht-kademlia.hpp
1 /* Copyright (c) 2012, 2014, 2016. The SimGrid Team.
2  * All rights reserved.                                                     */
3
4 /* This program is free software; you can redistribute it and/or modify it
5  * under the terms of the license (GNU LGPL) which comes with this package. */
6
7 #ifndef _S4U_KADEMLIA_HPP
8 #define _S4U_KADEMLIA_HPP
9 #include <algorithm>
10 #include <simgrid/s4u.hpp>
11
12 namespace kademlia {
13 class Answer;
14 class Message;
15 class Ping;
16 }
17
18 #define max_join_trials 4
19
20 #define RECEIVE_TIMEOUT 1
21
22 #define ping_timeout 55
23 #define find_node_timeout 10
24 #define find_node_global_timeout 50
25
26 #define kademlia_alpha 3
27 #define BUCKET_SIZE 20
28
29 #define identifier_size 32
30 #define max_answers_to_ask 20
31
32 #define random_lookup_interval 100
33
34 #define MAX_STEPS 10
35
36 #define JOIN_BUCKETS_QUERIES 5
37
38 #define RANDOM_LOOKUP_NODE 0
39
40 #endif