Network Safety Corporation presents...

IP Routing
A Simple Concept

The concept of IP Routing is a simple one, but one that seems to confuse some people. Lets take a quick look at it.

IP Addresses

An IP Address consists of a 32-bit number that was intended to be unique throughout the world. This number is usually expressed or written as four decimal numbers separated by dots. Each number may range from 0 through 255, since each represents an 8-bit value, so that all four together represent the whole 32-bit number. All of this helps to minimize the wear and tear on our minds caused by mental conversion between hex and decimal. Here are some examples:

         Dotted           Hex                 Binary (argh!)
     -------------    ------------    ----------------------------------
     172.17.33.116     0xAC112174      10101100000100010010000101110100
       192.168.2.7     0xC0A80207      11000000101010000000001000000111
       10.99.61.25     0x0A633D19      00001010011000110011110100011001
For most people, the "dotted-decimal" notation is the easiest to remember and visuallize. To use these addresses though, we need to understand...

What is a Network?

In the context of IP Routing, a Network is a virtual place where the IP Addresses of every workstation and host are exactly the same in the "network part,." differing only in the "host part." For example, if an organization has a single LAN with a single Class C Network, say, 192.168.2, then every device's IP Address will start with the same 24 bits or three octets: 192.168.2. The remaining octet provides space for 256 unique addresses, some of which are reserved. In addition, we need the concept of a "netmask." This array of bits contains "one" bits in each position of the "network part." In this example, where the network part is 24-bits long, the netmask consists of 24 one-bits and 8 zero-bits. This may be expressed in hex as 0xffffff00, but it is most often expressed in dotted-decimal as 255.255.255.0.

Clients, hosts and routers use the netmask to decide if two machines are in the same network. The steps are very simple:

  1. "AND" the source IP Address with the netmask, which keeps just the "network part.".
  2. "AND" the destination IP Address with the netmask, to get the "network part.".
  3. If the two results are identical, the two machines are in the same network.
Computers in "the same network" may communicate with each other directly. They need no help from anyone. To communicate with a machine in another network, you need...

Routers

Routers are speciallized computers that can exist in more than one network at a time. In addition, they may have knowledge of other routers. Usually, a small network has a single router. Because that router is the "only way out" of the network, this router is said to be the "gateway" to this network. It is permitted to have more than one router in a network, and your computers usually know what each is for. One may be to reach other parts of you business or to reach customer sites. One may be to the Internet. That one is special.

When you do the setup on your workstations and hosts, you have the option to specify a "default gateway." This is the router to use when you don't know a path to the desired destination. It is the job of this router to either know how to get to the destination, or to know a smarter router that may. This smarter router is your router's default gateway. This is how the entire Internet works, more or less.

It all boils down to these steps:

Each computer and each router follows these same rules.
For further reading on this subject, may we recommend "TCP/IP Illustrated, Volume 1" by W. Richard Stevens. This is published by Addison-Wesley and is ISBN 0-201-63346-9.
This page was last modified on 1 October, 1995.

This information is proprietary to Network Safety Corporation and may be copied and distributed freely as long as this statement is retained intact in each copy. Network Safety, WebElite, DialNAT and NetNAT are trademarks of Network Safety Corporation. For information on our products and services, please contact our sales department.

This page was prepared using WebElite, our professional editor for the Web.