1. Distinguish devices in same network:

Every device on same network has private IP addresses which are unique. All of them shares one public IP address. Now how do server distinguish them by only seeing their public IP and send them data?

Well the answer is the server doesn’t see only IP address. It sees IP:Port. Every private IP connected to the server has same public IP but different port. The public IP belongs to your NAT. Your NAT assigns unique port to every private IP addresses and maps them. The mapping is like this [private IP, private port, public IP, public port, transport protocol].

So when your server sends a packet to public IP:port then the packet is forwarded to the mapped private IP:port. And your device with that private IP:Port receives it.

2. All devices in same network have same public ip address?

They have the same IP address externally

– NAT: network address translation – a method of mapping an IP address space into another by modifying network address information in the IP header of packets while they are in transit across a traffic routing device


Leave a Reply

Your email address will not be published. Required fields are marked *