Copyright Goodheart-Willcox Co., Inc. Chapter 8 Overview of Network Security and Network Threats 253 binary representation of 11111111.11111111.11111111.00000000 will be converted to decimal in each octet. The Windows calculator or a programmer’s calculator can be used to convert these numbers. The table shown in Figure 8-3 can also be used as a reference. So, a sub- net mask of 11111111.11111111.11111111.00000000 will be written as 255.255.255.0 when using a decimal format. Classless Internet Domain Resolution (CIDR) is a way to represent IP addresses in compressed form. With CIDR, the subnet mask is written as a total number of the on, or 1, bits in the subnet mask. This is an easier way to visualize the subnet mask. Using the same example, a total of 24 bits are turned on. In decimal, the subnet mask is 255.255.255.0, but in CIDR format it is written as /24. The number 24 identifi es the fi rst 24 binary bits of this address as the network portion. The remaining eight bits of the address are the unique address on the host. For the IPv4 address shown in Figure 8-1, the network address is 172.16.4. The unique host address is 201. The subnet mask for this example is either 255.255.255.0 in decimal or /24 in CIDR format. To cal- culate the network address portion, follow these steps. 1. Convert the decimal numbers to binary. This includes the IP address and the subnet mask. Figure 8-2 shows the IP address in binary. 2. Use a mathematical function called ANDing to compare the original address to the host. The result of this comparison is the network address. ANDing is a process of comparing two binary digits and creating a value based on the comparison. Consider the example shown in Figure 8-4. When ANDing, the network portion of the subnet mask binary address is represented In some cases, the result of ANDing looks like the original address in binary form with just the local address represented as zero. However, in many cases with subnets, the network portion cannot be determined without ANDing. FYI Goodheart-Willcox Publisher Figure 8-3. This table can be used to convert between binary and decimal. Binary Octet for Subnet Mask Decimal Equivalent of Octet 10000000 128 11000000 192 11100000 224 11110000 240 11111000 248 11111100 252 11111110 254 11111111 255 10101100.00010000.00000100.11001001 10101100.00010000.00000100.00000000 172 . 16 . 4 . 0 11111111.11111111.11111111.00000000 IPv4 Address in Decimal IPv4 Address in Binary ANDing Values Network Address Both values are 1, so the result is 1 Both values are 0, so the result is 0 One value is 1 and the other is 0, so the result is 0 Rules for ANDing 1 AND 1 = 1 1 AND 0 = 0 0 AND 0 = 0 In other words, everything equals 0 except 1 AND 1. Goodheart-Willcox Publisher Figure 8-4. Using ANDing to find the network portion of the address in the subnet mask. When represented in decimal, the final result is 172.16.4.0, which is the network address.