IP Addressing
IP addresses are structured as four groups of 3 decimal numbers i.e. 111.222.333.444.Each three decimal group of numbers is called an octet because converting the decimal form to binary results in an 8-bit number.
| Class | # of Networks | # of hosts | Network IDs | Host IDs |
| A B C |
126 16 384 2 097 152 |
16 777 214 65 534 254 |
1.bbb.ccc.ddd --> 1.bbb.ccc.ddd 128.0.ccc.ddd --> 191.255.ccc.ddd 192.0.0.ddd --> 223.255.255.ddd |
aaa.0.0.1 --> aaa.255.255.254 aaa.bbb.0.1 --> aaa.bbb.255.254 aaa.bbb.ccc.1--> aaa.bbb.ccc.254 |
Note:
These addresses should only be used on private networks not connected to the Internet
- aaa bbb ccc ddd are any numbers between 0 and 255
- 127 in the 1st octet of Network ids reserved for diagnostics.
- 255 and 0 in 4th octet of Host ids reserved for Broadcast and Network addresses.
| Class | Network ID's |
| A B C |
10.0.0.0 --> 10.255.255.255 172.16.0.0 --> 172.31.0.0 192.168.0.0 --> 192.168.255.255 |
These addresses should only be used on private networks not connected to the Internet
Subnet Masks
Used to separate the network ID from the host ID for routing purposes. Once the network and host IDs are derived from the TCP/IP address, it is a simple matter to determine if the address is local or remote.
Before we begin we should define a bitwise AND operation and a method for converting binary to decimal.
Truth Table - Bitwise AND
So, to find the decimal value of the binary number 11000010, we multiply each bit by its place value.
The decimal number is derived by adding the sums:
128 + 64 + 0 + 0 + 0 + 0 + 2 + 0 = 194
So we see that the decimal value 194 is equal to the binary number 11000010
Two Hosts, same subnet?
With default subnet masks, it's a simple mater of looking at the TCP/IP address to determine if two hosts are on the same network. If the network has been divided into subnets the conclusion is not so evident.Before we begin we should define a bitwise AND operation and a method for converting binary to decimal.
Truth Table - Bitwise AND
| Bit 1 | Bit 2 | Bit 1 AND Bit2 |
| 0 0 1 1 |
0 1 0 1 |
0 0 0 1 |
Converting binary to decimal
This table represents an 8-bit octet with the place value for each bit| 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | Low order bit |
| 128 |
64 |
32 |
16 |
8 |
4 |
2 |
1 |
Place value |
So, to find the decimal value of the binary number 11000010, we multiply each bit by its place value.
| 1 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | Binary Number |
| 1x128 | 1x64 | 0x32 | 0x16 | 0x8 | 0x4 | 1x2 | 0x1 | Binary No. X Place value |
| 128 | 64 | 0 | 0 | 0 | 0 | 2 | 0 | Sum |
The decimal number is derived by adding the sums:
128 + 64 + 0 + 0 + 0 + 0 + 2 + 0 = 194
So we see that the decimal value 194 is equal to the binary number 11000010
Determining the subnet
Step 1. Convert the decimal numbers of the first address to binary:| Address | 194.168.110.19 | --> | 11000010 . 10101000 . 01101110 . 00010011 |
| Mask | 255.255.255.230 | --> | 11111111 . 11111111 . 11111111 . 11100110 |
| ----------------------------------------------------------------------------------------------- | |||
| AND | 194.168.110.2 | <-- | 11000010 . 10101000 . 01101110 . 00000010 |
We conclude that the first host 192.168.110.19 resides on subnet 194.168.110.2
Step 2. Converting the second host's address:
Step 2. Converting the second host's address:
| Address | 194.168.110.56 | --> | 11000010 . 10101000 . 01101110 . 00111000 |
| Mask | 255.255.255.230 | --> | 11111111 . 11111111 . 11111111 . 11100110 |
| ----------------------------------------------------------------------------------------------- | |||
| AND | 194.168.110.32 | <-- | 11000010 . 10101000 . 01101110 . 00000010 |
We conclude that the second host 192.110.110.56 resides on subnet 194.168.110.32
The two hosts clearly do not reside on the same subnet.
The two hosts clearly do not reside on the same subnet.