TCP/IP Concepts   «Prev  Next»

Lesson 8Netmask Structure and Usage
ObjectiveWhat is the Structure and use of a netmask?

Netmask Structure and Usage

As mentioned above, the first few bits of an IP address classify the address as
  1. Class A,
  2. Class B, or
  3. Class C.

This information is sufficient to decide what portion of the address refers to the host and which to the network.
However, this division is a convention and is not programmed into the TCP/IP networking software.
The netmask is a number telling the TCP/IP software which portion of the address is host and which is network.
The netmask itself is a 32-bit number with a one bit set in each position of the network address and a zero bit set in each position of the host address. It is usually written in dotted decimal form, like an IP address.
If an address is Class A, B, or C, the netmask is completely standard. For example, a Class A address has eight bits of network address, so the first eight bits of the netmask are 1; it has 24 bits of host, so the next 24 bits are 0. Converted to dotted decimal, this yields The other cases are illustrated in the table below.

Class Netmask

More sophisticated netmasks are possible if subnetting is being used, but further discussion of the subject is beyond the scope of this course.