Hi! After thinking a little bit about freenet routing, I think things could be easier, when using a form of "incomplete hypercube routing".
To determine the distance between two keys, take the number of bits, that differ (for example distance 000 to 001 is 1, distance from 000 to 111 is 3). Also each node gets a key. This key is the average of all keys in the datastore. (if in more than half of the keys in the datastore the n-th bit is set, it is set in the node key). Incremental calculation of this value should not be hard. When making a connection to a different node, the node key is requested. Now routing becomes easy: Just select all nodes, that have a smaller distance and route the request to them. If there are no such nodes (or all of them already know the request), throw the request as far away as possible, so hopefully it does not come back, and finds a different local minimum of the distance function. For deciding, if a data item is kept in the data store, take its distance to the node key and LRU value and combine them ... When storing new data, the node key can change (which should get rare, after the node only stores keys near the node key). In that case other nodes have to be informed. Why does this not work with the current distance function ? Because with the current function the average value of keys does not have any sensible value .... No need for keeping track of which keys were successful, and which weren't. Specializing of nodes should get faster. Just some thoughts ... Niklas _______________________________________________ Devl mailing list Devl at freenetproject.org http://lists.freenetproject.org/mailman/listinfo/devl
