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

Datachannel Reliability Implementation #701

Closed
camnewnham opened this issue Mar 17, 2022 · 2 comments
Closed

Datachannel Reliability Implementation #701

camnewnham opened this issue Mar 17, 2022 · 2 comments

Comments

@camnewnham
Copy link
Contributor

camnewnham commented Mar 17, 2022

Currently RTCDataChannelInit doesn't appear to have any effect:

// TODO: Apply init settings.
// TODO: Set reliability, priority etc. properties on the data channel.

So by extension presumably all data channels created are reliable and unordered - even those that are remotely created to be unordered/unreliable.
ChannelType = (byte)DataChannelTypes.DATA_CHANNEL_RELIABLE_UNORDERED,

Are there any current plans to continue this implementation? If not; can you provide any guidance on implementation so I can investigate further (and PR if successful).

@sipsorcery
Copy link
Member

sipsorcery commented Mar 17, 2022

The SctpDataSender and SctpDataReceiver classes support both ordered and unordered packets. There are also a bunch of unit tests checking that both work. That'd be the place to start for a PR.

The SctpDataSender has a hard coded value of false for unordered. For the RTCPeerConnection options to have effect they need to get down to that method and the equivalent for the receiver.

It shouldn't be that big of a job. The big chunk of work, the SCTP implementation is done. I just lost steam at the end of if and didn't get around to wiring up all the configuration options. I defaulted to supporting the hardest case, or ordered packets, and left the easier cases for later. And of course real work got in the way and I didn't end up comign back to it.

@camnewnham
Copy link
Contributor Author

camnewnham commented Mar 18, 2022

Thanks for the advice. I've done some reading of the datachannel and sctp specs, and into your implementation of both.

From the datachannel spec:

SCTP, as specified in [RFC4960] with the partial reliability
extension (PR-SCTP) defined in [RFC3758] and the additional policies
defined in [RFC7496], provides multiple streams...

So those documents should define a pretty clear implementation plan for this feature - most notably the addition of the FORWARD_TSN chunk type.

They don't define the conditions for when a chunk should be abandoned - so it makes sense that we can plug in the maxRetransmits and maxPacketLifetime to determine this.

I'll look into implementing the extension and additional policies.

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

No branches or pull requests

2 participants