aboutsummaryrefslogtreecommitdiff
path: root/template/probnat/api.html.j2
blob: 90e56cfd4d494a5e3be2dcc68d0d07f1340c67fc (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
{% extends "common/base.j2" %}
{% block body_content %}
<main id="maincontent">
<article class="container">

  <header>
    <h1>{{ _("API Documentation") }}</h1>
  </header>

  <div class="row">
    <div class="col-2 d-none d-lg-block"><!-- for large viewports show menu for better orientation -->
      <nav class="nav subnav position-fixed flex-column border-right" style="position:fixed">
      <a class="nav-link" href="index.html#idea">{{ _("Project main page") }}</a>
      </nav>
    </div>
    <div class="col">

      <h2>Sync Protocol</h2>

      <section>
        
        <p>
          {% trans %}
	  To use the probabilistic NAT traversal library, the peers to be connected must first be synchronized. For that, each peer has to use two API calls.<br/><br/>

	  enum GNUNET_GenericReturnValue<br/>
	  GNUNET_is_burst_ready (struct GNUNET_TIME_Relative rtt_avarage,<br/>
                                 &emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&ensp; struct GNUNET_BurstSync *burst_sync,<br/>
                                 &emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&ensp; GNUNET_SCHEDULER_TaskCallback task,<br/>
                                 &emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&ensp; struct GNUNET_StartBurstCls *task_cls)<br/><br/>

	  and<br/><br/>

	  struct GNUNET_BurstSync *<br/>
	  GNUNET_get_burst_sync_msg (struct GNUNET_TIME_Relative rtt_avarage,<br/>
                                     &emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&ensp; enum GNUNET_GenericReturnValue sync_ready)<br/><br/>


	  The second is to create the synchronisation message which the caller has to send to the other peer.
	  Within GNUnet the Distance Vector DV protocol is used for sending the synchronisation message. Applications which do not want to use the complete GNUnet stack have to use transportion by other means.<br/><br/>

	  The API call needs two parameters. The avarage round trip time rtt_avarage has to be provided by the callers application. In GNUnet this information is constantly calculated from messages delivered by DV. Again, applications not using the GNUnet stack have to assemble this information by themself. The second parameter is returned by the first API call and must be temporarily stored to use it in the second.<br/><br/>

	  The first API call also needs the avarage RTT and the synchronisation message received from another peer. The callback is called, if both peers are ready to synchronize. Therefore the callback should start the burst mode which will finally do the hole punch for NAT traversal.<br/><br/>
          {% endtrans %}
        </p>
      </section>
    </div>
  </div>

</article>
{% endblock body_content %}