Modular Software - Home PicLan-IP - Home

An IP Primer

PicLan-IP allows Pick users and developers to directly drive internet and intranet applications from within Pick. This eliminates most of the complications incurred with using host operating systems TCP/IP server and client software. This does not mean that you need to know nothing about IP (Internet Protocol).

The IP part of TCP/IP is the low-level switched packet protocol standard that allows the internet to exist. At it's essence, IP is a standard for how a group of bytes is formatted so that it can be delivered across a network to a destination. It is this network addressing that you must deal with when you setup a TCP/IP network.

IP Addresses

An IP address is a four byte number in the range of 0 through 4294967295. This number could also be expresses in hexadecimal as 00000000 to FFFFFFFF. Unfortunately, the commonly used expression method is to express the number as a series of four decimal numbers (each representing one byte of the address) seperated by periods. This makes that address range 0.0.0.0 to 255.255.255.255.

A computer system on a TCP/IP network has one or more IP addresses associated with it. For workstations, there are TCP/IP solutions that will assign these automatically using protocols like DHCP (dynamic host configuration protocol) and BOOTP. These auto configuration protocols require a configuration server to "rent" IP addresses to workstations. Server systems usually need to have IP addresses assigned to them manually. When you install PicLan-IP (and most other TCP/IP products), you will need to assign one or more IP addresses to the server computer system.

Where do IP Addresses come from?

The first question is "where do IP addresses come from?" If you are building a purely local network that is not connected to the public internet, you can make up your own addresses using any scheme that you wish (so long as the scheme is compatible with the interconnecting components of your network). If you are building a small, single segment, TCP/IP network for in-house use, you can assign network addresses of: The important thing about assigning your own addresses is that each address must be unique (no two systems can have the same address assigned to them) and that all of the addresses on a single network segment must fall within a single "sub-net" range (more on sub-nets later).

If you are connecting your network to the public internet, you cannot make up your own addresses but must instead use addresses that are assigned to you by the internet's governing body. You get these addresses assigned to you from the company that you get internet connectivity from (your ISP or Internet Service Provider).

Network Segments and Sub-nets

TCP/IP addresses are just numbers that are used to identify systems connected to a network. Things get interesting when you start connecting one network to another. Suppose that you have four computer systems connected to an ethernet network and five more computer systems connected to another ethernet network. Ideally, you would like to connect the two ethernet network to each others. This interconnection is accomplished with a magic box called a router.

The problem with routers is that they must decide which network packets need to move between the networks. IP uses a set of conventions to make this job easier for routers called sub-nets. A sub-net is a grouping of IP addresses that are all located on a single part of a connected network. The first example with IP addresses from 1.1.1.1 to 1.1.1.254 demonstrates one of the most common classes of sub-nets called a "class-C" sub-net. The term class-C is somewhat old-fashioned and dates back to earlier, less conjested days for the internet. There used to be three type of sub-nets:

The example thus shows a network number of 1.1.1.0 with address of 1 to 254. Note that the address 1.1.1.0 and 1.1.1.255 are not considered valid addresses. The first and last address of a sub-net is used to support sub-net network broadcast functions (a broadcast packet is a packet that is recieved by all computer systems, not just the specific system it is addressed to) within the sub-net.

The internet itself has become very crowded and is literally running out of addresses. For this reason, it has been years since a class-A network has been assigned, and several early class-A assignments have been taken back from users. One fix for this is to use network sizes that are between the various classes. For example, a class-C network is also sometimes called a /24 network because the network part of the address uses 24 bits. You can get a /26 network which has enough room for 64 IP address (62 of which are usable). The smallest possible network is a /30 with 4 IP addresses (2 of which are usable).

The Sub-net Mask

The way that you tell your IP drivers what sub-net you are on is by supplying a number called a sub-net mask when you configure the driver. The sub-net mask has the same ##.##.##.## format as the IP address. It is easiest to get the idea of sub-net masks by example: The sub-net mask works like this. If you take the IP address and AND each bit in the address with the sub-net mask then you get the sub-net address. With the first example and sub-net mask of 255.255.255.0 (a class-C network) the network address is 1.1.1.0.

Sub-net masks for class-A, class-B, and class-C networks are quite simple. The sub-net mask for a /26 network would be 255.255.255.192 (the 192 is 128+64 or the two highest bits in the low byte). Figuring out network numbers with non-traditional sub-net masks generally requires that you convert the numbers to binary first as decimal bit-wise AND operations are not generally obvious to carbon-based lifeforms (although the silicon type seem to have not problem with this).

Router Addresses

When you set up a network with an IP router, the router itself has an IP address. Actually the router has two IP addresses, one for each network that the router attaches to. The router's IP address must be a legal IP address within each network sub-net addressing.

Routing Tables

The next complicated part of IP addressing is the concept of a "routing table". A routing table is a table that tells a router where to send a packet so that it will reach it's destination. The use of routing tables is not limited to routers however. General purpose computer systems (workstations and servers) also have router tables that tell the TCP/IP network driver software where to send packets based on their destination addresses

For a simple single-segment network, the router table is basically empty. All packets are sent directly to their destination address. When a network has routers, the table gets larger with an entry that describes a set of destination addresses and the local IP address that the packet should be sent so that it can reach the destination. A routing table is typically expressed as a list. If an IP packet is to be transmitted, the table is searched starting at the top until an entry matches the destination IP address of where the packet is to be sent. If your example network was connected with a router to another network, a routing table might look like:

    Address     Mask             Gateway Address

    1.1.1.0     255.255.255.0    0.0.0.0
    0.0.0.0     0.0.0.0          1.1.1.53
What this table tells the IP network driver is that any destination on the current 1.1.1.0 network should be sent directly to the destination and everything else should be sent to the router at 1.1.1.53. The use of the concept "send everything else to an address" is called a "default gateway". Most TCP/IP networks only have a single "way out" so the default gateway takes care of addressing.

If you have a TCP/IP network with only a single interconnection to the outside world (whether the public internet or just more of your company's local network), then you use the default gateway to specify the IP address of the router that will send the packets on to the rest of the network.

So what if the environment is more complicated. For example, a router also needs a routing table to decide where packets will be sent. If this router is a CISCO 7500 at Mea-West (the Internet's busiest west-coast interconnection hub), the routing table literally describes all of the fragmented sub-nets for the western half of the U.S. Suffice it to say that the routing table has tens of thousands of entries and a human did not type them in. Also suffice it to say that this is beyond the scope of this primer and is hopefully someone else's job.

Name Servers and Other Complications

So far we have talked strictly about IP addresses. In fact, if you are setting up a web server, an IP address is all that you need. From Netscape Navigator you can type:
http://1.1.1.1/work.htm
and this will connect you with the web server at address 1.1.1.1. If you are building a purely local or test network, using IP addresses directly is quite workable. If you are connecting to the public internet, you will probably want a public internet style name such as:
http://cnn.com
The "cnn.com" is a host name for a computer system (well in this case seven different computer systems that have duplicated content and load-balance). Internet names are based on a hierarchial naming system. The highest part of the name is "com" which stands for "US commercial". Common top-level domains are: If you wish to get your very own domain name (like cnn.com), you can get one assigned to you from the "internic" for a fee of $50/year. This is what "modsoft.com" and "piclan.com" are (two names, $100/year). In order to actually use a domain name on the internet, you must setup a computer system called a Domain Name Server or DNS. Actually the internet requires that you setup two, a primary and a backup. The DNS systems are computers that convert network names into IP addresses (amongst other things) so that users can type names instead of numbers.

When you have a DNS setup, you can create names for computer systems with IP addresses within the domain. This is how www.microsoft.com is setup. The name www.microsoft.com is the name for an IP address (actually 14 addresses) at Microsoft that runs their web servers. You can create as many names within your domain as you wish to point to computer systems on your network plus you can let the domain itself point to a computer system. You can also create domains within domains with addresses such as:

xyx.apweb.piclan.com
One of the more interesting things about domain names is that you can create names for computer systems that you do not own. If a system has an IP address, you can assign it a domain name (within your domain) without even asking the system's owner. Again, a domain name is just a lookup proceedure that converts a name into an IP address.

So how do you setup DNS systems. For many sites the answer is that you don't. Setting up your own primary and secondary DNS systems requires two computers running Unix or NT and a bit of setup. Many sites will let their ISP (Internet Service Provider) run the DNS for them
Modular Software - Home PicLan-IP - Home

© Copyright 1996-1998  Modular Software Corporation.All rights Reserved.