libp2p / js-libp2p

The JavaScript Implementation of libp2p networking stack.
https://libp2p.io
Other
2.29k stars 438 forks source link

Can you provide Qos functionality similar to MQTT? #1995

Closed rockey2020 closed 11 months ago

rockey2020 commented 1 year ago

"dependencies": { "@chainsafe/libp2p-gossipsub": "^10.1.0", "@chainsafe/libp2p-noise": "^13.0.0", "@chainsafe/libp2p-yamux": "^5.0.0", "@libp2p/bootstrap": "^9.0.5", "@libp2p/kad-dht": "^10.0.5", "@libp2p/mdns": "^9.0.5", "@libp2p/mplex": "^9.0.5", "@libp2p/peer-id-factory": "^3.0.3", "@libp2p/pubsub-peer-discovery": "^8.0.4", "@libp2p/tcp": "^8.0.5", "@libp2p/websockets": "^7.0.5", "@multiformats/multiaddr": "^12.1.7", "core.crypto": "^1.1.2", "deep-object-diff": "^1.1.9", "eventemitter2": "^6.4.9", "it-all": "^3.0.3", "it-map": "^3.0.4", "it-pb-stream": "^4.0.2", "it-pipe": "^3.0.1", "libp2p": "^0.46.7", "lodash-es": "^4.17.21", "p-queue": "^7.3.4", "uuid": "^9.0.0" },

Severity:

Description:

When I use stream to transfer a large amount of data, if the delay between node A and node B is high, the data will be lost or the data order will be mixed, what is the best solution?

If the qos function is provided it avoids the problem of data loss and disorganization

Qos: https://www.emqx.com/en/blog/introduction-to-mqtt-qos

Steps to reproduce the error:

image

achingbrain commented 1 year ago

if the delay between node A and node B is high, the data will be lost or the data order will be mixed

This should not be the case.

What underlying transport are you using here? It's usually down to the transport to provide delivery/ordering guarantees.

rockey2020 commented 1 year ago

import { webSockets } from "@libp2p/websockets"; import { tcp } from "@libp2p/tcp";

@achingbrain I currently use these two modules,This problem occurs in all

achingbrain commented 1 year ago

That's interesting, TCP provides delivery and order guarantees, and WebSockets run over TCP so should inherit those properties.

Please can you provide a runnable example that shows the problem?

github-actions[bot] commented 1 year ago

Oops, seems like we needed more information for this issue, please comment with more details or this issue will be closed in 7 days.

github-actions[bot] commented 11 months ago

This issue was closed because it is missing author input.