aboutsummaryrefslogtreecommitdiff
path: root/doc/chapters
diff options
context:
space:
mode:
authorng0 <ng0@infotropique.org>2017-10-19 17:12:13 +0000
committerng0 <ng0@infotropique.org>2017-10-19 17:12:13 +0000
commitfe56dd7705c53203b2c56889ad316bff897f4a9e (patch)
tree644f611e3f562462d4eeeaa33800627bc589ad00 /doc/chapters
parent1eee9a16cc3967ef41a76869b182bf12198cdd62 (diff)
downloadgnunet-fe56dd7705c53203b2c56889ad316bff897f4a9e.tar.gz
gnunet-fe56dd7705c53203b2c56889ad316bff897f4a9e.zip
line length corrections, 50% in developer.texi.
Diffstat (limited to 'doc/chapters')
-rw-r--r--doc/chapters/developer.texi554
1 files changed, 296 insertions, 258 deletions
diff --git a/doc/chapters/developer.texi b/doc/chapters/developer.texi
index 24d3bc9e3..53d5a5605 100644
--- a/doc/chapters/developer.texi
+++ b/doc/chapters/developer.texi
@@ -3336,56 +3336,60 @@ just "know" that the NAT was manually punched and generate the respective
3336external IP address (the one that should be globally visible) based on 3336external IP address (the one that should be globally visible) based on
3337the given information. 3337the given information.
3338 3338
3339The NAT library also supports ICMP-based NAT traversal. Here, the other peer 3339The NAT library also supports ICMP-based NAT traversal. Here, the other
3340can request connection-reversal by this peer (in this special case, the peer is 3340peer can request connection-reversal by this peer (in this special case,
3341even allowed to configure a port number of zero). If the NAT library detects a 3341the peer is even allowed to configure a port number of zero). If the NAT
3342connection-reversal request, it returns the respective target address to the 3342library detects a connection-reversal request, it returns the respective
3343client as well. It should be noted that connection-reversal is currently only 3343target address to the client as well. It should be noted that
3344intended for TCP, so other plugins @strong{must} pass @code{NULL} for the 3344connection-reversal is currently only intended for TCP, so other plugins
3345reversal callback. Naturally, the NAT library also supports requesting 3345@strong{must} pass @code{NULL} for the reversal callback. Naturally, the
3346connection reversal from a remote peer (@code{GNUNET_NAT_run_client}). 3346NAT library also supports requesting connection reversal from a remote
3347peer (@code{GNUNET_NAT_run_client}).
3347 3348
3348Once initialized, the NAT handle can be used to test if a given address is 3349Once initialized, the NAT handle can be used to test if a given address is
3349possibly a valid address for this peer (@code{GNUNET_NAT_test_address}). This 3350possibly a valid address for this peer (@code{GNUNET_NAT_test_address}).
3350is used for validating our addresses when generating PONGs. 3351This is used for validating our addresses when generating PONGs.
3351 3352
3352Finally, the NAT library contains an API to test if our NAT configuration is 3353Finally, the NAT library contains an API to test if our NAT configuration
3353correct. Using @code{GNUNET_NAT_test_start} @strong{before} binding to the 3354is correct. Using @code{GNUNET_NAT_test_start} @strong{before} binding to
3354respective port, the NAT library can be used to test if the configuration 3355the respective port, the NAT library can be used to test if the
3355works. The test function act as a local client, initialize the NAT traversal 3356configuration works. The test function act as a local client, initialize
3356and then contact a @code{gnunet-nat-server} (running by default on 3357the NAT traversal and then contact a @code{gnunet-nat-server} (running by
3357@code{gnunet.org}) and ask for a connection to be established. This way, it is 3358default on @code{gnunet.org}) and ask for a connection to be established.
3358easy to test if the current NAT configuration is valid. 3359This way, it is easy to test if the current NAT configuration is valid.
3359 3360
3360@node Distance-Vector plugin 3361@node Distance-Vector plugin
3361@section Distance-Vector plugin 3362@section Distance-Vector plugin
3362@c %**end of header 3363@c %**end of header
3363 3364
3364The Distance Vector (DV) transport is a transport mechanism that allows peers 3365The Distance Vector (DV) transport is a transport mechanism that allows
3365to act as relays for each other, thereby connecting peers that would otherwise 3366peers to act as relays for each other, thereby connecting peers that would
3366be unable to connect. This gives a larger connection set to applications that 3367otherwise be unable to connect. This gives a larger connection set to
3367may work better with more peers to choose from (for example, File Sharing 3368applications that may work better with more peers to choose from (for
3368and/or DHT). 3369example, File Sharing and/or DHT).
3369 3370
3370The Distance Vector transport essentially has two functions. The first is 3371The Distance Vector transport essentially has two functions. The first is
3371"gossiping" connection information about more distant peers to directly 3372"gossiping" connection information about more distant peers to directly
3372connected peers. The second is taking messages intended for non-directly 3373connected peers. The second is taking messages intended for non-directly
3373connected peers and encapsulating them in a DV wrapper that contains the 3374connected peers and encapsulating them in a DV wrapper that contains the
3374required information for routing the message through forwarding peers. Via 3375required information for routing the message through forwarding peers. Via
3375gossiping, optimal routes through the known DV neighborhood are discovered and 3376gossiping, optimal routes through the known DV neighborhood are discovered
3376utilized and the message encapsulation provides some benefits in addition to 3377and utilized and the message encapsulation provides some benefits in
3377simply getting the message from the correct source to the proper destination. 3378addition to simply getting the message from the correct source to the
3378 3379proper destination.
3379The gossiping function of DV provides an up to date routing table of peers that 3380
3380are available up to some number of hops. We call this a fisheye view of the 3381The gossiping function of DV provides an up to date routing table of
3381network (like a fish, nearby objects are known while more distant ones 3382peers that are available up to some number of hops. We call this a
3382unknown). Gossip messages are sent only to directly connected peers, but they 3383fisheye view of the network (like a fish, nearby objects are known while
3383are sent about other knowns peers within the "fisheye distance". Whenever two 3384more distant ones unknown). Gossip messages are sent only to directly
3384peers connect, they immediately gossip to each other about their appropriate 3385connected peers, but they are sent about other knowns peers within the
3385other neighbors. They also gossip about the newly connected peer to previously 3386"fisheye distance". Whenever two peers connect, they immediately gossip
3386connected neighbors. In order to keep the routing tables up to date, disconnect 3387to each other about their appropriate other neighbors. They also gossip
3387notifications are propogated as gossip as well (because disconnects may not be 3388about the newly connected peer to previously
3388sent/received, timeouts are also used remove stagnant routing table entries). 3389connected neighbors. In order to keep the routing tables up to date,
3390disconnect notifications are propogated as gossip as well (because
3391disconnects may not be sent/received, timeouts are also used remove
3392stagnant routing table entries).
3389 3393
3390Routing of messages via DV is straightforward. When the DV transport is 3394Routing of messages via DV is straightforward. When the DV transport is
3391notified of a message destined for a non-direct neighbor, the appropriate 3395notified of a message destined for a non-direct neighbor, the appropriate
@@ -3393,36 +3397,40 @@ forwarding peer is selected, and the base message is encapsulated in a DV
3393message which contains information about the initial peer and the intended 3397message which contains information about the initial peer and the intended
3394recipient. At each forwarding hop, the initial peer is validated (the 3398recipient. At each forwarding hop, the initial peer is validated (the
3395forwarding peer ensures that it has the initial peer in its neighborhood, 3399forwarding peer ensures that it has the initial peer in its neighborhood,
3396otherwise the message is dropped). Next the base message is re-encapsulated in 3400otherwise the message is dropped). Next the base message is
3397a new DV message for the next hop in the forwarding chain (or delivered to the 3401re-encapsulated in a new DV message for the next hop in the forwarding
3398current peer, if it has arrived at the destination). 3402chain (or delivered to the current peer, if it has arrived at the
3399 3403destination).
3400Assume a three peer network with peers Alice, Bob and Carol. Assume that Alice 3404
3401<-> Bob and Bob <-> Carol are direct (e.g. over TCP or UDP transports) 3405Assume a three peer network with peers Alice, Bob and Carol. Assume that
3402connections, but that Alice cannot directly connect to Carol. This may be the 3406Alice <-> Bob and Bob <-> Carol are direct (e.g. over TCP or UDP
3403case due to NAT or firewall restrictions, or perhaps based on one of the peers 3407transports) connections, but that Alice cannot directly connect to Carol.
3404respective configurations. If the Distance Vector transport is enabled on all 3408This may be the case due to NAT or firewall restrictions, or perhaps
3405three peers, it will automatically discover (from the gossip protocol) that 3409based on one of the peers respective configurations. If the Distance
3406Alice and Carol can connect via Bob and provide a "virtual" Alice <-> Carol 3410Vector transport is enabled on all three peers, it will automatically
3407connection. Routing between Alice and Carol happens as follows; Alice creates a 3411discover (from the gossip protocol) that Alice and Carol can connect via
3408message destined for Carol and notifies the DV transport about it. The DV 3412Bob and provide a "virtual" Alice <-> Carol connection. Routing between
3409transport at Alice looks up Carol in the routing table and finds that the 3413Alice and Carol happens as follows; Alice creates a message destined for
3410message must be sent through Bob for Carol. The message is encapsulated setting 3414Carol and notifies the DV transport about it. The DV transport at Alice
3411Alice as the initiator and Carol as the destination and sent to Bob. Bob 3415looks up Carol in the routing table and finds that the message must be
3412receives the messages, verifies both Alice and Carol are known to Bob, and 3416sent through Bob for Carol. The message is encapsulated setting Alice as
3413re-wraps the message in a new DV message for Carol. The DV transport at Carol 3417the initiator and Carol as the destination and sent to Bob. Bob receives
3414receives this message, unwraps the original message, and delivers it to Carol 3418the messages, verifies both Alice and Carol are known to Bob, and re-wraps
3415as though it came directly from Alice. 3419the message in a new DV message for Carol. The DV transport at Carol
3420receives this message, unwraps the original message, and delivers it to
3421Carol as though it came directly from Alice.
3416 3422
3417@node SMTP plugin 3423@node SMTP plugin
3418@section SMTP plugin 3424@section SMTP plugin
3419@c %**end of header 3425@c %**end of header
3420 3426
3421This page describes the new SMTP transport plugin for GNUnet as it exists in 3427This section describes the new SMTP transport plugin for GNUnet as it
3422the 0.7.x and 0.8.x branch. SMTP support is currently not available in GNUnet 3428exists in the 0.7.x and 0.8.x branch. SMTP support is currently not
34230.9.x. This page also describes the transport layer abstraction (as it existed 3429available in GNUnet 0.9.x. This page also describes the transport layer
3424in 0.7.x and 0.8.x) in more detail and gives some benchmarking results. The 3430abstraction (as it existed in 0.7.x and 0.8.x) in more detail and gives
3425performance results presented are quite old and maybe outdated at this point. 3431some benchmarking results. The performance results presented are quite
3432old and maybe outdated at this point.
3433
3426@itemize @bullet 3434@itemize @bullet
3427@item Why use SMTP for a peer-to-peer transport? 3435@item Why use SMTP for a peer-to-peer transport?
3428@item SMTPHow does it work? 3436@item SMTPHow does it work?
@@ -3446,11 +3454,12 @@ performance results presented are quite old and maybe outdated at this point.
3446@c %**end of header 3454@c %**end of header
3447 3455
3448There are many reasons why one would not want to use SMTP: 3456There are many reasons why one would not want to use SMTP:
3457
3449@itemize @bullet 3458@itemize @bullet
3450@item SMTP is using more bandwidth than TCP, UDP or HTTP 3459@item SMTP is using more bandwidth than TCP, UDP or HTTP
3451@item SMTP has a much higher latency. 3460@item SMTP has a much higher latency.
3452@item SMTP requires significantly more computation (encoding and decoding time) 3461@item SMTP requires significantly more computation (encoding and decoding
3453for the peers. 3462time) for the peers.
3454@item SMTP is significantly more complicated to configure. 3463@item SMTP is significantly more complicated to configure.
3455@item SMTP may be abused by tricking GNUnet into sending mail to@ 3464@item SMTP may be abused by tricking GNUnet into sending mail to@
3456non-participating third parties. 3465non-participating third parties.
@@ -3458,46 +3467,49 @@ non-participating third parties.
3458 3467
3459So why would anybody want to use SMTP? 3468So why would anybody want to use SMTP?
3460@itemize @bullet 3469@itemize @bullet
3461@item SMTP can be used to contact peers behind NAT boxes (in virtual private 3470@item SMTP can be used to contact peers behind NAT boxes (in virtual
3462networks). 3471private networks).
3463@item SMTP can be used to circumvent policies that limit or prohibit 3472@item SMTP can be used to circumvent policies that limit or prohibit
3464peer-to-peer traffic by masking as "legitimate" traffic. 3473peer-to-peer traffic by masking as "legitimate" traffic.
3465@item SMTP uses E-mail addresses which are independent of a specific IP, which 3474@item SMTP uses E-mail addresses which are independent of a specific IP,
3466can be useful to address peers that use dynamic IP addresses. 3475which can be useful to address peers that use dynamic IP addresses.
3467@item SMTP can be used to initiate a connection (e.g. initial address exchange) 3476@item SMTP can be used to initiate a connection (e.g. initial address
3468and peers can then negotiate the use of a more efficient protocol (e.g. TCP) 3477exchange) and peers can then negotiate the use of a more efficient
3469for the actual communication. 3478protocol (e.g. TCP) for the actual communication.
3470@end itemize 3479@end itemize
3471 3480
3472In summary, SMTP can for example be used to send a message to a peer behind a 3481In summary, SMTP can for example be used to send a message to a peer
3473NAT box that has a dynamic IP to tell the peer to establish a TCP connection 3482behind a NAT box that has a dynamic IP to tell the peer to establish a
3474to a peer outside of the private network. Even an extraordinary overhead for 3483TCP connection to a peer outside of the private network. Even an
3475this first message would be irrelevant in this type of situation. 3484extraordinary overhead for this first message would be irrelevant in this
3485type of situation.
3476 3486
3477@node How does it work? 3487@node How does it work?
3478@subsection How does it work? 3488@subsection How does it work?
3479@c %**end of header 3489@c %**end of header
3480 3490
3481When a GNUnet peer needs to send a message to another GNUnet peer that has 3491When a GNUnet peer needs to send a message to another GNUnet peer that has
3482advertised (only) an SMTP transport address, GNUnet base64-encodes the message 3492advertised (only) an SMTP transport address, GNUnet base64-encodes the
3483and sends it in an E-mail to the advertised address. The advertisement 3493message and sends it in an E-mail to the advertised address. The
3484contains a filter which is placed in the E-mail header, such that the 3494advertisement contains a filter which is placed in the E-mail header,
3485receiving host can filter the tagged E-mails and forward it to the GNUnet peer 3495such that the receiving host can filter the tagged E-mails and forward it
3486process. The filter can be specified individually by each peer and be changed 3496to the GNUnet peer process. The filter can be specified individually by
3487over time. This makes it impossible to censor GNUnet E-mail messages by 3497each peer and be changed over time. This makes it impossible to censor
3488searching for a generic filter. 3498GNUnet E-mail messages by searching for a generic filter.
3489 3499
3490@node How do I configure my peer? 3500@node How do I configure my peer?
3491@subsection How do I configure my peer? 3501@subsection How do I configure my peer?
3492@c %**end of header 3502@c %**end of header
3493 3503
3494First, you need to configure @code{procmail} to filter your inbound E-mail for 3504First, you need to configure @code{procmail} to filter your inbound E-mail
3495GNUnet traffic. The GNUnet messages must be delivered into a pipe, for example 3505for GNUnet traffic. The GNUnet messages must be delivered into a pipe, for
3496@code{/tmp/gnunet.smtp}. You also need to define a filter that is used by 3506example @code{/tmp/gnunet.smtp}. You also need to define a filter that is
3497procmail to detect GNUnet messages. You are free to choose whichever filter 3507used by @command{procmail} to detect GNUnet messages. You are free to
3498you like, but you should make sure that it does not occur in your other 3508choose whichever filter you like, but you should make sure that it does
3499E-mail. In our example, we will use @code{X-mailer: GNUnet}. The 3509not occur in your other E-mail. In our example, we will use
3500@code{~/.procmailrc} configuration file then looks like this: 3510@code{X-mailer: GNUnet}. The @code{~/.procmailrc} configuration file then
3511looks like this:
3512
3501@example 3513@example
3502:0: 3514:0:
3503* ^X-mailer: GNUnet 3515* ^X-mailer: GNUnet
@@ -3506,73 +3518,80 @@ E-mail. In our example, we will use @code{X-mailer: GNUnet}. The
3506:0: /var/spool/mail/ 3518:0: /var/spool/mail/
3507@end example 3519@end example
3508 3520
3509After adding this file, first make sure that your regular E-mail still works 3521After adding this file, first make sure that your regular E-mail still
3510(e.g. by sending an E-mail to yourself). Then edit the GNUnet configuration. 3522works (e.g. by sending an E-mail to yourself). Then edit the GNUnet
3511In the section @code{SMTP} you need to specify your E-mail address under 3523configuration. In the section @code{SMTP} you need to specify your E-mail
3512@code{EMAIL}, your mail server (for outgoing mail) under @code{SERVER}, the 3524address under @code{EMAIL}, your mail server (for outgoing mail) under
3513filter (X-mailer: GNUnet in the example) under @code{FILTER} and the name of 3525@code{SERVER}, the filter (X-mailer: GNUnet in the example) under
3514the pipe under @code{PIPE}.@ The completed section could then look like this: 3526@code{FILTER} and the name of the pipe under @code{PIPE}.@ The completed
3527section could then look like this:
3528
3515@example 3529@example
3516EMAIL = me@@mail.gnu.org MTU = 65000 SERVER = mail.gnu.org:25 FILTER = 3530EMAIL = me@@mail.gnu.org MTU = 65000 SERVER = mail.gnu.org:25 FILTER =
3517"X-mailer: GNUnet" PIPE = /tmp/gnunet.smtp 3531"X-mailer: GNUnet" PIPE = /tmp/gnunet.smtp
3518@end example 3532@end example
3519 3533
3520Finally, you need to add @code{smtp} to the list of @code{TRANSPORTS} in the 3534Finally, you need to add @code{smtp} to the list of @code{TRANSPORTS} in
3521@code{GNUNETD} section. GNUnet peers will use the E-mail address that you 3535the @code{GNUNETD} section. GNUnet peers will use the E-mail address that
3522specified to contact your peer until the advertisement times out. Thus, if you 3536you specified to contact your peer until the advertisement times out.
3523are not sure if everything works properly or if you are not planning to be 3537Thus, if you are not sure if everything works properly or if you are not
3524online for a long time, you may want to configure this timeout to be short, 3538planning to be online for a long time, you may want to configure this
3525e.g. just one hour. For this, set @code{HELLOEXPIRES} to @code{1} in the 3539timeout to be short, e.g. just one hour. For this, set
3526@code{GNUNETD} section. 3540@code{HELLOEXPIRES} to @code{1} in the @code{GNUNETD} section.
3541
3542This should be it, but you may probably want to test it first.
3527 3543
3528This should be it, but you may probably want to test it first.@
3529@node How do I test if it works? 3544@node How do I test if it works?
3530@subsection How do I test if it works? 3545@subsection How do I test if it works?
3531@c %**end of header 3546@c %**end of header
3532 3547
3533Any transport can be subjected to some rudimentary tests using the 3548Any transport can be subjected to some rudimentary tests using the
3534@code{gnunet-transport-check} tool. The tool sends a message to the local node 3549@code{gnunet-transport-check} tool. The tool sends a message to the local
3535via the transport and checks that a valid message is received. While this test 3550node via the transport and checks that a valid message is received. While
3536does not involve other peers and can not check if firewalls or other network 3551this test does not involve other peers and can not check if firewalls or
3537obstacles prohibit proper operation, this is a great testcase for the SMTP 3552other network obstacles prohibit proper operation, this is a great
3538transport since it tests pretty much nearly all of the functionality. 3553testcase for the SMTP transport since it tests pretty much nearly all of
3554the functionality.
3539 3555
3540@code{gnunet-transport-check} should only be used without running 3556@code{gnunet-transport-check} should only be used without running
3541@code{gnunetd} at the same time. By default, @code{gnunet-transport-check} 3557@code{gnunetd} at the same time. By default, @code{gnunet-transport-check}
3542tests all transports that are specified in the configuration file. But you can 3558tests all transports that are specified in the configuration file. But
3543specifically test SMTP by giving the option @code{--transport=smtp}. 3559you can specifically test SMTP by giving the option
3560@code{--transport=smtp}.
3544 3561
3545Note that this test always checks if a transport can receive and send. While 3562Note that this test always checks if a transport can receive and send.
3546you can configure most transports to only receive or only send messages, this 3563While you can configure most transports to only receive or only send
3547test will only work if you have configured the transport to send and receive 3564messages, this test will only work if you have configured the transport
3548messages. 3565to send and receive messages.
3549 3566
3550@node How fast is it? 3567@node How fast is it?
3551@subsection How fast is it? 3568@subsection How fast is it?
3552@c %**end of header 3569@c %**end of header
3553 3570
3554We have measured the performance of the UDP, TCP and SMTP transport layer 3571We have measured the performance of the UDP, TCP and SMTP transport layer
3555directly and when used from an application using the GNUnet core. Measureing 3572directly and when used from an application using the GNUnet core.
3556just the transport layer gives the better view of the actual overhead of the 3573Measureing just the transport layer gives the better view of the actual
3557protocol, whereas evaluating the transport from the application puts the 3574overhead of the protocol, whereas evaluating the transport from the
3558overhead into perspective from a practical point of view. 3575application puts the overhead into perspective from a practical point of
3576view.
3559 3577
3560The loopback measurements of the SMTP transport were performed on three 3578The loopback measurements of the SMTP transport were performed on three
3561different machines spanning a range of modern SMTP configurations. We used a 3579different machines spanning a range of modern SMTP configurations. We
3562PIII-800 running RedHat 7.3 with the Purdue Computer Science configuration 3580used a PIII-800 running RedHat 7.3 with the Purdue Computer Science
3563which includes filters for spam. We also used a Xenon 2 GHZ with a vanilla 3581configuration which includes filters for spam. We also used a Xenon 2 GHZ
3564RedHat 8.0 sendmail configuration. Furthermore, we used qmail on a PIII-1000 3582with a vanilla RedHat 8.0 sendmail configuration. Furthermore, we used
3565running Sorcerer GNU Linux (SGL). The numbers for UDP and TCP are provided 3583qmail on a PIII-1000 running Sorcerer GNU Linux (SGL). The numbers for
3566using the SGL configuration. The qmail benchmark uses qmail's internal 3584UDP and TCP are provided using the SGL configuration. The qmail benchmark
3567filtering whereas the sendmail benchmarks relies on procmail to filter and 3585uses qmail's internal filtering whereas the sendmail benchmarks relies on
3568deliver the mail. We used the transport layer to send a message of b bytes 3586procmail to filter and deliver the mail. We used the transport layer to
3569(excluding transport protocol headers) directly to the local machine. This 3587send a message of b bytes (excluding transport protocol headers) directly
3570way, network latency and packet loss on the wire have no impact on the 3588to the local machine. This way, network latency and packet loss on the
3571timings. n messages were sent sequentially over the transport layer, sending 3589wire have no impact on the timings. n messages were sent sequentially over
3572message i+1 after the i-th message was received. All messages were sent over 3590the transport layer, sending message i+1 after the i-th message was
3573the same connection and the time to establish the connection was not taken 3591received. All messages were sent over the same connection and the time to
3574into account since this overhead is miniscule in practice --- as long as a 3592establish the connection was not taken into account since this overhead is
3575connection is used for a significant number of messages. 3593miniscule in practice --- as long as a connection is used for a
3594significant number of messages.
3576 3595
3577@multitable @columnfractions .20 .15 .15 .15 .15 .15 3596@multitable @columnfractions .20 .15 .15 .15 .15 .15
3578@headitem Transport @tab UDP @tab TCP @tab SMTP (Purdue sendmail) @tab SMTP (RH 8.0) @tab SMTP (SGL qmail) 3597@headitem Transport @tab UDP @tab TCP @tab SMTP (Purdue sendmail) @tab SMTP (RH 8.0) @tab SMTP (SGL qmail)
@@ -3582,39 +3601,43 @@ connection is used for a significant number of messages.
3582@end multitable 3601@end multitable
3583 3602
3584The benchmarks show that UDP and TCP are, as expected, both significantly 3603The benchmarks show that UDP and TCP are, as expected, both significantly
3585faster compared with any of the SMTP services. Among the SMTP implementations, 3604faster compared with any of the SMTP services. Among the SMTP
3586there can be significant differences depending on the SMTP configuration. 3605implementations, there can be significant differences depending on the
3587Filtering with an external tool like procmail that needs to re-parse its 3606SMTP configuration. Filtering with an external tool like procmail that
3588configuration for each mail can be very expensive. Applying spam filters can 3607needs to re-parse its configuration for each mail can be very expensive.
3589also significantly impact the performance of the underlying SMTP 3608Applying spam filters can also significantly impact the performance of
3590implementation. The microbenchmark shows that SMTP can be a viable solution 3609the underlying SMTP implementation. The microbenchmark shows that SMTP
3591for initiating peer-to-peer sessions: a couple of seconds to connect to a peer 3610can be a viable solution for initiating peer-to-peer sessions: a couple of
3592are probably not even going to be noticed by users. The next benchmark 3611seconds to connect to a peer are probably not even going to be noticed by
3593measures the possible throughput for a transport. Throughput can be measured 3612users. The next benchmark measures the possible throughput for a
3594by sending multiple messages in parallel and measuring packet loss. Note that 3613transport. Throughput can be measured by sending multiple messages in
3595not only UDP but also the TCP transport can actually loose messages since the 3614parallel and measuring packet loss. Note that not only UDP but also the
3596TCP implementation drops messages if the @code{write} to the socket would 3615TCP transport can actually loose messages since the TCP implementation
3597block. While the SMTP protocol never drops messages itself, it is often so 3616drops messages if the @code{write} to the socket would block. While the
3617SMTP protocol never drops messages itself, it is often so
3598slow that only a fraction of the messages can be sent and received in the 3618slow that only a fraction of the messages can be sent and received in the
3599given time-bounds. For this benchmark we report the message loss after 3619given time-bounds. For this benchmark we report the message loss after
3600allowing t time for sending m messages. If messages were not sent (or 3620allowing t time for sending m messages. If messages were not sent (or
3601received) after an overall timeout of t, they were considered lost. The 3621received) after an overall timeout of t, they were considered lost. The
3602benchmark was performed using two Xeon 2 GHZ machines running RedHat 8.0 with 3622benchmark was performed using two Xeon 2 GHZ machines running RedHat 8.0
3603sendmail. The machines were connected with a direct 100 MBit ethernet 3623with sendmail. The machines were connected with a direct 100 MBit ethernet
3604connection.@ Figures udp1200, tcp1200 and smtp-MTUs show that the throughput 3624connection.@ Figures udp1200, tcp1200 and smtp-MTUs show that the
3605for messages of size 1,200 octects is 2,343 kbps, 3,310 kbps and 6 kbps for 3625throughput for messages of size 1,200 octects is 2,343 kbps, 3,310 kbps
3606UDP, TCP and SMTP respectively. The high per-message overhead of SMTP can be 3626and 6 kbps for UDP, TCP and SMTP respectively. The high per-message
3607improved by increasing the MTU, for example, an MTU of 12,000 octets improves 3627overhead of SMTP can be improved by increasing the MTU, for example, an
3608the throughput to 13 kbps as figure smtp-MTUs shows. Our research paper) has 3628MTU of 12,000 octets improves the throughput to 13 kbps as figure
3609some more details on the benchmarking results. 3629smtp-MTUs shows. Our research paper) has some more details on the
3630benchmarking results.
3610 3631
3611@node Bluetooth plugin 3632@node Bluetooth plugin
3612@section Bluetooth plugin 3633@section Bluetooth plugin
3613@c %**end of header 3634@c %**end of header
3614 3635
3615This page describes the new Bluetooth transport plugin for GNUnet. The plugin 3636This page describes the new Bluetooth transport plugin for GNUnet. The
3616is still in the testing stage so don't expect it to work perfectly. If you 3637plugin is still in the testing stage so don't expect it to work
3617have any questions or problems just post them here or ask on the IRC channel. 3638perfectly. If you have any questions or problems just post them here or
3639ask on the IRC channel.
3640
3618@itemize @bullet 3641@itemize @bullet
3619@item What do I need to use the Bluetooth plugin transport? 3642@item What do I need to use the Bluetooth plugin transport?
3620@item BluetoothHow does it work? 3643@item BluetoothHow does it work?
@@ -3638,52 +3661,56 @@ have any questions or problems just post them here or ask on the IRC channel.
3638@subsection What do I need to use the Bluetooth plugin transport? 3661@subsection What do I need to use the Bluetooth plugin transport?
3639@c %**end of header 3662@c %**end of header
3640 3663
3641If you are a Linux user and you want to use the Bluetooth transport plugin you 3664If you are a Linux user and you want to use the Bluetooth transport plugin
3642should install the BlueZ development libraries (if they aren't already 3665you should install the BlueZ development libraries (if they aren't already
3643installed). For instructions about how to install the libraries you should 3666installed). For instructions about how to install the libraries you should
3644check out the BlueZ site (@uref{http://www.bluez.org/, http://www.bluez.org}). 3667check out the BlueZ site
3645If you don't know if you have the necesarry libraries, don't worry, just run 3668(@uref{http://www.bluez.org/, http://www.bluez.org}). If you don't know if
3646the GNUnet configure script and you will be able to see a notification at the 3669you have the necesarry libraries, don't worry, just run the GNUnet
3647end which will warn you if you don't have the necessary libraries. 3670configure script and you will be able to see a notification at the end
3671which will warn you if you don't have the necessary libraries.
3648 3672
3649If you are a Windows user you should have installed the 3673If you are a Windows user you should have installed the
3650@emph{MinGW}/@emph{MSys2} with the latest updates (especially the 3674@emph{MinGW}/@emph{MSys2} with the latest updates (especially the
3651@emph{ws2bth} header). If this is your first build of GNUnet on Windows you 3675@emph{ws2bth} header). If this is your first build of GNUnet on Windows
3652should check out the SBuild repository. It will semi-automatically assembles a 3676you should check out the SBuild repository. It will semi-automatically
3653@emph{MinGW}/@emph{MSys2} installation with a lot of extra packages which are 3677assembles a @emph{MinGW}/@emph{MSys2} installation with a lot of extra
3654needed for the GNUnet build. So this will ease your work!@ Finally you just 3678packages which are needed for the GNUnet build. So this will ease your
3655have to be sure that you have the correct drivers for your Bluetooth device 3679work!@ Finally you just have to be sure that you have the correct drivers
3656installed and that your device is on and in a discoverable mode. The Windows 3680for your Bluetooth device installed and that your device is on and in a
3657Bluetooth Stack supports only the RFCOMM protocol so we cannot turn on your 3681discoverable mode. The Windows Bluetooth Stack supports only the RFCOMM
3658device programatically! 3682protocol so we cannot turn on your device programatically!
3659 3683
3684@c FIXME: Change to unique title
3660@node How does it work2? 3685@node How does it work2?
3661@subsection How does it work2? 3686@subsection How does it work2?
3662@c %**end of header 3687@c %**end of header
3663 3688
3664The Bluetooth transport plugin uses virtually the same code as the WLAN plugin 3689The Bluetooth transport plugin uses virtually the same code as the WLAN
3665and only the helper binary is different. The helper takes a single argument, 3690plugin and only the helper binary is different. The helper takes a single
3666which represents the interface name and is specified in the configuration 3691argument, which represents the interface name and is specified in the
3667file. Here are the basic steps that are followed by the helper binary used on 3692configuration file. Here are the basic steps that are followed by the
3668Linux: 3693helper binary used on Linux:
3669 3694
3670@itemize @bullet 3695@itemize @bullet
3671@item it verifies if the name corresponds to a Bluetooth interface name 3696@item it verifies if the name corresponds to a Bluetooth interface name
3672@item it verifies if the iterface is up (if it is not, it tries to bring it up) 3697@item it verifies if the iterface is up (if it is not, it tries to bring
3673@item it tries to enable the page and inquiry scan in order to make the device 3698it up)
3674discoverable and to accept incoming connection requests 3699@item it tries to enable the page and inquiry scan in order to make the
3700device discoverable and to accept incoming connection requests
3675@emph{The above operations require root access so you should start the 3701@emph{The above operations require root access so you should start the
3676transport plugin with root privileges.} 3702transport plugin with root privileges.}
3677@item it finds an available port number and registers a SDP service which will 3703@item it finds an available port number and registers a SDP service which
3678be used to find out on which port number is the server listening on and switch 3704will be used to find out on which port number is the server listening on
3679the socket in listening mode 3705and switch the socket in listening mode
3680@item it sends a HELLO message with its address 3706@item it sends a HELLO message with its address
3681@item finally it forwards traffic from the reading sockets to the STDOUT and 3707@item finally it forwards traffic from the reading sockets to the STDOUT
3682from the STDIN to the writing socket 3708and from the STDIN to the writing socket
3683@end itemize 3709@end itemize
3684 3710
3685Once in a while the device will make an inquiry scan to discover the nearby 3711Once in a while the device will make an inquiry scan to discover the
3686devices and it will send them randomly HELLO messages for peer discovery. 3712nearby devices and it will send them randomly HELLO messages for peer
3713discovery.
3687 3714
3688@node What possible errors should I be aware of? 3715@node What possible errors should I be aware of?
3689@subsection What possible errors should I be aware of? 3716@subsection What possible errors should I be aware of?
@@ -3693,43 +3720,47 @@ devices and it will send them randomly HELLO messages for peer discovery.
3693 3720
3694Well there are many ways in which things could go wrong but I will try to 3721Well there are many ways in which things could go wrong but I will try to
3695present some tools that you could use to debug and some scenarios. 3722present some tools that you could use to debug and some scenarios.
3723
3696@itemize @bullet 3724@itemize @bullet
3697 3725
3698@item @code{bluetoothd -n -d} : use this command to enable logging in the 3726@item @code{bluetoothd -n -d} : use this command to enable logging in the
3699foreground and to print the logging messages 3727foreground and to print the logging messages
3700 3728
3701@item @code{hciconfig}: can be used to configure the Bluetooth devices. If you 3729@item @code{hciconfig}: can be used to configure the Bluetooth devices.
3702run it without any arguments it will print information about the state of the 3730If you run it without any arguments it will print information about the
3703interfaces. So if you receive an error that the device couldn't be brought up 3731state of the interfaces. So if you receive an error that the device
3704you should try to bring it manually and to see if it works (use @code{hciconfig 3732couldn't be brought up you should try to bring it manually and to see if
3705-a hciX up}). If you can't and the Bluetooth address has the form 3733it works (use @code{hciconfig -a hciX up}). If you can't and the
370600:00:00:00:00:00 it means that there is something wrong with the D-Bus daemon 3734Bluetooth address has the form 00:00:00:00:00:00 it means that there is
3707or with the Bluetooth daemon. Use @code{bluetoothd} tool to see the logs 3735something wrong with the D-Bus daemon or with the Bluetooth daemon. Use
3708 3736@code{bluetoothd} tool to see the logs
3709@item @code{sdptool} can be used to control and interogate SDP servers. If you 3737
3710encounter problems regarding the SDP server (like the SDP server is down) you 3738@item @code{sdptool} can be used to control and interogate SDP servers.
3711should check out if the D-Bus daemon is running correctly and to see if the 3739If you encounter problems regarding the SDP server (like the SDP server is
3712Bluetooth daemon started correctly(use @code{bluetoothd} tool). Also, sometimes 3740down) you should check out if the D-Bus daemon is running correctly and to
3713the SDP service could work but somehow the device couldn't register his 3741see if the Bluetooth daemon started correctly(use @code{bluetoothd} tool).
3714service. Use @code{sdptool browse [dev-address]} to see if the service is 3742Also, sometimes the SDP service could work but somehow the device couldn't
3715registered. There should be a service with the name of the interface and GNUnet 3743register his service. Use @code{sdptool browse [dev-address]} to see if
3716as provider. 3744the service is registered. There should be a service with the name of the
3717 3745interface and GNUnet as provider.
3718@item @code{hcitool} : another useful tool which can be used to configure the 3746
3719device and to send some particular commands to it. 3747@item @code{hcitool} : another useful tool which can be used to configure
3748the device and to send some particular commands to it.
3720 3749
3721@item @code{hcidump} : could be used for low level debugging 3750@item @code{hcidump} : could be used for low level debugging
3722@end itemize 3751@end itemize
3723 3752
3753@c FIXME: A more unique name
3724@node How do I configure my peer2? 3754@node How do I configure my peer2?
3725@subsection How do I configure my peer2? 3755@subsection How do I configure my peer2?
3726@c %**end of header 3756@c %**end of header
3727 3757
3728On Linux, you just have to be sure that the interface name corresponds to the 3758On Linux, you just have to be sure that the interface name corresponds to
3729one that you want to use. Use the @code{hciconfig} tool to check that. By 3759the one that you want to use. Use the @code{hciconfig} tool to check that.
3730default it is set to hci0 but you can change it. 3760By default it is set to hci0 but you can change it.
3731 3761
3732A basic configuration looks like this: 3762A basic configuration looks like this:
3763
3733@example 3764@example
3734[transport-bluetooth] 3765[transport-bluetooth]
3735# Name of the interface (typically hciX) 3766# Name of the interface (typically hciX)
@@ -3738,19 +3769,20 @@ INTERFACE = hci0
3738TESTMODE = 0 TESTING_IGNORE_KEYS = ACCEPT_FROM; 3769TESTMODE = 0 TESTING_IGNORE_KEYS = ACCEPT_FROM;
3739@end example 3770@end example
3740 3771
3772In order to use the Bluetooth transport plugin when the transport service
3773is started, you must add the plugin name to the default transport service
3774plugins list. For example:
3741 3775
3742In order to use the Bluetooth transport plugin when the transport service is
3743started, you must add the plugin name to the default transport service plugins
3744list. For example:
3745@example 3776@example
3746[transport] ... PLUGINS = dns bluetooth ... 3777[transport] ... PLUGINS = dns bluetooth ...
3747@end example 3778@end example
3748 3779
3749If you want to use only the Bluetooth plugin set @emph{PLUGINS = bluetooth} 3780If you want to use only the Bluetooth plugin set
3781@emph{PLUGINS = bluetooth}
3750 3782
3751On Windows, you cannot specify which device to use. The only thing that you 3783On Windows, you cannot specify which device to use. The only thing that
3752should do is to add @emph{bluetooth} on the plugins list of the transport 3784you should do is to add @emph{bluetooth} on the plugins list of the
3753service. 3785transport service.
3754 3786
3755@node How can I test it? 3787@node How can I test it?
3756@subsection How can I test it? 3788@subsection How can I test it?
@@ -3758,42 +3790,46 @@ service.
3758 3790
3759If you have two Bluetooth devices on the same machine which use Linux you 3791If you have two Bluetooth devices on the same machine which use Linux you
3760must: 3792must:
3793
3761@itemize @bullet 3794@itemize @bullet
3762 3795
3763@item create two different file configuration (one which will use the first 3796@item create two different file configuration (one which will use the
3764interface (@emph{hci0}) and the other which will use the second interface 3797first interface (@emph{hci0}) and the other which will use the second
3765(@emph{hci1})). Let's name them @emph{peer1.conf} and @emph{peer2.conf}. 3798interface (@emph{hci1})). Let's name them @emph{peer1.conf} and
3799@emph{peer2.conf}.
3766 3800
3767@item run @emph{gnunet-peerinfo -c peerX.conf -s} in order to generate the 3801@item run @emph{gnunet-peerinfo -c peerX.conf -s} in order to generate the
3768peers private keys. The @strong{X} must be replace with 1 or 2. 3802peers private keys. The @strong{X} must be replace with 1 or 2.
3769 3803
3770@item run @emph{gnunet-arm -c peerX.conf -s -i=transport} in order to start the 3804@item run @emph{gnunet-arm -c peerX.conf -s -i=transport} in order to
3771transport service. (Make sure that you have "bluetooth" on the transport 3805start the transport service. (Make sure that you have "bluetooth" on the
3772plugins list if the Bluetooth transport service doesn't start.) 3806transport plugins list if the Bluetooth transport service doesn't start.)
3807
3808@item run @emph{gnunet-peerinfo -c peer1.conf -s} to get the first peer's
3809ID. If you already know your peer ID (you saved it from the first
3810command), this can be skipped.
3773 3811
3774@item run @emph{gnunet-peerinfo -c peer1.conf -s} to get the first peer's ID. 3812@item run @emph{gnunet-transport -c peer2.conf -p=PEER1_ID -s} to start
3775If you already know your peer ID (you saved it from the first command), this 3813sending data for benchmarking to the other peer.
3776can be skipped.
3777 3814
3778@item run @emph{gnunet-transport -c peer2.conf -p=PEER1_ID -s} to start sending
3779data for benchmarking to the other peer.
3780@end itemize 3815@end itemize
3781 3816
3782 3817
3783This scenario will try to connect the second peer to the first one and then 3818This scenario will try to connect the second peer to the first one and
3784start sending data for benchmarking. 3819then start sending data for benchmarking.
3785 3820
3786On Windows you cannot test the plugin functionality using two Bluetooth devices 3821On Windows you cannot test the plugin functionality using two Bluetooth
3787from the same machine because after you install the drivers there will occur 3822devices from the same machine because after you install the drivers there
3788some conflicts between the Bluetooth stacks. (At least that is what happend on 3823will occur some conflicts between the Bluetooth stacks. (At least that is
3789my machine : I wasn't able to use the Bluesoleil stack and the WINDCOMM one in 3824what happend on my machine : I wasn't able to use the Bluesoleil stack and
3790the same time). 3825the WINDCOMM one in the same time).
3791 3826
3792If you have two different machines and your configuration files are good you 3827If you have two different machines and your configuration files are good
3793can use the same scenario presented on the begining of this section. 3828you can use the same scenario presented on the begining of this section.
3794 3829
3795Another way to test the plugin functionality is to create your own application 3830Another way to test the plugin functionality is to create your own
3796which will use the GNUnet framework with the Bluetooth transport service. 3831application which will use the GNUnet framework with the Bluetooth
3832transport service.
3797 3833
3798@node The implementation of the Bluetooth transport plugin 3834@node The implementation of the Bluetooth transport plugin
3799@subsection The implementation of the Bluetooth transport plugin 3835@subsection The implementation of the Bluetooth transport plugin
@@ -3801,12 +3837,13 @@ which will use the GNUnet framework with the Bluetooth transport service.
3801 3837
3802This page describes the implementation of the Bluetooth transport plugin. 3838This page describes the implementation of the Bluetooth transport plugin.
3803 3839
3804First I want to remind you that the Bluetooth transport plugin uses virtually 3840First I want to remind you that the Bluetooth transport plugin uses
3805the same code as the WLAN plugin and only the helper binary is different. Also 3841virtually the same code as the WLAN plugin and only the helper binary is
3806the scope of the helper binary from the Bluetooth transport plugin is the same 3842different. Also the scope of the helper binary from the Bluetooth
3807as the one used for the wlan transport plugin: it acceses the interface and 3843transport plugin is the same as the one used for the wlan transport
3808then it forwards traffic in both directions between the Bluetooth interface 3844plugin: it acceses the interface and then it forwards traffic in both
3809and stdin/stdout of the process involved. 3845directions between the Bluetooth interface and stdin/stdout of the
3846process involved.
3810 3847
3811The Bluetooth plugin transport could be used both on Linux and Windows 3848The Bluetooth plugin transport could be used both on Linux and Windows
3812platforms. 3849platforms.
@@ -3834,9 +3871,9 @@ platforms.
3834 3871
3835In order to implement the plugin functionality on Linux I used the BlueZ 3872In order to implement the plugin functionality on Linux I used the BlueZ
3836stack. For the communication with the other devices I used the RFCOMM 3873stack. For the communication with the other devices I used the RFCOMM
3837protocol. Also I used the HCI protocol to gain some control over the device. 3874protocol. Also I used the HCI protocol to gain some control over the
3838The helper binary takes a single argument (the name of the Bluetooth 3875device. The helper binary takes a single argument (the name of the
3839interface) and is separated in two stages: 3876Bluetooth interface) and is separated in two stages:
3840 3877
3841@c %** 'THE INITIALIZATION' should be in bigger letters or stand out, not 3878@c %** 'THE INITIALIZATION' should be in bigger letters or stand out, not
3842@c %** starting a new section? 3879@c %** starting a new section?
@@ -3844,17 +3881,17 @@ interface) and is separated in two stages:
3844@subsubsection THE INITIALIZATION 3881@subsubsection THE INITIALIZATION
3845 3882
3846@itemize @bullet 3883@itemize @bullet
3847@item first, it checks if we have root privilegies (@emph{Remember that we need 3884@item first, it checks if we have root privilegies
3848to have root privilegies in order to be able to bring the interface up if it is 3885(@emph{Remember that we need to have root privilegies in order to be able
3849down or to change its state.}). 3886to bring the interface up if it is down or to change its state.}).
3850 3887
3851@item second, it verifies if the interface with the given name exists. 3888@item second, it verifies if the interface with the given name exists.
3852 3889
3853@strong{If the interface with that name exists and it is a Bluetooth 3890@strong{If the interface with that name exists and it is a Bluetooth
3854interface:} 3891interface:}
3855 3892
3856@item it creates a RFCOMM socket which will be used for listening and call the 3893@item it creates a RFCOMM socket which will be used for listening and call
3857@emph{open_device} method 3894the @emph{open_device} method
3858 3895
3859On the @emph{open_device} method: 3896On the @emph{open_device} method:
3860@itemize @bullet 3897@itemize @bullet
@@ -3866,14 +3903,14 @@ On the @emph{open_device} method:
3866discoverable 3903discoverable
3867@item closes the HCI socket and binds the RFCOMM one 3904@item closes the HCI socket and binds the RFCOMM one
3868@item switches the RFCOMM socket in listening mode 3905@item switches the RFCOMM socket in listening mode
3869@item registers the SDP service (the service will be used by the other devices 3906@item registers the SDP service (the service will be used by the other
3870to get the port on which this device is listening on) 3907devices to get the port on which this device is listening on)
3871@end itemize 3908@end itemize
3872 3909
3873@item drops the root privilegies 3910@item drops the root privilegies
3874 3911
3875@strong{If the interface is not a Bluetooth interface the helper exits with a 3912@strong{If the interface is not a Bluetooth interface the helper exits
3876suitable error} 3913with a suitable error}
3877@end itemize 3914@end itemize
3878 3915
3879@c %** Same as for @node entry above 3916@c %** Same as for @node entry above
@@ -3882,9 +3919,10 @@ suitable error}
3882 3919
3883The helper binary uses a list where it saves all the connected neighbour 3920The helper binary uses a list where it saves all the connected neighbour
3884devices (@emph{neighbours.devices}) and two buffers (@emph{write_pout} and 3921devices (@emph{neighbours.devices}) and two buffers (@emph{write_pout} and
3885@emph{write_std}). The first message which is send is a control message with 3922@emph{write_std}). The first message which is send is a control message
3886the device's MAC address in order to announce the peer presence to the 3923with the device's MAC address in order to announce the peer presence to
3887neighbours. Here are a short description of what happens in the main loop: 3924the neighbours. Here are a short description of what happens in the main
3925loop:
3888 3926
3889@itemize @bullet 3927@itemize @bullet
3890@item Every time when it receives something from the STDIN it processes the 3928@item Every time when it receives something from the STDIN it processes the