You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When connecting two browsers directly via a CircuitRelayV2 server, I am seeing stable signaling (a single WebRTC connection 'stays up'), but a large number (~60) of DataChannels are created, each only sending a very small number of bytes (<100 bytes in nearly all cases). As an additional bit of information, Yamux opens 60 DataChannels and Mplex seems to open 20, but they both continue adding new DataChannels every five minutes. I don't think this would create an real issue in the short-term, but for a long running application (like ours) it will almost certainly be problematic fairly quickly.
According to this article the number of DataChannels supported by the browser are much, much less than the theoretical maximum (as little as 128) for FireFox as of ~2 years ago. Assuming nothing has changed, this would exhaust the number of available DataChannels in several hours. https://tensorworks.com.au/blog/webrtc-stream-limits-investigation/
~60 DataChannels, mostly created at once:
<100 Bytes sent on each DataChannel:
The number of DataChannels continues to grow, in my configuration a new DataChannel is opened approximately every five minutes. All the DataChannels appear to remain open (at least in excess of 15 minutes)
New DataChannels opened every five minutes (exactly):
Old DataChannels stay open:
Steps to reproduce the error:
Establish a Browser to Browser WebRTC connection with the WebRTC Transport
Open the 'brave://webrtc-internals' (or 'chrome://webrtc-internals')
Observe the large and ever growing number of DataChannels
The text was updated successfully, but these errors were encountered:
@justin0mcateer I am reasonably confident that js-libp2p webrtc-transport does not actually close data channels when it's done with them. That seems like a bug and will eventually result in running out of data channels. Chrome throws the following error when it can't create any more:
Uncaught (in promise) DOMException: Failed to execute 'createDataChannel' on 'RTCPeerConnection': RTCDataChannel creation failed
Could you please try with these changes to js-libp2p#1976
Sorry for the late feedback, I see this has been merged.
I did try this patch and it improved things. However, we ended up also adding the same change on the 'onEnd' handler of incoming connections. I think it is needed it cases where the connection is severed uncleanly.
Version:
0.45.9
Platform:
Subsystem:
WebRTC Transport
Yamux / Mplex
Severity:
Medium
Description:
When connecting two browsers directly via a CircuitRelayV2 server, I am seeing stable signaling (a single WebRTC connection 'stays up'), but a large number (~60) of DataChannels are created, each only sending a very small number of bytes (<100 bytes in nearly all cases). As an additional bit of information, Yamux opens 60 DataChannels and Mplex seems to open 20, but they both continue adding new DataChannels every five minutes. I don't think this would create an real issue in the short-term, but for a long running application (like ours) it will almost certainly be problematic fairly quickly.
According to this article the number of DataChannels supported by the browser are much, much less than the theoretical maximum (as little as 128) for FireFox as of ~2 years ago. Assuming nothing has changed, this would exhaust the number of available DataChannels in several hours.
https://tensorworks.com.au/blog/webrtc-stream-limits-investigation/
~60 DataChannels, mostly created at once:
![image](https://private-user-images.githubusercontent.com/2607229/255991797-7ad1cf75-e309-40b2-b938-ec5db7aee02b.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk3OTA3NTQsIm5iZiI6MTczOTc5MDQ1NCwicGF0aCI6Ii8yNjA3MjI5LzI1NTk5MTc5Ny03YWQxY2Y3NS1lMzA5LTQwYjItYjkzOC1lYzVkYjdhZWUwMmIucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIxNyUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMTdUMTEwNzM0WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9NTJmZmNjMzFkYzY1NjdkOGJiMjgzYTE2ZjA1NDA5NDQxZGQwYmFhNmVmNGZhNTI0MzBmMGJmMGY2YzU0ODZlOSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.BQbPjhftIxCe8qh_C2jsokmGUQrQmw6C_mUTe4qtEtQ)
<100 Bytes sent on each DataChannel:
![image](https://private-user-images.githubusercontent.com/2607229/255993098-ac5de6c2-6d84-430e-99ec-fcb9642c5bb0.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk3OTA3NTQsIm5iZiI6MTczOTc5MDQ1NCwicGF0aCI6Ii8yNjA3MjI5LzI1NTk5MzA5OC1hYzVkZTZjMi02ZDg0LTQzMGUtOTllYy1mY2I5NjQyYzViYjAucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIxNyUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMTdUMTEwNzM0WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9YjNhMTc4Zjg2MzcwYzRlMDZkZTU5N2IwODA5ZTQyZDA0MTllYTg3NzY0NDhmZDdmYjRjZmJhYzIyYjFlYTQ4ZCZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.QeCEi6U5QnMKfChkelRdxcGYJ2ter5yRTANDGOwnsg0)
The number of DataChannels continues to grow, in my configuration a new DataChannel is opened approximately every five minutes. All the DataChannels appear to remain open (at least in excess of 15 minutes)
New DataChannels opened every five minutes (exactly):
![image](https://private-user-images.githubusercontent.com/2607229/255994929-1eeb8e52-d7c7-43e7-8c9a-1927fb012e49.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk3OTA3NTQsIm5iZiI6MTczOTc5MDQ1NCwicGF0aCI6Ii8yNjA3MjI5LzI1NTk5NDkyOS0xZWViOGU1Mi1kN2M3LTQzZTctOGM5YS0xOTI3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NTJjNDA1ODg0MDQ2MmE3MTdhYjlmMyZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.-hFxkfsSOnHIitIri5Iht4eefeJqmC4gXxI1CelPVrg)
Steps to reproduce the error:
The text was updated successfully, but these errors were encountered: