On Sat, Dec 15, 2001 at 12:07:58AM -0500, Gianni Johansson wrote:
> Hi Oskar, Tavin:
>
> I modified Pending.receivedRequestInitiator() to decrement the htl when it
> restarts a pending chain. I think that gets us back to the intended
> behavior. I didn't try to address the tarpit issue.
>
> Here's my change. It's very small, but take a look at it since I don't know
> this part of the codebase that well.
It turns out this is all a bit trickier than we thought..
Gianni's change, by throwing the EndOfRouteException, causes the node whose HTL
gets decremented to zero due to automatic restarts to act as though it
were the end node in a successful chain. This means
DataNotFound/InsertReply is sent back.
So for a situation where the client would expect to see RouteNotFound,
she sees DataNotFound instead, and her inserts might actually wind up on
far fewer nodes than the requested HTL.
We could change this to simply fail and send back QueryRejected once HTL
reaches zero, but that propagates the zero HTL value in the
QueryRejected and causes the node receiving the QueryRejected to act
like the legitimate end of the chain, thereby causing the very same
problem.
We could add a check for HTL == 0 when receiving a QueryRejected and
make it simply relay the QueryRejected and fail, but that leaves you
with a situation where the very last node in the chain timing out causes
the whole request to fail, totally defeating the whole point of
restarts.
I think the only sensible solution in light of all this is to NOT
decrement HTL, but check the restarted count and when it reaches the HTL
value, fail with a QueryRejected. The node receiving the QueryRejected
would then take the HTL value from it which would be a decrement of one.
(Making sure to relay the QueryRejected if it is received with HTL zero).
We could also add a counter for QueryRestarted messages and perform the
same check when QueryRestarted is received, to address the tarpit
attack.
--
:: tavin cole (tcole at espnow.com) ::
if there's been a way to build it
there'll be a way to destroy it
things are not all that out of control
- stereolab
_______________________________________________
Devl mailing list
Devl at freenetproject.org
http://lists.freenetproject.org/mailman/listinfo/devl