Untitled

<aside> 📖 Features

The NAT-enabled router does not look like a router to the outside world. Instead the NAT router behaves to the outside world as a single device with a single IP address.

In essence, the NAT-enabled router is hiding the details of the home network from the outside world.

The router gets its address from the ISP’s DHCP server, and the router runs a DHCP server to provide addresses to computers within the NAT-DHCP-router-controlled home network’s address space.

</aside>

Types of NATs

Full Cone NAT

Restricted Cone NAT

Port Restricted NAT

Symmetric NAT


<aside> 📖 Hairpinning

Untitled

packet from internal address to external address translated properly (internal mapped to external)

</aside>


NAT Implications

<aside> 📖 Connection Reversal

Untitled

Server B can’t send packets to A since A hasn’t opened up a connection to B.

Hence B need to use a rendezvous server R (which both A and B can connect to) to tell A to open a connection to B, which is called Connection Reversal.

</aside>

<aside> 📖 Relay

Untitled

When both hosts are behind the NAT, which means that both of them can’t open a connection to the other.

A relay server R is needed to forward the packages between A and B.

</aside>

<aside> 📖 NAT Hole-Punching

Untitled

Both A and B use a server to store their external IP:port, so that they can each get the other’s external IP:port from the server.

In not-full-cone situations, A and B can send a request to the other simultaneously to force their NATs to set up mappings.

</aside>