-
Notifications
You must be signed in to change notification settings - Fork 3
Simulating Bitswap #3
Comments
We need something like https://github.com/whyrusleeping/dhtHell and https://github.com/whyrusleeping/iptb ideally we would have a simulator that (in order of importance):
I think the ideal plan of attack here is
it's possible we could cut corners, and either use full iptb for now, or something like dhtHell. my worry there is that we must test bitswap in isolation (in addition to i conjunction with the rest of ipfs). Without isolation we cannot test the model honestly. after the above, we should be at a point where we can test + measure bitswap perf. once there, we can experiment with changing the decision engine, and other features. (this will be really valuable to test other things about bitswap). |
waiting on me (or others) to write a nice packaging tool. I have it sketched and the basics of how i want it to work down.
This code exists somewhere... i forget why i didnt merge it. |
Alright, for a basic simulator, it would be cool to have a program similar to dhthell so we can script different scenarios, being able to set different factors such as number of nodes, initial connections, routing latency, message latency, bandwidth, etc will be good. The main commands youll have will just be 'want' and 'cancel' blocks. and maybe things like 'expect' or 'wait' to test for behaviour. Take a look at the sample scripts in dhthell for some 'inspiration' and let me know if you have any questions. |
heres a network simulator tool i was working on a while back: https://github.com/ipfs/go-ipfs/tree/feat/netsim |
Hey as I'm doing this I have a few questions. By 'want' and 'cancel' do you mean actually interact with the WantManagers of test nodes? Like call WantBlocks and CancelWants? I currently have the simulation working similar to bitswap_test.go, utilizing the TestSessionGenerator and interacting with the Exchanges of the Instances (calling Exchange.HasBlock/WantBlock). Is this ok or is it too abstracted from what you wanted? |
Interacting with the Exhange API is good. We may want a bit closer access to some of the bitswap methods for scripting. (Maybe bitswap doesn't expose these at the moment) but that can probably come later as needed. 'Want' and 'Cancel' are part of the protocol definition in go-ipfs (not the paper yet sadly), they're sent as messages on the wire. Cancel is just a way of sending the other node diffs on the want list instead of sending the whole thing (which can be big) every time. |
link to sim: https://github.com/heems/bssim |
thats looking good 👍 make sure to have configurable block sizes for chunking so we can easily simulate 'large' file trees. |
cool, added configurable block sizes |
@jbenet mentioned it would be good to create a simulator for bitswap to get data and test classification methods.
How should I go about starting something like this?
The text was updated successfully, but these errors were encountered: