When devices communicate across the Internet, they send messages to one another. These messages are similar to mail in that they have a TO address and a FROM address. The TO address is the IP address of the device it wants to send the message to, and the FRIM address is the IP address (and port number) to send any return messages.
One of the rules of private IP addresses is that they should never be seen on the Internet because theoretically millions of devices could share that IP address, and routing to a private IP address would not work.
Therefore, they need to be removed somehow when a device with a private IP is sending messages. Network Address Translation (NAT) is the process of rewriting the addresses on a message before it is transmitted across the Internet or rewriting it after it has been received.
To keep track of everything, when the private IP and/or port number are overwritten, a record is kept of where the message goes. This is dynamic, and the record is created when an outbound message is sent. After a specified duration, the record is deleted.
This means that when a reply is received with the same details, the incoming message can be rewritten and readdressed to the device that initially sent the message.
NAT allows numerous devices to share one IP address and the necessary process of rewriting and translating the address (routing) information as messages are sent and received from the Internet.
NAT and VoIP calls
VoIP calls primarily consist of two parts. NAT can cause problems for VoIP calls, the most common of which is one-way audio.
- Setting up the call, and then
- Transmitting the audio
The transmitting of audio will happen on different ports than the ones used to set up the call. So if we remind ourselves about how NAT works, when a message is sent out, the router makes a record of the destination IP address and port.
When a reply is received from that exact location, it is compared against the record, and the message can then be redirected to the original internal address.
This works fine for the first part of a VoIP call (setting up the call). However, when audio transmission begins, it will use a different port. There is no record of a message to this IP address and specific port being used recently in the records, so the router doesn't know where to send the information. So it does the only thing it can do—it ignores it.
This means that your VoIP call has been set up without issue, but you won't hear the other person as the audio information doesn't get through.