Skip to content

NAT traversal

MartinPulec edited this page Jan 3, 2018 · 30 revisions

One side behind NAT

In this scenario, we assume host A to have public IP while host B has a private IP address. In easiest scenario, we create an UDP hole from inside and send to it from outside. We are assuming use of default ports (5004 for video, 5006 for audio).

Behind NAT

If we act in a full-duplex way (both sender and receiver), you can use:

B$ uv -t decklink -c JPEG -d gl A

Please note that both -t and -d are required, if you want to receive only, use something like:

B$ uv -t testcard:32:32:10:UYVY -d gl A

to generate a "dummy" traffic. Furthermore, if you want to only send, specify ports explicitly:

B$ uv -t decklink -c JPEG -P 5004:5004

This is because if UltraGrid acts as a sender only, it uses random source port. It is better to use a deterministic port (although not strictly required).

Outside NAT

First, you have to obtain address of the B's NAT and source port , eg. by:

A$ sudo jnettop -i eth0 -x 'udp port 5004'

There you should see address and src port (in jnettop the column right next to address) of the NAT (in ideal case src port should be the the same as at B, by default 5004).

With this knowledge, you can send to B using the NAT address and port:

A$ uv -t decklink -P 5004:NAT_RX NAT_IP

Clone this wiki locally