:: [etc] IP address Tutorial. ::
HOME


[Date Prev][Date Next][Date Index]

[etc] IP address Tutorial.


IP Addressing Calculator

An IP (Internet Protocol) address uniquely identifies a node or host connection to an IP network. System administrators or network designers assign IP addresses to nodes. IP addresses are configured by software; they are not hardware specific. An IP address is a 32 bit binary number usually represented as 4 fields each representing 8 bit numbers in the range 0 to 255 (sometimes called octets) separated by decimal points.

For example: 150.215.17.9

It is sometimes useful to view the values in their binary form.

150.215.17.9

10010110.11010111.00010001.00001001

An IP address consists of two parts, one identifying the network and one identifying the node. The Class of the address determines which part belongs to the network address which part belongs to the node address.

Address classes

There are 5 different address classes. The first byte of the first octet determines the class of the address.

  • Class A addresses start with 0.
  • Class B addresses start with 10.
  • Class C addresses start with 110.
  • Class D addresses start with 1110.
  • Class E addresses start with 1111.

Classes can also be distinguished in decimal notation. If the first octet is between:

  • 1 and 126 it is a Class A address.
  • 128 and 191 it is a Class B address
  • 192 and 223 it is a Class C address
  • 224 and 239 it is a Class D address
  • 240 and 255 it is a Class E address.

127 is reserved for loopback and is used for internal testing on the local machine.

Now we can see how the class of address determines which part belongs to the network (N) and which part belongs to the node (n).

  • Class A -- NNNNNNNN.nnnnnnnn.nnnnnnn.nnnnnnn
  • Class B -- NNNNNNNN.NNNNNNNN.nnnnnnnn.nnnnnnnn
  • Class C -- NNNNNNNN.NNNNNNNN.NNNNNNNN.nnnnnnnn

150.215.17.9 is a Class B address so its Network is defined by the first two octets and it's node is defined by the last 2 octets. Class D addresses are reserved for multicasting and Class E addresses are reserved for future use so they should not be used.

In order to specify a network with an IP address the node section is set to all 0's for example 150.215.0.0 specifies the network for the above address. When the node section is set to all ones it specifies a broadcast that is sent to all hosts on a network. 150.215.255.255 specifies a broadcast address.

 

IP Subnet Addressing

The are several reasons why you might want to subnet a network. You may want to incorporate different types of physical networks into your IP network. Implementing subnets helps to control network traffic. On an ethernet network every machine on the same physical network sees all the packets of data sent out on the network. In heavy traffic situations this can result in collisions making the network performance painfully slow. In both these situations routers or gateways are used to separate networks. The router breaks the network into multiple subnets.

Subnet masking

Applying a subnet mask to an address allows you to identify the network and node sections of an IP address. Doing a bitwise AND on the IP address and the subnet mask results in the network address. For example:

10010110.11010111.00010001.00001001      150.215.017.009
11111111.11111111.00000000.00000000      255.255.000.000
--------------------------------------------------------
10010110.11010111.00000000.00000000      150.215.000.000

This result may seem familiar to you because Class A, B and C addresses have a self encoded or default subnet mask built in.

  • Class A - 255.0.0.0
  • Class B - 255.255.0.0
  • Class C - 255.255.255.0

 

Or in binary form

  • Class A - 11111111.00000000.00000000.00000000
  • Class B - 11111111.11111111.00000000.00000000
  • Class C - 11111111.11111111.11111111.00000000

 

More restrictive subnet masks

Additional bits can be added on to the self encoded subnet mask for a given class to further subnet a network. When a bitwise and is performed between on the subnet mask and IP address the result from the addition bits defines the subnet address. However there are some restrictions on the subnet address. Network addresses of all 0's and all 1's are reserved for specifying this network (when a host does not know its network address) and all hosts (broadcast address) respectively. This also applies to subnets. Therefore:

A subnet address cannot be all 0's or all 1's.

This also implies that a 1 bit subnet mask is not allowed.

Here is an example:

10010110.11010111.00010001.00001001      150.215.017.009   IP Address
11111111.11111111.11110000.00000000      255.255.240.000   Subnet Mask
--------------------------------------------------------
10010110.11010111.00010000.00000000      150.215.016.000   Network address

 

In the previous example a 4 bit subnet mask was used. The subnet in this case was 1. There are 14 subnets available with this mask (remember subnets with all 0's and all 1's are not allowed). Each subnet has 4,094 nodes (because of broadcast and network restrictions). This gives a total of 57,316 nodes for the entire class B address. Notice that this is less than the 65,534 nodes an unsubnetted class B address would have. Subnetting always reduces the number of possible nodes for a given network. To calculate the number of subnets or nodes use the following where n = number of bits in either the subnet or node field.

                           n
              Max nodes = 2  -  2 

multiplying the number of subnets by the number of nodes available per subnet gives you the total number of nodes available for you class and subnet mask. Note that although subnet masks with non-contiguous mask bits are allowed they are not recommended.

Private IP address SPace.

  • 10.0.0.0        -   10.255.255.255  (10/8 prefix)
  • 172.16.0.0      -   172.31.255.255  (172.16/12 prefix)
  • 192.168.0.0     -   192.168.255.255 (192.168/16 prefix)
Regards
Shashank
http://mia.ece.uic.edu/~papers