Due to NAT is the IP access count imperfect?

I found it difficult to find content on the internet about this. I would like to know in general what NAT (Network Address Translation) is, how it maps the private IPs to a public IP and especially where this is currently used.

When I contract a home internet plan if two people access an application on the internet at the same time from this network, will the sender IP present in the packets arriving at the server of that application be the same? This means that are they behind a NAT?

Some web applications use the IP address for certain purposes, such as counting how many times a link has been accessed. If i implement an application that counts all clicks on the link, the same person can click the link multiple times and this will be counted.

But counting the number of IPs that accessed the link is also not perfect. I wanted to better understand NAT to know in what situations using the sender IP can be useful.

Author: Sérgio Mucciaccia, 2016-05-12

1 answers

The best way to understand NAT is to think that every TCP/UDP packet coming from a network or certain IP can be changed at the output by your router/gateway(provided that this has the function of performing NAT), when a NAT rule is applied the header of this packet that defines the source IP is changed to a new

The change process occurs when the packet leaves the source equipment with the IP of your internal network and reaches the Gateway of your internal network that will be performing a NAT, porting when the packet arrives in the gateway the NAT performs the IP Exchange within the packet header and sends the request forward, this process allows communications with other networks that do not have routes to your private network, the destination will not know which IP from within your private network made this communication, because all requests were translated to a specific IP!

Where Is this currently used?

Simply in all in places, this process allows entire internal networks to access the internet, when you have an internal network with private IP's the only way out for all these IP's to navigate to the internet is to perform a NAT of its entire class or the desired IPs for the public IP of your contracted link, this is an example that may be simple to view, but of course the NAT can also be used to perform the translation internally within your Network where you may need use these tricks for something punctual and specific.

When I contract a home internet plan if two people access an application on the internet at the same time, its public IP seen from server will be the same? Is that a NAT?

Most of your questions were answered in the previous answer I believe, it was confusing the "server" part, but that's what I said, for the rest of the world No matter how many different IP'S of your internal network do access, everyone will only know the public IP, i.e. all accesses from your internal network are translated to the public IP.

Count accesses only looking at IP's will never be the best way, in general an analysis of the logs on the server that is receiving access, in these logs in addition to containing the source IP (nated or not, your application will never know), will also have information of the OS used, Browser version, and it is assumed that if different, so possibly it will be from different people. There is no 100% safe way to calculate access information, most of the time it is an estimate. Now if you develop the clients that will make access to your application, then it is possible from the same principle of log analysis, you can then generate unique IDs for each client and that somehow you have this information archived via log on your server, in this way all IP independent request with Nat or you will not have a single record in your server logs.

 5
Author: ederwander, 2016-05-13 15:30:50