From 880a4dff08b8d5bf72a43b0ac00def8120de0ca1 Mon Sep 17 00:00:00 2001 From: 20kdc Date: Sun, 19 Mar 2017 21:54:57 +0000 Subject: [PATCH] Adjust the tuning parameters for real-world usage. The tests assume a mesh network with known connections, the node doesn't, so unneeded packet leakage isn't really as controllable as I'd hoped. What's definitely important is that the system doesn't cache entries for long enough that it starts continuously sending packets the wrong way no matter what. --- culib.lua | 4 +++- relib.lua | 4 ++-- runtest.lua | 4 ++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/culib.lua b/culib.lua index 555296c..56c2efb 100644 --- a/culib.lua +++ b/culib.lua @@ -33,7 +33,9 @@ return function (hostname, transmit, onReceive, time) -- Expect another packet after this amount of time, -- or else clear the known receivers cache entry. - local tuningExpectContinue = 600 + math.random(1200) + -- Minimum should be less or equal to tuningAttempts * + -- tuningAttemptTime in relib. + local tuningExpectContinue = 15 + math.random(15) -- Flush the loop detector every so often. -- This is not a complete clear. diff --git a/relib.lua b/relib.lua index d67a757..2e15a08 100644 --- a/relib.lua +++ b/relib.lua @@ -15,8 +15,8 @@ return function (hostname, transmit, onRReceive, time) -- The maximum amount of timers (used to cap memory usage) local tuningMaxTimers = 0x200 local tuningClearAntiduplicate = 60 - local tuningAttempts = 8 - local tuningAttemptTime = 4 + local tuningAttempts = 12 + local tuningAttemptTime = 2.5 -- Just an array, no special index. -- Contents : { diff --git a/runtest.lua b/runtest.lua index c2f3734..c991a8b 100644 --- a/runtest.lua +++ b/runtest.lua @@ -78,8 +78,8 @@ local function generateMessage() nodes[na].output(nodenames[na], nodenames[nb], "T" .. tostring(math.random())) end --- ~Once every 5 seconds, think a polling script -local generateEvery = math.floor(50 / targetableCount) +-- This is set so it should reuse the same pair every 10 seconds(?) +local generateEvery = 1 local generateCount = 10000 while (generateCount > 0) or (#queuedCalls > 0) do if (systime % generateEvery) == 0 then