IP Address Tutorial
Posted by Tres Mon, 31 Jul 2006 05:41:00 GMT
This is an IP address tutorial that I wrote a while back for one of my classes while I was in school. I wrote it during my technical writing days, so it’s pretty simplistic, but hopefully it’s helpful.
What is an IP address?
Every computer connected to a TCP/IP network must have a unique IP address associated with it. Since the Internet is one giant TCP/IP network, that means that every computer connected to the Internet has an address that no other computer connected to the Internet has.
IP addresses are basically 32-bit numbers that are represented as four decimal numbers separated by decimal points. Each decimal number represents a single byte of the address.
For Example:
192.211.16.23
15.98.233.2
10.20.30.40
192.168.0.1
Since each decimal set represents an 8-bit number, there are a maximum of 256 numbers that can be represented in each set. The range of numbers available is from 0 to 255 (not 1 to 256).
When written in binary, an internet address looks like this:
| 192 | . | 168 | . | 0 | . | 1 |
| 1 1 0 0 0 0 0 0 | 1 0 1 0 1 0 0 0 | 0 0 0 0 0 0 0 0 | 0 0 0 0 0 0 0 1 |
What Address Should I Use?
When setting up a local area network, you can’t just choose any number and assign it to the network; you must have a specific number assigned to you, or you must use one of the reserved private address ranges provided for all private networks.
Here are the approved private address ranges:
10.0.0.0 to 10.255.255.255
172.16.0.0 to 172.31.255.255
192.168.0.0 to 192.168.255.255
When setting up a network using unassigned addresses, your network should use one of the above address ranges.
Subnet Masks
A subnet allows network traffic between computers to be divided into groups called subnets. By dividing computers into logical groups, subnets can improve network performance and the security of the network.
Like IP addresses, subnet masks are made up of 32-bits. Also like IP addresses, subnet masks are most commonly denoted as four 8-bit decimal numbers separated by decimal points.
Once we study routing, we’ll look at how a subnet mask facilitates routing, but for now, we’ll look at how a subnet mask can be used to limit the size of a network.
Each 32-bit address can be divided into two parts, the network ID and the host ID.
The IP address 192.168.0.1 with a netmask 255.255.255.0 can be represented like this:
| 192 | . | 168 | . | 0 | . | 1 | |
| 1 1 0 0 0 0 0 0 | 1 0 1 0 1 0 0 0 | 0 0 0 0 0 0 0 0 | 0 0 0 0 0 0 0 1 | ||||
| 255 | . | 255 | . | 255 | . | 0 | |
| 1 1 1 1 1 1 1 1 | 1 1 1 1 1 1 1 1 | 1 1 1 1 1 1 1 1 | 0 0 0 0 0 0 0 0 | ||||
Network ID |
Host ID |
||||||
Example
I have a computer with the above configuration (IP address of 192.168.0.1 and a subnet mask 255.255.255.0). I plug it into a hub.
I have a second computer with an IP address of 192.168.0.2 and a subnet mask of 255.255.0.0. I plug it into the same hub.
Using the ping program, I try to test the network between the two computers. Neither can ping the other.
Why?
| 192 | . | 168 | . | 0 | . | 2 | |
| 1 1 0 0 0 0 0 0 | 1 0 1 0 1 0 0 0 | 0 0 0 0 0 0 0 0 | 0 0 0 0 0 0 1 0 | ||||
| 255 | . | 255 | . | 0 | . | 0 | |
| 1 1 1 1 1 1 1 1 | 1 1 1 1 1 1 1 1 | 0 0 0 0 0 0 0 0 | 0 0 0 0 0 0 0 0 | ||||
Network ID |
Host ID |
||||||
Notice that the network ID of the computer is the high order 16-bits of the IP address. The rest of the address is reserved for computers within the same subnet.
| 192 | . | 168 | . | 0 | . | 1 | |
| 1 1 0 0 0 0 0 0 | 1 0 1 0 1 0 0 0 | 0 0 0 0 0 0 0 0 | 0 0 0 0 0 0 0 1 | ||||
| 255 | . | 255 | . | 255 | . | 0 | |
| 1 1 1 1 1 1 1 1 | 1 1 1 1 1 1 1 1 | 1 1 1 1 1 1 1 1 | 0 0 0 0 0 0 0 0 | ||||
Network ID |
Host ID |
||||||
Here, the first 24 high-order bits are used to denote the network ID. The last 8-bits are used as the host ID.
Even if two computers on the same network are given two IP addresses that should work, if they have differing subnet masks, they will not be able to communicate with each other.
Address Classes
The class of the Network is determined by the high order bits
| Class | 1st Octet Range | High Order Bits | ||
| A | 1-126 | 000.000.000 | ||
| B | 128-191 | 100.000.000 | ||
| C | 192-223 | 110.000.000.000 |
| Class A | |||||
| Class B | |||||
| Class C |