Commit Graph

97 Commits

Author SHA1 Message Date
Joshua Kissoon
70bf6044b3 Added toString to statistician 2014-05-07 21:23:04 +05:30
Joshua Kissoon
718fa78b9d Statistician
- Returns some times in milliseconds instead of microseconds

KadServer
- Made a few operations synchronized
- Handled the exception when the timer is already canceled
2014-05-07 11:22:02 +05:30
Joshua Kissoon
1bee79789d Statistician
- Formatted the double returned by averages
2014-05-07 10:07:12 +05:30
Joshua Kissoon
67f6a0fe07 Statistician
- Added a method to find average content lookup route length
2014-05-07 09:46:48 +05:30
Joshua Kissoon
b90a87b149 Statistician
- Added measuring the route Length (Hop Length) of content lookup operation
2014-05-07 09:26:29 +05:30
Joshua Kissoon
92ce527c0c Statistician
- Changed over to using nanoseconds instead of milliseconds
-- Better Accuracy
-- milliseconds is not always properly measured
2014-05-07 00:54:55 +05:30
Joshua Kissoon
095738dcbc Statistician
- Added Timing Node Bootstrap.
- Added timing content lookup operation.
2014-05-07 00:41:49 +05:30
Joshua Kissoon
baeb656050 Cleaned up the code a bit
- Removed some unnecessary exception throwing
2014-05-06 12:59:43 +05:30
Joshua Kissoon
64dfdda1c3 Added a few utility methods 2014-05-06 09:53:06 +05:30
Joshua Kissoon
2adfc9b277 Statistics
- Added aggregation of total data sent and received by Server
2014-05-06 09:27:40 +05:30
Joshua Kissoon
899390b4a3 Statistics
- Renamed the statistics class to Statistician since that's is what it is - a statistician that manages the Kad statistics
- Passed the statistician to our Server to collect data
2014-05-06 09:21:34 +05:30
Joshua Kissoon
7817100253 Statistics
- Started working on a statistics class to collect Kad statistics
2014-05-06 09:13:16 +05:30
Joshua Kissoon
8aecda34c7 Added methods to start and stop the refresh operation 2014-05-05 18:03:57 +05:30
Joshua Kissoon
8d3ceb3ae1 We need to synchronize some toString methods since they access some data structures that cannot be modified concurrently 2014-05-05 15:47:07 +05:30
Joshua Kissoon
d920f2621e Added synchronization to prevent concurrency exceptions 2014-05-05 14:54:49 +05:30
Joshua Kissoon
0c4a40d9ca Removed some unnecessary print statements 2014-05-05 14:05:00 +05:30
Joshua Kissoon
37337afc66 There was an error when we recursively called the synchronized KadBucket.insert method
- Fixed it by removing the recursion
2014-05-05 12:46:44 +05:30
Joshua Kissoon
1e2cc037de Synchronization
- We were getting some concurrency exceptions because certain data structures were being modified concurrently
- Solved the issues by synchronizing the methods modifying the data structures
2014-05-05 10:52:44 +05:30
Joshua Kissoon
cb42c507de Concurrency Modification Error Fixed
We were getting a concurrency Modification error on the treemap because multiple operations may have been accessing the RoutingTable's getAllNodes() method at once.
- Fixed it by making this method synchronized.
2014-05-01 19:22:26 +05:30
Joshua Kissoon
0ce64529c6 Saving State & Reloading
- Routing Table had a save state issue because of the KadConfiguration
-- I removed saving the configuration since this may change from boot to boot
-- Provided a way to set a new configuration to the routing table
-- Updated the serializer/deserializer
2014-05-01 16:52:31 +05:30
Joshua Kissoon
66b6a14ebc Routing Table
- Added a routing table interface to code to Interface not implementation
2014-05-01 15:03:20 +05:30
Joshua Kissoon
fa242fad6a Renamed the bucket classes and interface to clear up things 2014-05-01 14:42:21 +05:30
Joshua Kissoon
1e6b9f2e38 Replacement Cache update
- If we're trying to add a node that's already in the replacement cache, update the last seen time of this node
2014-05-01 11:44:25 +05:30
Joshua Kissoon
9c05736ef8 Updated content lookup operation and node lookup operation
- Use all nodes to these operations initially instead of the K-Closest because there may be the case that the K-Closest are offline
- The operation takes care of looking at the K-Closest.
2014-05-01 11:41:12 +05:30
Joshua Kissoon
4e643c7f3f Contact Management
- There was an improvement in the paper page 64 to set a contact as stale and replace it if it's stale, but only if there is a replacement, otherwise just keep a stale count. The stale count is the amount of time a contact failed to respond to a request.
- The above feature is now implemented now.
- Added the management of stale contacts code to insert and removal
2014-04-28 21:23:04 +05:30
Joshua Kissoon
b1bfba6d93 Kademlia Contact Removal
- Contact removal now working well, we only do removal when we need to get in touch with the contact for some reason.
- Replacement cache is now setup
2014-04-28 20:38:47 +05:30
Joshua Kissoon
fa47aceda9 Kad Server
- Added a specific exception to throw when the server is down

Kademlia Node
- Setup Shutdown proerly
- Updated a few things
2014-04-28 16:46:32 +05:30
Joshua Kissoon
54ac3fe740 Some major major changes to the entire Kademlia System.
Kademlia Node
- The Kademlia class is renamed to KademliaNode - this will now serve as the main node on the network
- The RoutingTable will be a part of this node
Node
- The node class is now a basic class containing information about a node to be used by peers on the network

RoutingTable
- Working on Evicting contacts from the routing table
- Working on Replacement Cache
- Written another simulation to test these new RoutingTable features
2014-04-28 15:25:07 +05:30
Joshua Kissoon
a2f48d2241 Content Refresh Operation improvement
- Added the improvement for content refresh operation from the paper, we keep the last time a content was republished, and on content update operations, we only republish if the last republish was before (current time - republishing time interval)
2014-04-26 23:19:13 +05:30
Joshua Kissoon
67c12438d1 Few minor updates and removal of completed @todos 2014-04-26 22:21:51 +05:30
Joshua Kissoon
41fb630515 Content Lookup Operation Update
Before the content lookup operation used to lookup a specified set of nodes then return the latest content; a short review of the paper showed that we only lookup until we find the Value then exit as soon as we do. Made the updates to the code.
2014-04-26 22:09:45 +05:30
Joshua Kissoon
4fab4320df Routing Table Contact Management
- Added last seen data to contact
- Contacts are not sorted by lastSeen
- Contact updating last seen time is handled

Built a simulation to test the contact last seen updates
2014-04-26 21:26:02 +05:30
Joshua Kissoon
6253ad0ca6 Removed a few completed @todo comments 2014-04-25 16:21:23 +05:30
Joshua Kissoon
7c24ed7cff Finished a few of the Todos
- Populate all of the K-Buckets on bootstrap
2014-04-25 16:17:09 +05:30
Joshua Kissoon
21b6667eb8 Routing Table Improvement
- Setup the RoutingTable to store contact instead of node
- This helps since we'll need more information in the routing to evict contacts, etc
2014-04-25 16:04:05 +05:30
Joshua Kissoon
c902ba26ab Removed a useless copy of the GetParameter class 2014-04-25 15:25:40 +05:30
Joshua Kissoon
bf3280f62e Few renames and minor changes 2014-04-25 15:23:34 +05:30
Joshua Kissoon
6978a8023b Moved the receiver interface to the message/receiver package 2014-04-19 20:11:10 +05:30
Joshua Kissoon
6503c79681 ContentLookupOperation
Had a bug in the content lookup operation, if the total amount of content needed was not found, a Routing exception was thrown instead of returning what was found. Fixed the issue!
2014-04-19 15:09:07 +05:30
Joshua Kissoon
8e6052de23 ContentLookupOperation
CLO was timing out even if it had found the specified amount of content needed. Fixed that by exiting after the specified # of content required has been found
2014-04-13 19:15:24 +05:30
Joshua Kissoon
c31e0002e2 Change the wait time on operations to 50ms 2014-04-13 18:58:40 +05:30
Joshua Kissoon
4888bf4dd4 Improve response check time
When doing a NodeLookup, Content Lookup or Connect operation, after sending the message, we used to wait(operation_timeout) time before checking for a result. 
Now what I'm doing is waiting for 100 ms and check for a result every 100ms; I keep a count of total time waited, and only when the total time > operation_timeout do we make a timeout.
So now we can handle the response if it comes in before Operation_timeout time is finished
2014-04-13 18:57:54 +05:30
Joshua Kissoon
eaeffeb0ba Store content in string so saved file is easily readable. 2014-04-06 17:01:27 +05:30
Joshua Kissoon
1a5991404d Updated the HashCalculator class to add some more functionality 2014-04-05 22:45:01 +05:30
Joshua Kissoon
33f9eea09f Updated HashCalculator to add MD5 hashing in there 2014-04-05 22:39:33 +05:30
Joshua Kissoon
51de9cbc82 Re-Arranged a few packages a bit
Added a HashCalculator class
2014-04-05 22:36:46 +05:30
Joshua Kissoon
2dde2a75e0 Setup Content Updating
- Didn't do this before, but now it's setup: content will be updated on the DHT if a StoreContentMessage is sent with a newer version of the content

GetParameter
- Updated the GetParameter so that it can be constructed from a KadContent object or a StorageEntryMetadata object
- Move it to the DHT package

Others
- Added a few methods to StorageEntryMetadata, StorageEntryManager& DHT to simplify conversions between KadContent, GetParameter & StorageEntryMetadata

Tests
- Written a test to check content updating
2014-04-05 21:07:57 +05:30
Joshua Kissoon
cc1d03ba81 Some comments and fixes 2014-04-02 18:39:16 +05:30
Joshua Kissoon
3e236f4d17 Now we use a StorageEntry class to send data accross peers
Out KadContent interface also now specifies a set of methods to force it's subclasses to do their own toByte conversions
2014-04-02 18:05:14 +05:30
Joshua Kissoon
9190b122c7 The current mechanism for serializing content will not work for complex content types.
Now we need to add methods to KadContent objects to provide the byte[] format of their content and to re-read the byte format of their content.
2014-04-02 16:35:08 +05:30