Private and public IP's
IP addresses

Every computer (or, more precisely, every network interface) which is part of a TCP/IP network (the protocol used by computers to intercommunicate), must have an IP address which identifies it among all the other computers on that same network. This is true for any computer and for any network, be it your small office network or the Internet itself. You can think of a computer's IP address as someone's post address: it must be able to identify uniquely the sender and destinataire of every TCP/IP transmission on the network, exactly as a postal address is needed for sending postcards to someone and just to that person.

When the TCP/IP protocol was planned, nobody could imagine that the number of computers connected to the Internet would grow at such a fast rate. This is why the IP protocol was designed in such a way, that an IP address is made up of four numbers which range goes from 0 to 255. But these are too few addresses for the number of computers the Internet will have in a few years! This is where the concepts of Private IPs and dynamic IPs come into play.


lan2 lan1 Internet lan2ip3 lan2ip2 lan2ip1 lan1ip3 lan1ip2 lan1ip1 lan2gw lan1gw server2 server1

Private IPs, Gateways and LANs

As we've seen before, each computer should have a unique IP address in order to be able to receive any IP packet which has been sent to it. The drawback is, that a lot of different IP addresses must be used, and that the maximum number of IP addresses is limited by the IP protocol itself. Following the example we made with someone's postal address, in order to safely receive a postcard my address must be different from everybody else's post address. Nevertheless, there would be no problem if my street address is exactly the same one as that of someone, who is living in a different city. In fact, this happens all the time: just imagine how many people's address is "Mountain Street", but in different towns of the world. Well, that works in the TCP/IP world too, just slightly different.

While from a first glance you might think that the Internet is a giant web of interconnected computers, things are a little bit different. What the Internet really is, is a network of networks. Imagine a small university building, containing some 50 computers, which are linked together in a LAN (Local Area Network). This LAN will handle pretty well the internal networking needs of the university: students and teachers will be able to exchange mail and data, to share a network directory, to use a network printer, and so on.

But in modern times, virtually every university needs a connection the big web, the Internet. That's great. But one of the beauties of the TCP/IP protocol is, that to connect our imaginary university to the Internet, we don't need to connect every single computer in our university building to the big web. We can do it much more easily. We leave our LAN just as it is: the university computer are connected to one another. And then we take one of our university's computer, and we connect it to any other computer which is already connected to the Internet. The university computer we chose for that task will be our gateway to the Internet. Any data flowing from the university to the external world, that is, any data flowing to the Internet, will have to pass through the gateway.

This is a rough scheme of the actual "geography" of the Internet: a network of networks connected by their respective gateways. What has all that got to do with IP addresses? Well, the network geography we just described has some interesting implications regarding IP addresses. For a proper delivery of the IP packets, a computer need only have a unique IP address inside its own Local Area Network; this is what we call a Private IP. Then, every computer which is physically connected to the Internet needs to have an IP address which is unique throughout all the Internet; this is called a Public IP. In the geography we just described, for every LAN only the gateway needs to have both a private and a public IP. All the other computers on the LAN can live perfectly with just a private IP. When a packet is sent to one of the computers on the LAN, it will carry the Public IP of the LAN's gateway as its destination; besides, it will carry additional information which will enable the destination LAN gateway to forward the packet to the one computer in the LAN which is actually waiting for it. But the rest of the Internet, including the packet sender, doesn't know anything about the destination LAN except for its gateway's public IP address.

An interesting consequence of that, is that it is perfectly possible for two computers which are part of different LANs (but which are connected to the Internet through their respective gateways) to have the same Private IP. There will be no room for confusion, because IP packets meant for these two computers will be sent, first of all, to two different gateways which have different Public IPs. The only requisite here is that each gateway has a different Public IPs, and that each computer on each gateway's Local Area Network has a different Private IP. As a result of it, in your home, office or even university there will probably be at most a couple of computers you have access to, and which have a Public IP. Take note of them, and ask your network administrator about their Public IP. You will need that for your streaming setup, because, as we will explain later, it would be your best choice to have the streaming server running on a computer which has a Public IP. Otherwise, you should stream to a public, free streaming server, or set up a dynamic DNS service for your dynamic IP connection.



Static vs. dynamic IPs

As we've seen, the possibility of having Private and Public IP greatly reduces the number of unique Public IPs needed to allow every computer which is connected to the Internet to send and receive IP packets. Nevertheless, another feature of IP protocol exists which is helping to make a more rational use of the limited Public IP pool: this is Dynamic IP addresses.

If you think about it, many of the computers in the world aren't connected to the Internet 24 hours a day, 365 days a year. It would be a great waste of resources to assign a fixed Public IP to a computer which is online, say, only a couple of hours a day. For all the rest of the time, its Public IP would be a 'dead' one- nobody could ping it, nor use it. This is somehow reflected in the difference between an on-demand Internet connection and a permanent Internet connection. Universities, companies, schools, etc. usually have a permanent connection to the Internet: they hired a cable which connects their gateway(s) to another gateway on the Internet. Reflecting that, their gateways have an IP address which has been permanently assigned to them, and that won't change over time. We call such an IP Address a Static IP Address, to reflect the fact that it doesn't change.

On the other hand, private users usually have an on-demand connection, such as ADSL or (now disappearing) 56K modem connection. An on-demand connection works in a slightly different way than a permanent one. The user has a device (for example, a 56K modem, an ADSL modem, or an ADSL router) which "calls" another similar device owned by the user's Internet Service Provider (ISP). An ISP is just a company which buys Internet bandwidth and resells it to end users, by establishing on-demand connections with them whenever they need to go on the Internet. So, what happens when my ADSL modem "calls" my ISP's ADSL modem ? After my identity has been confirmed, the ISP's ADSL device uses a special protocol to let my modem/router have a temporary connection to the Internet, i.e., a connection that will last only until I shut down my modem/router.

As we saw in the preceding paragraph, to be able to communicate on the Internet my modem/router needs to have an IP address. But in most on-demand Internet connection, this IP address will be assigned to my modem/router by the ISP's modem/router, and will surely change from one on-demand connection to the other. This is what we call a Dynamic IP Address, that is, an IP Address that can be assigned to different network interfaces over time. The protocol used for dynamically assigning IPs to on-demand users is called DHCP. One or more DHCP servers listen for incoming connections, and when a new computer connects to the network they are managing, they assign to it all the parameters needed for network configuration, possibly including a Dynamic IP address taken from a pool of available IP addresses. As soon as one user disconnects, its Dynamic IP is free again to be used by any other user. As for ISPs and on-demand users, in fact, every ISP has bought a certain number of Public IPs, or a Public IP Range. The ISP then assigns these IPs dynamically via DHCP to the end users just when they connect to the ISP's modem/router.

This is a rough approximation of how Dynamic IPs work. As you can imagine by now, Dynamic IPs are a great feature to preserve the Public IP pool from being rapidly consumed by the increasing number of Internet users. There is one big drawback to using Dynamic IPs though, at least from the end user's point of view. If you use a Dynamic IP for browsing the Internet, reading your email etc., everything will work just fine. But what if you want to set up your own website or streaming server ? Then you will regret not having a Public Static IPs. Let's see why.

DNS resolution and the drawback of Dynamic IPs

So what's the drawback of Dynamic IPs ? Well, to explain that we have to talk a little about Domain Name Space (DNS) first. As you have learned by now, every computer physically present on the Internet has an IP address. Whenever you need to access information on one computer over the Internet, you need to know its IP address. For example, if you want to look at StreamBOX.org's webpage, your computer needs to know the IP address of the computer which is physically keeping streambox.org's webpage (OK, things are a little bit more complicated than that, but let's live with this simplification for the moment). The problem is, us humans have a hard time memorizing series of numbers. Just imagine would happen if there were only IP addresses, and if I had to tell you "Hey, I made a nice website, have a look at it! Just connect to 83.137.99.39". Okay, I am sure you get the picture, IP addresses are just too hard for humans to remember.

That's why Domain Name Space has been created. Without entering into detail, what the DNS is, is a huge distributed database which converts IP addresses to much more meaningful names such as www.streambox.org. But remember ! The IP protocol, responsible for sending and receiving IP packets, knows nothing about these fancy names. For it, only IP addresses exist; the fancy names are only meaningful to us humans. So what happens when you want to make a webpage or a stream available to everybody on the Internet ? Well, you most surely need a meaningful name where people can access your stream, such as stream.mymusic.org/myradio.ogg.m3u. Nowadays, it's not a big deal to buy yourself an Internet address suited to your needs, provided nobody else already took it. But the problem is, that in order to be useful an Internet address needs to be mapped to a Public IP which doesn't change over time; that is, a Static Public IP. Just imagine what would happen if the Internet address www.streambox.org was mapped to a different Public IP every day! DNS servers, the computers responsible for keeping the huge DNS database up-to-date, would just get mad.

So we've discovered the big drawback of Dynamic Public IPs: they don't let you have a fixed, constant mapping between themselves and a meaningful Internet address that you can spread amongst your friends to let them connect to your stream or webpage. You could of course send them a mail with your updated Dynamic Public IP every time it changes, but that's not practical at all. So, if you have the chance to place your stream on a computer which has a Static Public IP that steadily corresponds to an Internet address, that's it ! You don't need much else. If, on the contrary, you don't have access to such a server, then you should find an alternative, such as:

  • putting your stream on a public, free streaming server
  • setting up a Dynamic DNS service for your Dynamic IP connection