Why do we have NAT if we could just assign a public IP address?
If the private address block is simply used to allow the router to determine where packets can and cannot be forwarded from (because private addresses need to be unique on their own network, but can repeat on different networks), then why would you need a network address translation service?
Why wouldn't you just skip the private address altogether and assign a public one if the host needs to connect to a network?
Thanks to everyone, the answer is much clearer now. The reasoning for the private addresses had escaped me, and I was confused why we would need it when so many IP addresses were wasted through classed addressing. I didn't (and still don't really) understand why we couldn't have just reassigned IP's to make better use of the addresses that we already have.
One reason NAT exists is because, with IPv4, there are a severely limited number of addresses available (a theoretical maximum of about 4.3 billion). For this reason, in most residential circumstances, an Internet Service Provider provides at most one public IP address to a subscriber at a time. If you would like to send and receive packets on multiple machines, it is necessary to have some kind of a local-public conversion, in other words NAT.
IPv6 will change all that as there should be something like thousands or millions of IP addresses per square foot of the Earth's surface.
Why wouldn't you just skip the private address altogether and assign a public one if the host needs to connect to a network?
Because there are not enough public addresses in IP version 4 to give every possible Internet connected device a unique address. This is why IP version 6 uses more bits for the address range and has more addresses.
Private address blocks are not supposed to be routable over the public Internet (this is what makes them "private"). Since there are only 3 private blocks with a relatively small number of addresses within them, they are guaranteed to be reused by anyone and everyone who has a private network (private addresses ONLY need to be unquie within a private network, but another private network might reuse the same addresses). So you cannot just put the private address blocks "out there" - they will conflict with someone else who is using the same block elsewhere.
So this is why NAT is needed.
To directly answer your last statement, if you have enough public addresses available to you, then you don't need NAT to send and receive traffic. NAT isn't necessary for this reason if you aren't trying to "save" IP addresses. For completeness, I'll say this: some people rely on the following side effects of NAT for security reasons and that could be a reason to elect to use it even if you do have enough public IP addresses:
- users behind a NAT cannot receive incoming connections unless incoming traffic is explicitly forwarded to the them by the router
- since outgoing traffic from NAT looks like to external systems that it comes from the router's IP, this hides details of the machines behind the NAT from external systems, i.e. how many machines, their private IPs, etc.
(Personally I wouldn't rely on a NAT for security if I didn't otherwise need it but YMMV)
There is not an infinite amount of IPv4 addresses, which in turn has made ISP:s not wanting to give out multiple addresses to its customers (without extra fees). Thus everyone gets one public IP address (often not even static, to also be able to offer that for a price premium), and when multiple home devices became the norm, NAT routing was the solution that became standard. Hardware manufacturers rejoiced :-) .
That is the economic part of why we "need" NAT translation, and at least on a home user scale, I believe it has been the driving reason.
Once IPv6 hits in a big way, everything should get a publicly routable unique address. This will happen sometime, definitely within 10 years, perhaps within 5. If something is certain, it is that we are notoriously bad at predicting the breakthrough of this :-) .
Besides IP shortage there is another important reason: security.
Let's imagime large company with 10k+ computers. If all of them use real IP all 10k+ might be attacked from any where, so admin... oh, no: 1k+ admins should spent their time to fix, patch and slap on users' frolicsome but wry hands.
With gray IPs we eliminate half the danger or maybe more.