-
Notifications
You must be signed in to change notification settings - Fork 160
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
Make TCPMux IPv4/IPv6 aware #424
Conversation
Codecov Report
@@ Coverage Diff @@
## master pion/webrtc#424 +/- ##
==========================================
- Coverage 78.98% 78.82% -0.17%
==========================================
Files 34 34
Lines 3860 3882 +22
==========================================
+ Hits 3049 3060 +11
- Misses 630 636 +6
- Partials 181 186 +5
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
@jech Hopefully this fixes the issues you are seeing! Sorry it took so long to understand/reproduce the issue. |
Thanks a lot, Sean, I'll test it during the night (when nobody is using the sample server). FWIW, I've seen similar symptoms with UDPMux, see #518. I'm wondering if it's the same issue? |
Perhaps I'm doing something wrong, but it still doesn't work for me. I've put a TCP listener on port 8444, enabled
The client is the offerer and the media sender. It connects to the TCP listener, and sends some data:
It's sending some data:
However, I see no traffic in the opposite direction. After a while, the connection drops:
At that point, ICE gets into failed state, which triggers an ICE restart, and the cycle starts again. |
da0bbe4
to
4c93ae8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm!
Interestingly, I can only reproduce the issue if both TCP/IPv4 and TCP/IPv6 are unblocked. If I additionally block TCP/IPv6 ( |
Fairly certain UDPMux is also not IPv6 aware. If this works, we'll port the same fix to UDPMux |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lg! I don't have a repro to validate this, and will defer to @jech to confirm that it resolves the issue.
The behaviour is definitely better than it was: I now get an ICE failure consistently across browsers (tested with Brave and Firefox), which is something we all already have to handle gracefully, while previously I was getting erratic behaviour that I didn't know how to detect. Hence, unless Sean has any further ideas, I recommend merging this patch while keeping the bug report open. |
Hi! Because our use-case rely on two PR that are not merge yet ( pion/webrtc#1812 & pion/mediadevices#338 ), it is a bit difficult to test this PR against our own issue in a timely manner. So don't wait for my feedback. I will see with my colleague to try to organize our own fork/pr to test this ASAP. Thanks a lot ! |
4c93ae8
to
a813428
Compare
a813428
to
24aa30d
Compare
@jech I still have ice-tcp issues as well! With FireFox I am not able to connect when Pion is the controlled agent.
If FireFox sent another Binding Request everything would go to connected, not sure why it doesn't. I have attached the pcap here. You can reproduce at http://18.216.219.191:8080/ it is just running https://github.com/pion/webrtc/tree/master/examples/ice-tcp |
I am going to merge this, but just makes this a |
24aa30d
to
bad8502
Compare
TCPMux before would create one internal connection per ufrag. This could cause remote IPv6 traffic to be dispatched to a local IPv4 handler (or the inverse). The ice.Agent would then discard the traffic since a candidate pair must be the same IP version. This commit now creates two connections per ufrag. When requesting a connection for a ufrag the user must specify if they want IPv4 or IPv6. Relates to pion/webrtc#2125 Relates to pion/webrtc#1356
bad8502
to
5d993ad
Compare
TCPMux before would create one internal connection per ufrag. This could
cause remote IPv6 traffic to be dispatched to a local IPv4 handler (or
the inverse). The ice.Agent would then discard the traffic since a
candidate pair must be the same IP version.
This commit now creates two connections per ufrag. When requesting a
connection for a ufrag the user must specify if they want IPv4 or IPv6.
Relates to pion/webrtc#2125
Relates to pion/webrtc#1356