Re:A simple C implementation to stream H.264 to browser usin...
by callesgg on Thursday April 08, 2021 @07:55AM
(#26737646)
That is partially incorrect, STUN can punch a hole through even when both sides uses NAT in many cases. That is what I would classify as STUN’s main feature.
[ Parent
| on HN ]
Re:A simple C implementation to stream H.264 to browser usin...
by rashkov on Thursday April 08, 2021 @09:30AM
(#26738461)
Note that parent said “ if both peers are behind NAT without UPnP”. As far as I know, there’s no way to punch holes / open ports automatically without UPnP.
Re:A simple C implementation to stream H.264 to browser usin...
by callesgg on Thursday April 08, 2021 @04:55PM
(#26743653)
Go read about stun.
You send outgoing packets simultaneously from both sides. Causing both sides to add nat translation entry’s to their nat tables. When the packets arrive both sides already have nat translation entries and the packets go right through the nat.
Re:A simple C implementation to stream H.264 to browser usin...
by uuidgen on Thursday April 08, 2021 @09:44AM
(#26738584)
Punching holes doesn't work only when network devices in between are broken or are actively preventing it.
From the network point of view it looks the same as two hosts starting an outgoing TCP connection through nat - if that works then hole punching should work too.
Re:A simple C implementation to stream H.264 to browser usin...
by labawi on Thursday April 08, 2021 @03:55PM
(#26743011)
Not TCP. UDP - there are no connection in UDP, so the routers / firewalls don't really differentiate between a new connection and packets that happen to have the correct ip+port.
Some are trickier than others, as there are 2 IPs and 2 ports in a packet (at any point), and it can be hard to match all of them for the stricter devices, esp. on NATs that do source port randomization.
Re:A simple C implementation to stream H.264 to browser usin...
by a1369209993 on Thursday April 08, 2021 @04:15PM
(#26743210)
> when network devices in between are broken or are [maliciously] actively preventing it.
Those are called "middleboxes" (IIRC) and they're unfortunately somewhat pervasive.