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

There is a chance of package lost in datachannel #1160

Open
BartolomeyKant opened this issue Apr 20, 2024 · 2 comments
Open

There is a chance of package lost in datachannel #1160

BartolomeyKant opened this issue Apr 20, 2024 · 2 comments

Comments

@BartolomeyKant
Copy link

BartolomeyKant commented Apr 20, 2024

I am working on application with functionality sending files between peers and it uses libdatachannel on both side.
File breaks into chunks by 512 Kb and sent to datachannel one by one. Receiver side collect all chunks back into file until chunk with EOF flag is received.
And sometimes file is corrupted.
After a few days of investigation I found out that datachannel may lost packages, and It's also true for localhost p2p connection.

Datachannel created with

reliability.type = rtc::Reliability::Type::Reliable;
reliability.unordered = false;
reliability.rexmit = 0;

For investigation I created two counters for sender and receiver sides and send sender's counter with data packet. If packet lost i can see it by matching counters.
It's quite difficult to reproduce, I think it's 1/10000 packets chance.

Also I collect Debug logs and there was no errors or any messages about data loss.
I am trying to reproduce this error with verbose logs but still without luck.

My question is. Does such datachannel settings guarantee data transmitting reliability?
I am using libdatachannel v0.18.
Maybe such error was fixed in newer version?

@voluntas
Copy link

reliability.unordered = false;
reliability.rexmit = 0;

This configuration means that DataChannel does not retransmit nor ensure the order of packets. Therefore, if packets are lost for some reason, they will not be resent, which naturally means there is a possibility of packet loss.

Is the issue here that packet loss is occurring on the localhost?

@paullouisageneau
Copy link
Owner

Reliable data channels are guaranteed not to lose messages. Could you please share code that reproduces the issue?

You should definitely test with a newer version since 0.18 is more than one year old and there have been two major releases since then.

@voluntas The data channel is reliable and ordered here, this is the legacy reliability API in 0.18, rexmit is ignored when type = Type::Reliable and unordered = false means ordered.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants