… | |
… | |
305 | pair). |
305 | pair). |
306 | .Sh "Retrying" |
306 | .Sh "Retrying" |
307 | .IX Subsection "Retrying" |
307 | .IX Subsection "Retrying" |
308 | When there is no response to an auth request, the host will send auth |
308 | When there is no response to an auth request, the host will send auth |
309 | requests in bursts with an exponential backoff. After some time it will |
309 | requests in bursts with an exponential backoff. After some time it will |
310 | resort to \s-1PING\s0 packets, which are very small (8 bytes) and lightweight |
310 | resort to \s-1PING\s0 packets, which are very small (8 bytes + protocol header) |
311 | (no \s-1RSA\s0 operations required). A host that receives ping requests from an |
311 | and lightweight (no \s-1RSA\s0 operations required). A host that receives ping |
312 | unconnected peer will respond by trying to create a connection. |
312 | requests from an unconnected peer will respond by trying to create a |
|
|
313 | connection. |
313 | .PP |
314 | .PP |
314 | In addition to the exponential backoff, there is a global rate-limit on |
315 | In addition to the exponential backoff, there is a global rate-limit on |
315 | a per-IP base. It allows long bursts but will limit total packet rate to |
316 | a per-IP base. It allows long bursts but will limit total packet rate to |
316 | something like one control packet every ten seconds, to avoid accidental |
317 | something like one control packet every ten seconds, to avoid accidental |
317 | floods due to protocol problems (like a \s-1RSA\s0 key file mismatch between two |
318 | floods due to protocol problems (like a \s-1RSA\s0 key file mismatch between two |
318 | hosts). |
319 | hosts). |
|
|
320 | .PP |
|
|
321 | The intervals between retries are limited by the \f(CW\*(C`max\-retry\*(C'\fR |
|
|
322 | configuration value. A node with \f(CW\*(C`connect\*(C'\fR = \f(CW\*(C`always\*(C'\fR will always retry, |
|
|
323 | a node with \f(CW\*(C`connect\*(C'\fR = \f(CW\*(C`ondemand\*(C'\fR will only try (and re\-try) to connect |
|
|
324 | as long as there are packets in the queue, usually this limits the retry |
|
|
325 | period to \f(CW\*(C`max\-ttl\*(C'\fR seconds. |
|
|
326 | .PP |
|
|
327 | Sending packets over the \s-1VPN\s0 will reset the retry intervals as well, which |
|
|
328 | means as long as somebody is trying to send packets to a given node, \s-1GVPE\s0 |
|
|
329 | will try to connect every few seconds. |
319 | .Sh "Routing and Protocol translation" |
330 | .Sh "Routing and Protocol translation" |
320 | .IX Subsection "Routing and Protocol translation" |
331 | .IX Subsection "Routing and Protocol translation" |
321 | The gvpe routing algorithm is easy: there isn't any routing. \s-1GVPE\s0 always |
332 | The \s-1GVPE\s0 routing algorithm is easy: there isn't much routing to speak |
322 | tries to establish direct connections, if the protocol abilities of the |
333 | of: When routing packets to another node, \s-1GVPE\s0 trues the following |
323 | two hosts allow it. |
334 | options, in order: |
324 | .PP |
335 | .IP "If the two hosts should be able to reach each other directly (common protocol, port known), then \s-1GVPE\s0 will send the packet directly to the other node." 4 |
325 | If the two hosts should be able to reach each other (common protocol, ip |
336 | .IX Item "If the two hosts should be able to reach each other directly (common protocol, port known), then GVPE will send the packet directly to the other node." |
326 | and port all known), but cannot (network down), then there will be no |
337 | .PD 0 |
327 | connection, point. |
338 | .ie n .IP "If this isn't possible (e.g. because the node doesn't have a \*(C`hostname\*(C' or known port), but the nodes speak a common protocol and a router is available, then \s-1GVPE\s0 will ask a router to ""mediate"" between both nodes (see below)." 4 |
|
|
339 | .el .IP "If this isn't possible (e.g. because the node doesn't have a \f(CW\*(C`hostname\*(C'\fR or known port), but the nodes speak a common protocol and a router is available, then \s-1GVPE\s0 will ask a router to ``mediate'' between both nodes (see below)." 4 |
|
|
340 | .IX Item "If this isn't possible (e.g. because the node doesn't have a hostname or known port), but the nodes speak a common protocol and a router is available, then GVPE will ask a router to mediate between both nodes (see below)." |
|
|
341 | .ie n .IP "If a direct connection isn't possible (no common protocols) or forbidden (\*(C`deny\-direct\*(C'\fR) and there are any routers, then \s-1GVPE\s0 will try to send packets to the router with the highest priority that is connected already \fIand is able (as specified by the config file) to connect directly to the target node." 4 |
|
|
342 | .el .IP "If a direct connection isn't possible (no common protocols) or forbidden (\f(CW\*(C`deny\-direct\*(C'\fR) and there are any routers, then \s-1GVPE\s0 will try to send packets to the router with the highest priority that is connected already \fIand\fR is able (as specified by the config file) to connect directly to the target node." 4 |
|
|
343 | .IX Item "If a direct connection isn't possible (no common protocols) or forbidden (deny-direct) and there are any routers, then GVPE will try to send packets to the router with the highest priority that is connected already and is able (as specified by the config file) to connect directly to the target node." |
|
|
344 | .IP "If no such router exists, then \s-1GVPE\s0 will simply send the packet to the node with the highest priority available." 4 |
|
|
345 | .IX Item "If no such router exists, then GVPE will simply send the packet to the node with the highest priority available." |
|
|
346 | .IP "Failing all that, the packet will be dropped." 4 |
|
|
347 | .IX Item "Failing all that, the packet will be dropped." |
|
|
348 | .PD |
328 | .PP |
349 | .PP |
329 | A host can usually declare itself unreachable directly by setting it's |
350 | A host can usually declare itself unreachable directly by setting it's |
330 | port number(s) to zero. It can declare other hosts as unreachable by using |
351 | port number(s) to zero. It can declare other hosts as unreachable by using |
331 | a config-file that disables all protocols for these other hosts. |
352 | a config-file that disables all protocols for these other hosts. Another |
|
|
353 | option is to disable all protocols on that host in the other config files. |
332 | .PP |
354 | .PP |
333 | If two hosts cannot connect to each other because their \s-1IP\s0 address(es) |
355 | If two hosts cannot connect to each other because their \s-1IP\s0 address(es) |
334 | are not known (such as dialup hosts), one side will send a connection |
356 | are not known (such as dialup hosts), one side will send a \fImediated\fR |
335 | request to a router (routers must be configured to act as routers!), which |
357 | connection request to a router (routers must be configured to act as |
336 | will send both the originating and the destination host a connection info |
358 | routers!), which will send both the originating and the destination host |
337 | request with protocol information and \s-1IP\s0 address of the other host (if |
359 | a connection info request with protocol information and \s-1IP\s0 address of the |
338 | known). Both hosts will then try to establish a connection to the other |
360 | other host (if known). Both hosts will then try to establish a direct |
339 | peer, which is usually possible even when both hosts are behind a \s-1NAT\s0 |
361 | connection to the other peer, which is usually possible even when both |
340 | gateway. |
362 | hosts are behind a \s-1NAT\s0 gateway. |
341 | .PP |
363 | .PP |
342 | If the hosts cannot reach each other because they have no common protocol, |
364 | Routing via other nodes works because the \s-1SRCDST\s0 field is not encrypted, |
343 | the originator instead use the router with highest priority and matching |
|
|
344 | protocol as peer. Since the \s-1SRCDST\s0 field is not encrypted, the router host |
|
|
345 | can just forward the packet to the destination host. Since each host uses |
365 | so the router can just forward the packet to the destination host. Since |
346 | it's own private key, the router will not be able to decrypt or encrypt |
366 | each host uses it's own private key, the router will not be able to |
347 | packets, it will just act as a simple router and protocol translator. |
367 | decrypt or encrypt packets, it will just act as a simple router and |
348 | .PP |
368 | protocol translator. |
349 | When no router is connected, the host will aggressively try to connect to |
|
|
350 | all routers, and if a router is asked for an unconnected host it will try |
|
|
351 | to ask another router to establish the connection. |
|
|
352 | .PP |
|
|
353 | \&... more not yet written about the details of the routing, please bug me |
|
|
354 | \&... |
|
|