Due to NAT, is IP access count imperfect?

1

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

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

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

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

    
asked by anonymous 13.05.2016 / 01:36

1 answer

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

The change process occurs when the packet leaves the source device with the IP of its internal network and arrives at the gateway of its internal network that will be effecting a NAT, bearing when the packet arrives at the gateway the NAT makes the exchange of the IP within the packet header and sends the request forward, this process allows communications with other networks that do not have routes to their private network, the destination will not know which IP from within their private network made this communication, since all the requests have been translated to a specific IP!

  

Where is it currently used?

Simply put, this process allows entire internal networks to access the internet. When you have an internal network with private IPs, the only way to get all these IP's to surf the Internet is to make a NAT of your 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 NAT can also be used to do the translation internally within your network where you might need to use these tricks for something timely and specific.

  

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

Most of your questions were answered in the previous answer. I believe, it was confusing to be part of the "Server", but that's what I said, to the rest of the world no matter how many different IP's on your internal network access, everything the world will only know the public IP, ie all accesses of its internal network are translated to public IP.

Counting access only by looking at IP's will never be the best way, usually an analysis of the logs on the server that is receiving the access in these logs in addition to contain the source IP (Nateado or not, your application will never know) , will also have information from the OS used, browser version, and it is assumed that if the same IP made access with different browsers and OS, then possibly it will be from different people. There is no 100% secure means of calculating access information, most often it is an estimate. Now if you develop the clients that will access your application, then it is possible to start from the same principle of log analysis, you can then generate unique ID's for each client and somehow you have this information archived via logging on your server , this way any independent IP request with Nat or will not have a single record in your server logs.

    
13.05.2016 / 13:28