Closed Bug 1464914 Opened 7 years ago Closed 2 years ago

WebRTC DataChannel unordered is not working if channel is negotiated

Categories

(Core :: WebRTC: Networking, defect, P2)

60 Branch
defect

Tracking

()

RESOLVED FIXED
121 Branch
Tracking Status
firefox121 --- fixed

People

(Reporter: useruser, Assigned: boivie)

Details

Attachments

(2 files)

Attached file negotiated.zip
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:60.0) Gecko/20100101 Firefox/60.0 Build ID: 20180516032328 Steps to reproduce: I create a set of 3 negotiated datachannels of which some are created with {ordered: false} I then transmit data through the unordered channels with packet loss between the two peers. Actual results: The datachannel behaves as if it was an ordered channel. Expected results: The datachannel should allow unordered messages to arrive. I'm attaching relevant firefox logs obtained using these instructions: https://github.com/nplab/WebRTC-Data-Channel-Playground/wiki/Analyze-Data-Channel-traffic-with-Wireshark In those logs the channel with label "uu" is supposed to be unreliable unordered yet it behaves as if it were reliable and ordered.
It seems to me as if the `DATA_CHANNEL_FLAGS_WAITING_ACK` flag is incorrectly set for a negotiated channel: https://dxr.mozilla.org/comm-central/source/mozilla/netwerk/sctp/datachannel/DataChannel.cpp#2724. Randell, any thoughts?
Flags: needinfo?(rjesup)
Yes, probably the mFlags |= WAITING_ACK if statment should be inside the "if (!(mFlags & EXTERNAL_NEGOTIATED)) {" since we'll never get an ACK for an external negotiated channel
Flags: needinfo?(rjesup)
Component: Untriaged → WebRTC: Networking
Product: Firefox → Core
Marking confirmed based on code inspection in comment 2.
Status: UNCONFIRMED → NEW
Rank: 18
Ever confirmed: true
Priority: -- → P2
Severity: normal → S3

RFC8832: "However, before the DATA_CHANNEL_ACK message or any other message
has been received on a data channel, all other messages ... MUST be sent
ordered, ... After the DATA_CHANNEL_ACK or any other message has been received
on the data channel, messages containing user data MUST be sent ordered on
ordered data channels and MUST be sent unordered on unordered data channels."

Before this commit, it always expected DATA_CHANNEL_ACK, but as some clients
don't send it (spec violation, but that's how it is), it would then always send
ordered even on unordered channels.

What is mentioned above from the RFC shouldn't apply to pre-negotiated data
channels, as those don't explicitly send DATA_CHANNEL_OPEN/ACK. This commit
also ensures that those send unordered on unordered channels from the start.

Depends on D191299

Assignee: nobody → boivie
Status: NEW → ASSIGNED

Try looks fine.

I have manually verified that pre-negotiated channels can now send unordered SCTP data chunks;

Frame 43: 174 bytes on wire (1392 bits), 174 bytes captured (1392 bits) on interface Fake IF, text2pcap, id 0 (outbound)
Ethernet II, Src: Receive_00 (20:52:45:43:56:00), Dst: Send_00 (20:53:45:4e:44:00)
Internet Protocol Version 4, Src: 10.2.2.2, Dst: 10.1.1.1
Stream Control Transmission Protocol, Src Port: 5000 (5000), Dst Port: 5000 (5000)
    Source port: 5000
    Destination port: 5000
    Verification tag: 0x471dff3c
    [Association index: disabled (enable in preferences)]
    Checksum: 0x68a35404 [unverified]
    [Checksum Status: Unverified]
    DATA chunk (unordered, complete segment, TSN: 3124953040, SID: 113, SSN: 0, PPID: 53, payload length: 109 bytes)
Data (109 bytes)
    Data: <redacted>…
    [Length: 109]

Reproduced using http://meet.new - check e.g. data sent on SCTP stream ID 113 or 115.

Attachment #9359094 - Attachment description: WIP: Bug 1464914: Relax sending ordered until OPEN_ACK → Bug 1464914: Relax sending ordered until OPEN_ACK
Attachment #9359094 - Attachment description: Bug 1464914: Relax sending ordered until OPEN_ACK → WIP: Bug 1464914: Relax sending ordered until OPEN_ACK
Attachment #9359094 - Attachment description: WIP: Bug 1464914: Relax sending ordered until OPEN_ACK → Bug 1464914: Relax sending ordered until OPEN_ACK
Pushed by bcampen@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/ff8bbef7ae74 Relax sending ordered until OPEN_ACK r=bwc,jesup
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 121 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: