Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the PeerId of the wantList owner to the protobuf message #2605

Closed
daviddias opened this issue Apr 26, 2016 · 4 comments
Closed

Add the PeerId of the wantList owner to the protobuf message #2605

daviddias opened this issue Apr 26, 2016 · 4 comments
Labels
kind/enhancement A net-new feature or improvement to an existing feature topic/bitswap Topic bitswap

Comments

@daviddias
Copy link
Member

Currently, bitswap leverages the information that swarm has about a connection in order to understand where the incoming wantList are coming from. This creates a dependency that in order for the protocol to work properly, Stream Multiplexing and Identify (a.k.a Id protocol) need to be in place, otherwise, the listener won't be aware of who is sending the want list.

Since IPFS is designed to work across a panoply of devices with different capabilities and with transports that won't always offer Stream Multiplexing (which is a requirement for the Identify protocol), I propose that we add to the wantList message protobuf one more field that includes the peerId of the sender of that wantList (which is also the same message used to send blocks).

This change won't cause any breaking change in go-ipfs. However, if we don't add it, I'll need to change how js-libp2p-swarm works, because the way it is designed favours creating a complete opaque box on how the connection was established to a given peer.

@daviddias daviddias added kind/enhancement A net-new feature or improvement to an existing feature topic/bitswap Topic bitswap labels Apr 26, 2016
@whyrusleeping
Copy link
Member

i'm hestitant to do this as in many cases it will significantly increase the bandwidth consumed by bitswap. Very often we send small one or two key messages to cancel a received block, or to notify that we want another block.

@daviddias
Copy link
Member Author

I see, it is an extra 32 Bytes. It might be inevitable though, for non multiplex connections or some packet switching schemes.

@whyrusleeping
Copy link
Member

You should always know who you are receiving packets from, this is guaranteed at different layers, the overhead of adding roughly 40 (34 for multihash, a few for protobuf framing) bytes onto each message, many of which are only 40 bytes themselves is terrible. This sort of thing causes huge bandwidth bloat and waste.

@daviddias
Copy link
Member Author

Agreed, we made it work on js-ipfs in a way that is nice as well :) Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement A net-new feature or improvement to an existing feature topic/bitswap Topic bitswap
Projects
None yet
Development

No branches or pull requests

2 participants