OK. Last time we talked about the fact that ISPs are probably going to deploy some stop-gap IPv4-based solution while they implement IPv6 over the next couple years. This plan also buys a little more time for more Windows95 or other non-IPv6 capable hosts to be retired.
Important: the real solution is integration of IPv6 into all networks and devices, and a long-term transition from IPv4 to IPv6 entirely. In the near-term, though, it is becoming more apparent that ISPs are going to chose to use a few strategies - implement IPv6 but also find a way to get more out of IPv4 in the near-term. A smooth transition from IPv4 to IPv6 in advance of IPv4 address run-down would have been better - cheaper and more reliable - for the entire Internet community, but looking at the situation today the community has missed that window of opportunity. So, instead of “elegant integration and transition”, we’re going to be stuck with “stop-gap + elegant integration and transition”.
The initial discussions to extend the life of IPv4 largely involve sharing a single IPv4 address across multiple subscribers. There are a couple of interesting things for us to keep in mind about this class of solutions.
Quick Application – TCP/UDP – Port Number Review
Applications run today mostly over TCP or UDP, and use port numbers. There is a source port number and a destination port number. Most applications we think of as common use TCP. As an example, a web browser connection is based on TCP, with the destination port number being 80 – one of the well-known port numbers. These are port numbers between 0 and 1024. The source port number in the web browser example would be a “high port” – in the range 1025 – 65,536 (64K).
Just a moment ago, I connected, using IE7 on Windows Vista, to a handful of websites in quick succession. Using a sniffer package, I see the following TCP source ports in use during this few second period: 7647, 7659, 7660, 7662, 7663, 7666, 7664, 7667, 7668, 7670, 7671, 7672, 7673, 7674 – and maybe anther handful. Call it about 20 TCP source ports. So, for this one application, for 10 seconds, I used 20 of the available TCP source ports on my laptop.
When my computer makes these connections to the Internet, and I am at home behind my NAT firewall router, my laptop’s local TCP source port will be “mapped” to some source port on the outside of my NAT firewall. Maybe the same port number, maybe a different port number. Say that, in the example, my laptop address inside my house is 10.3.4.5, and my web browser opens a connection on TCP source port 7647. This might be mapped to the TCP source port 42355, 6.7.8.9 on the outside of the NAT box – where 6.7.8.9 is the IPv4 address on my NAT firewall’s WAN-facing (Internet-facing) interface, and 42355 was an available port.
It is important to note that the NAT box is able to recycle TCP and UDP port numbers pretty quickly. But it depends on the implementation just how quickly. I would think that if a port was unused for a few minutes it would be returned to the “free” list in most cases.
The Way it Works Today
In the case where my house – one subscriber – has their own NAT box and one routable IPv4 address on the WAN-facing interface, all the internal machines have to share those available 64,512 (64K – 1024) TCP port numbers. For me, that’s a few PCs and a TiVo machine. I’m not quite sure how many TCP ports my TiVo box uses, but I’ll guess it is not more than, say, 20.
So, then, the high-water mark for my household might be around 100 ports in use at a time. For today’s applications that is probably more than enough for the average household. So, sounds like I have 64,512 ports available to me for outbound sessions, and I only need 100. Lots of headroom.
How it Works if One IPv4 Address Shared Across Multiple Households
In this case, then those multiple households share the available TCP port numbers. If we say a household needs 100 ports, then we could share 64,512 ports across about 645 households.
So Then This Will Work Fine No Issues – Right?
Well, looks pretty good. We want it to work all the time though, and we want it to work for awhile – a few years. A lot can happen in a few years. One trend of late is applications that open lots of TCP connections – simultaneously using lots of TCP source ports. My understanding is that Google Maps, for example, opens a lot of TCP sessions and downloads maps in sections – to shorten the amount of time it takes to render the map. I just tried it, and I was able to fire off 64 TCP sessions in just a couple quick clicks. Maybe TiVo uses this to improve download speeds – wonder how many ports that might add. Now I’m less sure about my guess that TiVo probably doesn’t use more than 20 ports.
So, depending on how far this trend towards applications using multiple simultaneous flows goes, and how fast, perhaps we should plan on making 1000 ports available on the shared NAT box per household. That would mean only 64 households sharing a single IPv4 address.
Any Other Issues?
Yep. At least two. Topics for another post. Just to set the stage, think about:
- What do we do about inbound sessions? Suppose a household wants to run a webserver, on TCP port 80, and setup port forwarding to forward packets arriving on the routable address on the WAN side of the NAT box on port 80 to their internal HTTP server. If multiple households share a single routable address, who gets to use that specific well-known port?
- What do we do about any application that uses port forwarding? Bit Torrent, for example, wants to use certain inbound ports (TCP 6881 – 6999). Who gets to use those? And, for that matter, how do I setup port forwarding when the NAT is no longer in my closet, but it is a shared resource run by my service provider?
Good questions. We’ll talk about them next time.