An Introduction to IP Addresses: Part 3
by Kurt Keller
IP addresses (part 3) - getting from here to there
This is the third and last part of my insights into IP addresses. In the first part I was talking about what IP addresses are, about DNS and the A-, B-, C-class address space. In part two followed an explanation of subnets. Today we want to dive a little bit into the world of routing.
How does information travel over the internet? Not much different from how you travel. Going from London-Walthamstow to Yokohama-Hongodai you'll most probably take the Tube, Victoria line to Kings Cross, change to Piccadilly line and go as far as Heathrow, change there to take a flight to Tokyo-Narita, change again to take Sobu line to Ofuna and there change one more time to Keihin-Tohoku line and then get out at Hongodai. Information, or packets, travelling over the internet, or any TCP/IP net for that matter, from one computer to another make their journey in much the same way. A packet going from your PC at the home office to a webserver somewhere in another country may go from your computer through the attached modem over the telephone wire to your providers dialup modem and into their gateway. In the gateway it changes to a different network, going on to your provider's upstream provider, changing networks again and travelling to a telco in the destination country. There it once more changes the network, goes on to a big provider, changing to a different network for the last time and finally arrives at the webserver of a smaller provider.
How does the packet know its way through the jungle of networks? Ask yourself how you find your way. After all the jungle of bus, subway, train, and airplane routes is not less complicated than a computer network, including the internet. If you live in Walthamstow, there are only a couple of more or less local bus routes; by bus you stay in the area. If you want to go out of your area there is only one way: take the only Tube, Victoria line. You do not even have to think which way, Walthamstow is the northern end of Victoria line, so there is only one direction. Once at King's Cross, you won't find a sign saying Hongodai, but asking the station master he'll tell you that international flights are available from Heathrow, so you should take Piccadilly line to Heathrow. Arriving there, you'll still not find a sign for Hongodai, but a flight for Japan, going to Narita. After the long flight still no sign for Hongodai, but you'll be told that for anything in Yokohama, you should take the Sobu line and possibly that Ofuna is right next to Hongodai and has direct connections to there. So you travel to Ofuna and there, finally, you find a sign saying Hongodai.
Let's translate this to our network: Your computer at your home office is connected to a small LAN. It does know all the peers directly and knows how to get there. These connections resemble the buses leaving Walthamstow for Ilford or Seven Sisters etc. Anything not known needs to go by Tube, using Victoria line, or, computerized, by modem to your provider. This is called the "default route." Anything unknown is sent this way, as the next "hop" at the end of that line has different connections from you and will know more. Your provider will hardly have a direct route to the webserver in the other country, but it will know, that its own upstream provider has a connection to that country and thus send the packet on to its upstream provider. This upstream provider again, has no direct connection with the webserver, but it can send the packet to the telco in the target country. The telco still has no direct connection with the webserver, but it knows that one of their downstream providers does have a direct route with the target net, so the packet is sent down the pipe. And this provider finally knows how to deliver to the target network where the webserver is located. Do you still think routing is difficult?
A host which is connected to more than one network and does route packets between these networks, is called a gateway. Every gateway has at least one IP address per network it is connected to and at least one network interface per connected network, be it physically or only logically, be it ethernet, ATM, modem, serial cable or whatsoever. And every gateway does have information about which networks or single hosts are reachable on which connected network. For packets to IP addresses the host or gateway does not have direct information on how to reach them, there is the default route. Everything not known where to send to, is sent along the default route to a gateway with more or more precise information.
Where do routers get the information about what networks are reachable through which other gateways? This is being done by routing protocols, the most popular being RIP (Routing Information Protocol). Periodically a routing protocol, running on a gateway, will send information to all its peer gateways, telling them what networks it can reach. The peer gateways hear this, compare it to their own routing table and update their routing table if necessary. This is called dynamic routing, because changes can be made dynamically, through routing protocols. Another way are static routes. With static routes, the network administrator defines statically, what IP ranges are reachable over which interface or via which gateway. Usually gateways are configured with a few static routes, supplemented by dynamic routing information.
The principle of routing is the same everywhere, travel, snail mail, parcel delivery, computer networks; if you don't know how to deliver something, check whether one of you partners knows and pass the job on. If no direct partner knows, then pass it up to the next bigger office in the organization until somebody knows.
Before, IP addresses were assigned to "end users" directly by one central authority. It did not matter too much how they were connected to the internet, what provider they used. Such a system does, however, make it necessary that routers, or gateways, need to have a very huge routing table, a database of which IP address range to reach through which other gateway. Such address ranges look like this:
send anything for 192.168.4.0-192.168.4.255 to 172.17.10.5
send anything for 192.168.5.0-192.168.5.255 to 10.241.3.30
send anything for 192.168.6.0-192.168.6.255 to 172.17.10.5
Now, even (or especially) in routers and gateways, memory to store such tables is limited. It would be much more efficient, if bigger blocks could be assigned, for example
send anything for 192.0.0.0-126.96.36.199 to 172.17.10.5
send anything for 188.8.131.52-184.108.40.206 to 10.241.3.30
In the first example, individual C-class addresses are assigned to individual organizations, which then choose a provider. In the second example, whole junks from the available address space are assigned to internet service providers, which then subassign part of their address pool to their customers. So not individual IP-classes need to be entered in the routing table, but much bigger junks of the address space, saving lots of memory and time.
This kind of routing, not bound to IP-classes any more, is called "Classless Inter-Domain Routing" (CIDR). It does have the additional advantage, that an internet service provider is also free to subassign to their customers parts of their address space as big as the customer needs. So, for example, with the help of variable length subnet masks, a provider could easily assign 384 IP addresses (1.5 C-classes) to a customer needing somewhat more than one C-class, while giving 32 addresses to another customer which does not require more. This distinction of network sizes only needs to be made at the provider in question and the customers site, other providers or gateways do not need to know about it. CIDR thus does not only help to keep routing tables down to a manageable size, but it also helps in preserving valuable address space, as not every organization needs to be assigned a full C-class of IP numbers.
So if you need official IP numbers, contact your ISP (Internet Service Provider). However, if you only need some IP address space internally and will never need these connections to be routed to outside of your organization, then you can also, without asking anybody, use part or even all of the address space, which has explicitly been reserved for such use. Anybody can use the following IP address ranges, as long as they are never routed to or from outside:
1 A-class: 10.0.0.0 - 10.255.255.255
16 B-classes: 172.16.0.0 - 172.31.255.255
256 C-classes: 192.168.0.0 - 192.168.255.255
Well then, that's it so far about IP addresses. If you need more information, some help or would like to see more on this topic here, let me know. Also suggestions for other topics are welcome. And to some extent I'm also available for consulting and configuration of internet, mail and network services.
© Algorithmica Japonica Copyright Notice: Copyright of material rests with the individual author. Articles may be reprinted by other user groups if the author and original publication are credited. Any other reproduction or use of material herein is prohibited without prior written permission from TPC. The mention of names of products without indication of Trademark or Registered Trademark status in no way implies that these products are not so protected by law.
The Newsletter of the Tokyo PC Users Group
Submissions : Editor
Tokyo PC Users Group, Post Office Box 103, Shibuya-Ku, Tokyo 150-8691, JAPAN