PrefaceRemembering back to when I took my first networking class, subnet masks were the hardest concept for me to grasp. I threw together a quick tutorial that I hope is easy to understand and can help you through this concept. The first thing you need to understand before even looking at subnet-masking is how to read and manipulate binary. Here is a quick youtube tutorial Binary Conversion Tutorial Once, You have a grasp on converting Decimal into Binary, we can move forward.
Anatomy of a Subnet MaskA subnet mask goes hand in hand with an IP address. It is responsible for telling the computer which portion of an IP address is the network address, and which portion (bits) are reserved for the hosts. It has the same "dotted-decimal" notation, a very common example of an IP address and subnet mask in this format would be: (IP)192.168.1.0 (mask)255.255.255.0 The basic structure of this format is a 4-byte address (32-bits), which means there are 32 binary digits (1's and 0's) that make up the address. Translating the mask (255.255.255.0) into binary would look like this: 11111111.11111111.11111111.00000000 Note: The mask's leftmost bits must be 1's and the rightmost bits must be 0's( Another way of writing the subnet mask is in CIDR notation, which is basically counting the number of active bits (1's) from the left. So a mask of 255.255.255.0 in CIDR notation would be /24. Applying this to the IP address (192.168.1.0), we see that the mask (255.255.255.0) has the first 3 octet's (8 bit sets) are all set to 1's, meaning that the first 3 bytes of the IP address are the network address, and the last byte of the IP address is reserved for host addresses. Thus we can conclude that: Network address: 192.168.1.0 Host Address Range: 192.168.1.1 - 192.168.1.255 Note: Host the first and last addresses are reserved for gateway and loopback addresses i.e.(192.168.1.1 and 192.168.1.255) Here is a handy chart that allows you to quickly translate an octet into its binary equivalent:
SubnettingSubnetting is the act of breaking down the host portion of an IP address to separate the distribution of host addresses into separate zones or subnets, within the network. When looking at the right-most octet of a subnet mask we can tell how many subnets are present, and how many hosts per subnet.
Content Is not completed yet, 3/19/13