Send gratuitous type 2 probe replies.

If we receive any traffic from another node, we periodically send back a
gratuitous type 2 probe reply with the maximum received packet length.
On the other node, this causes the udp and perhaps mtu probe timers to
be reset, so it does not need to send a probe request. Gratuitous probe
replies from another node also count as received traffic for this
purpose, so for nodes that also have a meta-connection, UDP keepalive
packets in principle can now solely be type 2 replies. This reduces the
amount of probe traffic even more.

To work, gratuitous replies should be sent slightly more often than
udp_discovery_keepalive_interval, so probe requests won't be triggered.
This also means that the timer resolution must be smaller than the
difference between the two, and at the moment it's kind of a hack.
This commit is contained in:
Guus Sliepen 2015-01-11 17:44:50 +01:00
parent 7b76b7ac35
commit ae5b56c03d
3 changed files with 51 additions and 13 deletions

View file

@ -174,7 +174,7 @@ static void timeout_handler(void *data) {
}
timeout_set(data, &(struct timeval){pingtimeout, rand() % 100000});
timeout_set(data, &(struct timeval){1, rand() % 100000});
}
static void periodic_handler(void *data) {