Merge lp:~martin-lp/hipl/hipl_exp_backoff into lp:hipl
Status: | Merged |
---|---|
Merged at revision: | 6320 |
Proposed branch: | lp:~martin-lp/hipl/hipl_exp_backoff |
Merge into: | lp:hipl |
Diff against target: |
392 lines (+157/-39) 8 files modified
hipd/hadb.c (+1/-0) hipd/hipd.c (+98/-7) hipd/hipd.h (+7/-9) hipd/input.c (+5/-2) hipd/maintenance.c (+40/-19) hipd/maintenance.h (+1/-0) hipd/output.c (+3/-1) lib/core/state.h (+2/-1) |
To merge this branch: | bzr merge lp:~martin-lp/hipl/hipl_exp_backoff |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
René Hummen | Approve | ||
Diego Biurrun | Approve | ||
Miika Komu | Approve | ||
Review via email: mp+96420@code.launchpad.net |
Description of the change
This branch introduces an exponential backoff mechanism for retransmissions. Previously retransmissions had static timeouts of 10 seconds before they are sent out again which is an eternity for example in mobility scenarios. In this branch the first retransmission is triggered after 100ms. Timeout for every consecutive retransmission is doubled in classic backoff fashion (100ms, 200ms, 400ms, ..., up to 12seconds).
To make this possible some changes to the hipd select() loop are required.
- before hipd had a timeout of 1 second on the select() call. This means when one second passes without any outgoing or incoming transmissions on the sockets the maintenance routine is called. Part of the maintenance is the check for retransmission. The problem: any retransmission can at the shortest be sent out after this 1 second passes.
- the select() timeout is now set dynamically. Everytime a retransmissions is buffered, sent out or cleared the timeout is updated with the newly introduced hip_update_
- the timeout value is set to the lowest backoff value of all buffered retransmissions and by default or at maximum to 1 second as before
- maintenance is supposed to be performed every second. To avoid running it too often and screwing up heartbeats the time of the last maintenace call is stored and maintenance is only called when at least 1 second has passed
- even though the select() call has at times shorter timeout values the previous hipd behaviour is not changed: maintenance is only called every second, only the retransmissions are sent out earlier than before.
I have tested these changes on virtual machines with the simulated packet dropping and in our testbed and it seems to work fine.
To test this locally you can simulate packet drops with this patch:
=== modified file 'hipd/output.c'
--- a/hipd/output.c 2012-02-23 15:10:37 +0000
+++ b/hipd/output.c 2012-02-24 09:26:03 +0000
@@ -87,8 +87,8 @@
/* Set to 1 if you want to simulate lost output packet */
#define HIP_SIMULATE_
/* Packet loss probability in percents */
-#define HIP_SIMULATE_
-#define HIP_SIMULATE_
+#define HIP_SIMULATE_
+#define HIP_SIMULATE_
I am glad that somebody implemented this. Seems ok to me but we better wait for an additional review. Thanks!