As in, the design goal of NAT - sharing small number of external IPs by larger number of machines -- is best realized with what STUN calls "symmetric NAT". I am pretty sure the only reason full cone/restricted NAT type exists is performance, routers trying to keep translation table smaller for memory or CPU reasons.
And yet, based on router's internal implementation detail, there is now a protocol and an RFC and tools, detectors, software support, tutorials and so on.
That then covers more than the simple, opaque, and inadequate terminology of "cones" used by the earlier RFCs. i.e. see https://www.rfc-editor.org/rfc/rfc4787
See the following article, with the table "NAT Cone Types" for an easier to understand piece, and the sub-set of combinations which the cone terminology covers. https://tailscale.com/blog/how-nat-traversal-works/#naming-o...
As to "implicit firewall", as has been indicated, there isn't really such a thing, just the filtering behaviour.
It is not uncommon for a CGNAT to have EIM and EIF, hence they're "full cone"; so that is what one will generally experience when tethering to a LTE/5G mobile network.
I mean, there clearly is a firewall. If you buy a printer today, you don't really have to worry very much about how safe its network features are or if the firmware is updated, because if you put it behind a NAT router, it's not reachable from the global internet. Which is clearly a kind of firewall. And, generally, a good thing: it would be TERRIBLE for security if every shoddy network enabled device that anyone's bought for the last 30 years were reachable from the public internet. In the utopian "every device has a unique IPv6 address!", that would be the case.
It's true that an IPv6 gateway/router/whatever could have an explicit firewall that provides the same security, but the fact that this comes "by default" with a NAT router is honestly pretty nice for most users. And it's silly to deny it's an "implicit firewall", it clearly is. That's why I called the IPv6 version an "explicit firewall" two sentences ago.
Now given the garbage one tends to find in the software of lot of off the shelf devices, the only way to ensure they don't "reach out to the Internet" is with an explicit outbound firewall, which prevents them reaching out.
A web browser these days opens so may connections, and is so vulnerable, that one should view those sitting behind a consumer NAT is not behind a firewall.
FWIW - My day job includes implementing and maintaining (i.e. writing the software) for commercial NAT and firewall devices.
No - every device would be routable. Routability is not the same thing as reachability.
This whole implicit / explicit thing is a bit silly. A DSL router doing NAT on IPv4 has a firewall, and a DSL router that's on IPv6 has a firewall. If you throw packets with an RFC1918 destination address at the WAN port on a router doing v4/NAT, it will drop them because of its firewall - nothing to do with NAT.
Exactly. Making my private LAN devices globally routable is literally insane.
In the first place, NAT is something you apply to outbound connections, not inbound ones, so how can it change the behavior of inbound connections?
- we now have IP address markets
- we now have STUN/TURN/ICE
- we now have CGNAT
None of that was needed, but why make a proper fix when you can instead do a series of band-aids?
Oh well, too late for this now. I guess this is the lesson for future network protocol designers: small, backwards-compatible changes will have much higher chances of working. And saying "you must drop old thing entirely and redo everything from scratch" means it'll take more than 30 years for your protocol to be deployed.
Old nodes will have no idea how to address "new" ones, and if you want actual communication to happen, then addressability needs to function in both directions.
(You've also glossed over the fact that so much hardware assumed that an IP address was an int32. Swapping that out was always going to take a long time).
But, since it's not just a simple expansion of the address space and it fundamentally does things differently, this is impossible. And we've been stuck in limbo for about 28 years now.
Re backwards-compatible: we have no problems upgrading other protocols (like TLS or SSH) while keeping some amount of backward compatibility. The procedure is known: (1) create software which talks both old and new versions, auto-selecting right one (2) start deploying, initially in compatibility mode (3) once a very high fraction of devices are upgraded, start cutting off old versions.
IPv6 could have been the same. Make it use IPv4-like IP address formatting, and change network stack to emit IPv4 packets for ::ffff: addresses - this'd allow changing application software painlessly: the packets are IPv4 on the wire, but apps already use IPv6 code. Next, recommend that every router has some sort of SIIT translator by default: now you can mix and match IPv4 and IPv6 devices on same network (the performance might suffer but at least things work). Eventually you could go full IPv6, and then finally drop that NAT in the router.
But no. One of the large goals of IPv6 was to "simplify everything" so such solutions would be unacceptable. Everything that could be used to ease IPv4 transition was extra complexity, so this information is hidden and left for special circumstances only. IPv6 is a shining example what happens when people want to design nice, clean system without backwards compatibility.
Take your post for example -- you are outright saying "it is impossible [...] without breaking the principle that every node can address other node." and it is correct.. but how often do you have full node-to-node communication? Things like NAT64 can help you transition, but try finding it in a beginners example.
It's also backwards compatible with v4 in pretty much every way that you can be backwards compatible with v4. It's not v6's fault that v4 isn't forwards compatible with bigger address sizes.
> Increasing size of some structs and recompiling software is easy
This turns out to not be so easy. People are STILL writing new code with "struct sockaddr_in" allocations and "socket(AF_INET, ...)" and crap like that. That's the main thing blocking people from moving from dual stack to v6-only today.
- IPv4 and IPv6 are treated as completely separate things. So tunnels, firewalls, etc.. need to be configured twice if you want both IPv4 and IPv6 support. Any IP-related settings or database fields must be duplicated. (Linux didn't help here with iptables6 being completely separate; neither did FreeBSD by prohibiting combined ipv4/ipv6 sockets).
- Best practice in IPv4 is single internet-capable address per machine. Best practice in IPv6 is multiple internet-capable addresses per machine, and sometimes they also dynamically change. This means all the logic which assumes "machine's IP address" need to be rewritten.
- Usual practice in IPv4 is NAT + private IP ranges, which completely hides internet provider's IP allocation. Usual practice is IPv6 is "leaking" ISP-provided data to every end station.. if you get a new ISP, you get to renumber all the device and change every hardcoded IP.
- Address format is different - all the logic which touches IP address needs to be updated. And .split(":") is no longer going to cut it.
... etc.. there are tons of reasons which are not related to "struct sockaddr_in".
(One interesting observation is at lot of it is "best practice" or "implementation details": technically IPv6 is flexible enough to operate in IPv4-like mode... In theory, one can build IPv6 network on fixed addresses allocated by DHCP that uses NAT for internet access, so that existing tooling is preserved. In practice, of course, attempting to create such monstrosity will get you laughed out of the meeting.)
Exactly! There can't be anything beyond duct tape "engineering" in IT, because worse is "better"… You know?
Doing things properly would cost money. Nobody is willing to pay. So nothing will ever change.
That's not a fair characterization of the problem:
Unless everybody switches at the same time (~impossible), IPv6 requires paying for both stacks until the migration is complete. That's simply not economical, and not everybody on the internet can afford to disregard economics that way.
I'm also running IPv6 on all my hobbyist projects, but I really can't blame anyone that doesn't.
End result is that now everyone foots a different, worse bill, yet will still have to foot the previous bill because the workarounds have their limits when the attrition game pans out.
Yeah, the IP licensing costs are sure to bankrupt you.
Only hobbyists have enough money to do it. Large corporations can not afford the money and labor.
It's very flawed, but the flaws are very well understood and people actually seem to like operating all these workarounds.
Not saying that's good, just what I'm seeing in the field.
The greybeards philosophy is how it initially was. There aren't multiple networks, there is supposed to be ONE network, THE internet with ONE global address space.
The philosophy of those who grew up with NAT, who think that sounds insane. The internet is just the glue network between heaps and heaps of separate networks, each with their own, enclosed address space. Why would you want all networks to be one network, why should your printer have a globally-unique globally-routable address?
The two different philosophies don't tend to get along.
It was needed temporarily until we got more address space.
The original NAT RFC 1631 (later 3022) was released in 1994:
The huge advantage of this approach is that it can be installed
incrementally, without changes to either hosts or routers. (A few
unusual applications may require changes). As such, this solution can
be implemented and experimented with quickly. If nothing else, this
solution can serve to provide temporarily relief while other, more
complex and far-reaching solutions are worked out.
* https://datatracker.ietf.org/doc/html/rfc1631It served its purpose, and folks should be moving past it now.
* https://www.google.com/intl/en/ipv6/statistics.html
It's the majority of traffic, 53%, in the US.
Network security audits of dual-stack networks far too often show practically no open ports on IPv4, because of NAT, while IPv6 exposes everything. The security through obscurity of the practically unscannable IPv6 address space is not a firewall.
Repeat after me: NAT does not provide firewalling in any way.
What you think as 'firewalling' is just inability to route packets to your LAN[0] for someone further than your immediate gateway and this is true only until you have no active inbound NAT sessions.
If for some reason there is a session what allows anyone to contact the machine on your LAN (ie Full Cone NAT) then... anyone can contact your machine behind the NAT. I'm not sure there any router or appliance what would do that automatically anymore (because by default outbound session would create a thing called Address and Port Restricted NAT in TFA) but it's quite easy to do this by misconfiguration or some automatic mechanism, like UPnP.
If the problem is in the 'default configuration of many ISP-supplied routers' then you really should address that and not treat NAT as a firewall.
And last, but not least: every modern OS comes with a built-in firewall. Even Windows' one is pretty decent to block anything not explicitly allowed. There is no network scanning in IPv6, it's pointless or requires to sit on the wire to listen for NDP - and at this point NAT wouldn't help, too.
[0] or sometimes the packets are routed pretty fine in, it's just the absence of the state and/or proper rules what forbids the answer to be routed back. If you ever needed to troubleshoot an assymetric NAT you would know this.
ADD: this should had been a reply for your further comment, of course, but I leave it here.
This is why I worry about more IPv6 deployment. Too many people are ignorantly relying on IPv4 NAT as a layer of protection.
... NAT does not offer 'implicit firewall'
It's just what Average Hacker somewhere on the net can't route easily into your local network. If this is no longer an Average Hacker or he is sitting on your wire then the only thing what your NAT 'offers' is your false sense of security.
And by the way, nobody, noone forbade you from having explicit firewall rules denying anything from anywhere, not explicitly allowed. Just like it is done in a proper IPv4 configuration.
Sure, in a perfect world, migrating to IPv6 should be safe, but the default configuration on many ISP-supplied routers has no firewalling beyond what NAT offers.
More interesting questions are "what happens when there's multiple NAT IPs?" "how long do the symmetric rules stay around for?" "what keeps them around?"
Many carrier-side NATs are indeed often symmetric, unfortunately.
https://doc-kurento.readthedocs.io/en/latest/knowledge/nat.h...
Visualization is the more powerful tool to help readers conceptualize the text, but it's also difficult to get right. After some experimentation with diagramming tools, I ended up going for an ASCII-based view.
It's important to not overlook the section "Types of NAT in the Real World", which is just a quote from the relevant part of Wikipedia, to essentially say that in practice none of these theoretical models are perfectly found in real-world equipment. Still a useful differentiation to learn, but one shouldn't expect network equipment to behave as one of the described categories 100% of the time.