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

Transport-level bandwidth reporter #1008

Open
adlrocha opened this issue Oct 14, 2020 · 1 comment
Open

Transport-level bandwidth reporter #1008

adlrocha opened this issue Oct 14, 2020 · 1 comment
Labels
kind/enhancement A net-new feature or improvement to an existing feature

Comments

@adlrocha
Copy link

adlrocha commented Oct 14, 2020

Adding this here as it was discussed off-band. Right now libp2p isn't capable of giving the amount of total raw data exchanged between two nodes (after the muxer and crypto framings). The only bandwidth measurement available is at a stream level through go-libp2p-core/metrics/bandwidth.go: TotalBandwidth(). A wire-level measurement could come pretty handy, especially when debugging implementations after the muxer.

@raulk: To achieve this we may want to implement a transport wrapper that wraps connections and reports physical bytes read and written to the Reporter. For this we’d need to enhance the Reporter interface (or add a secondary Reporter interface that we can type assert against to know if the implementation has that feature).
Thus we will have two levels of bandwidth measurements in libp2p:

  • The transport would tell us how many bytes were written/read off the wire (disregarding the L3/L4 protocol framing), per connection (which we can then map to the peer).
  • The higher-up component can tell us how many bytes were written/read per protocol and per stream.
    We probably want a single sink for these stats, with various reporting sources.

cc @aarshkshah1992

@adlrocha adlrocha added the kind/enhancement A net-new feature or improvement to an existing feature label Oct 14, 2020
@adlrocha adlrocha changed the title Wire-level bandwidth reporter Transport-level bandwidth reporter Oct 14, 2020
@marten-seemann
Copy link
Contributor

What exactly would count in the case of QUIC? Only STREAM frames, all frames, or all packets? And how should retransmissions be handled?

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
Projects
None yet
Development

No branches or pull requests

2 participants