1.2 Network Math  
  1.2.10 IP addresses and network masks  
The 32-bit binary addresses used on the Internet are referred to as Internet Protocol (IP) addresses. The relationship between IP addresses and network masks will be addressed in this section.

When IP addresses are assigned to computers, some of the bits on the left side of the 32-bit IP number represent a network. The number of bits designated depends on the address class. The bits left over in the 32-bit IP address identify a particular computer on the network. A computer is referred to as the host. The IP address of a computer consists of a network and a host part that represents a particular computer on a particular network.

To inform a computer how the 32-bit IP address has been split, a second 32-bit number called a subnetwork mask is used. This mask is a guide that indicates how the IP address should be interpreted by identifying how many of the bits are used to identify the network of the computer. The subnetwork mask sequentially fills in the 1s from the left side of the mask. A subnet mask will always be all 1s until the network address is identified and then be all 0s from there to the right most bit of the mask. The bits in the subnet mask that are 0 identify the computer or host on that network. Some examples of subnet masks are:

11111111000000000000000000000000 written in dotted decimal as 255.0.0.0

or

11111111111111110000000000000000 written in dotted decimal as 255.255.0.0

In the first example, the first eight bits from the left represent the network portion of the address, and the last 24 bits represent the host portion of the address. In the second example the first 16 bits represent the network portion of the address, and the last 16 bits represent the host portion of the address.

Converting the IP address 10.34.23.134 to binary would result in:

00001010.00100010.00010111.10000110

Performing a Boolean AND of the IP address 10.34.23.134 and the subnet mask 255.0.0.0 produces the network address of  this host:

00001010.00100010.00010111.10000110
11111111.00000000.00000000.00000000
00001010.00000000.00000000.00000000

Converting the result to dotted decimal, 10.0.0.0 is the network portion of the IP address, when using the 255.0.0.0 mask.

Performing a Boolean AND of the IP address 10.34.23.134 and the subnet mask 255.255.0.0 produces the network address of this host:

00001010.00100010.00010111.10000110
11111111.11111111.00000000.00000000
00001010.00100010.00000000.00000000

Converting the result to dotted decimal, 10.34.0.0 is the network portion of the IP address, when using the 255.255.0.0 mask.

This is a brief illustration of the effect that a network mask has on an IP address. The importance of masking will become much clearer as more work with IP addresses is done. For right now it is only important that the concept of the mask is understood.

 

Web Links

IP Addressing Fundamentals

http://support.wrq.com/tutorials/ tutorial.html