

So, a single DDN shows four decimal numbers that together represent some 32-bit binary number.Ĭonversion from a DDN mask to the binary equivalent is relatively simple to describe, but can be laborious to perform.
#SUBNET MASK TABLE EXCEL HOW TO#
The rest of this section examines how to convert between the three formats.īy definition, a dotted-decimal number (DDN) used with IPv4 addressing contains four decimal numbers, separated by dots. You need to get comfortable working with masks in different formats. In addition, the term slash mask is sometimes used because the value includes a slash mark (/).

This newer prefix style mask was created around the same time as the classless interdomain routing (CIDR) specification back in the early 1990s, and the acronym CIDR grew to be used for anything related to CIDR, including prefix-style masks. Note that although the terms prefix or prefix mask can be used, the terms CIDR mask or slash mask can also be used. Using the same two examples as earlier in this section, the prefix format equivalent masks are as follows: Prefix format lists a slash (/) followed by the number of binary 1s in the binary mask. This format takes advantage of the rule that the subnet mask starts with some number of 1s, and then the rest of the digits are 0s. For example, the two previous binary masks would convert to the following DDN subnet masks, because binary 11111111 converts to decimal 255, and binary 00000000 converts to decimal 0:Īlthough the DDN format has been around since the beginning of IPv4 addressing, the third mask format was added later, in the early 1990s: the prefix format. One format, dotted-decimal notation (DDN), converts each set of 8 bits into the decimal equivalent. Two alternative subnet mask formats exist so that we humans do not have to work with 32-bit binary numbers. The following two binary values meet the requirements, in that they have all 1s on the left, followed by all 0s, with no interleaving of 1s and 0s: The first is illegal because the value interleaves 0s and 1s, and the second is illegal because it lists 0s on the left and 1s on the right:

The value must not interleave 1s and 0s.įor example, the following values would be illegal.In particular, the binary subnet mask must follow these rules: Subnet masks can be written as 32-bit binary numbers, but not just any binary number. In particular, it shows how to determine the three-part format of the IPv4 address and describes the facts about the subnetting design that are implied by the mask. The second section explains how to take an IP address and its subnet mask and analyze those values. The first focuses totally on the mask formats and the math used to convert between the three formats. Prefix (also called classless interdomain routing ).The math converts masks between the three different formats used to represent a mask: However, to analyze a subnet mask, you first need some basic math skills with masks. The subnet mask holds the key to understanding several important subnetting design points. The subnet part defines the number of subnets that could exist inside one classful IP network, assuming that one mask is used throughout the classful network. Then, the class (A, B, or C) further divides the structure of addresses in a subnet, breaking the prefix part into the network and subnet parts. First, the mask divides addresses into two parts: prefix and host, with the host part defining the size of the subnet. Depending on the network topology and the router configuration, packets destined for IP address 192.31.7.49 might be sent to the wrong destination host, sent from the wrong interface, or dropped altogether.The subnet mask used in one or many subnets in an IP internetwork says a lot about the intent of the subnet design. However, because it is using a different subnet mask, the router interprets the address as being Host 17 on the first subnet (subnet address 32). The host interprets the IP address 192.31.7.49 as being Host 1 on the third subnet (subnet address 48). Table 7-10 Host and Router Subnet Mask Mismatch Example Table 7-10 shows how a UNIX host and a router will interpret an IP address differently if they have different subnet masks specified for the same major network. If there are disagreements on the length of the subnet mask, packets are not routed correctly. In classful IP networks, every router and host in the same major network should share a common subnet mask.
