Page 2 of 4
What does the router do when it has identified a packet that doesn’t belong on your local network?
It passes it along to another router which, it hopes, does know how to send it to its destination. Routers are part of the architecture of the Internet and they “talk” to each other using one of a number of special protocols – RIP (Routing Information Protocol) is the most common - and pass information on about the routers that they are connected to. You can also add your own “routes” manually if you think you know better.
For most users routing protocols are fairly irrelevant. If you have a connection to an ISP then the router will simply forward all external packets to the ISP’s router, which is expected to take care of everything beyond this point.
To make it all work all you have to do is add a suitable router and give it the necessary information about its IP address and how to connect to the ISP. After these simple steps packets sent to it will be correctly routed. You also have to set up the client PCs on your network to use it as a “gateway” i.e. the place to send all non-local traffic but this is all fairly easy.
Everything works as described as long as your local network has a block of IP addresses it can use out on the Internet.
In practice IP addresses are in such short supply, in fact allocations of new addresses are about to run out, that this isn’t usually the case.
The latest version of the Internet Protocol IP v6 (see later) might well be the long-term solution to the IP address shortage but for the moment it still not very common.
There are blocks of IP addresses that are assigned for the use of “internal” networks and these are not regarded as valid Internet addresses. There are three blocks of IP Addresses set aside for use within private networks
10.0.0.0 - 10.255.255.255
18.104.22.168 - 172.31.255.255
192.168.0.0 - 192.168.255.255
You can safely use these as internal addresses and allocate them to machines as you wish. However to connect to the Internet you need a valid external Internet address and these are hard to come by.
The way that we get around this problem is to dynamically assign external IP addresses as and when they are needed. When you log on to your ISP, an IP address is assigned to you from a pool of addresses allocated to the ISP. This allows the block of addresses to be shared and reused and the only problem is that you are unlikely to get the same address each time.
Dynamic IP address assignment only causes a problem if you want to run, say, a web server for others to connect to. The problem is how can they know what IP address to use if you are not connected because one hasn’t been assigned to you yet!
The solution to the dynamic IP address assignment problem is to use dynamic DNS or dDNS. The DNS - Domain Name System - is just a big distributed lookup table that is used to convert a URL to an IP address. When you use a URL like www.example.com the system lookups up www.example.com using DNS and converts it into an external and routable IP address.
For public fixed IP addresses this all works very simply - you register a domain name and tell the DNS system what IP address is corresponds to. Of course the actual details are a little more complex in practice but this is the principle.
Now how can we make the DNS system work with a dynamic IP assignment?
The answer is that when a router makes a connection to the ISP it is allocated a new IP address which it will use as the source, i.e. return address in any IP data packet. That is it knows what IP address it has been allocated and it can run a small program that informs a dynamic DNS server of its new IP address. That's all that is needed. In practice dynamic DNS works well enough for many small server based applications such as web cameras etc.
So you don't need a fixed IP address. But this only solves the problem for the router - what about the all of the local computers connected to it that have non-public and hence non-routable IP addresses?
The solution is NAT.