Converting Binary IP Addresses to DecimalRouters, being computers, work in binary. For example, 32-bit IPv4 addresses are used throughout the Internet, so you need to understand how to work with IP addresses. Because people usually like to work in decimal, IP addresses are typically written in a format called dotted decimal notation. The 32 bits in the address are divided into four 8-bit chunksthese chunks are called octets. Each octet is converted into decimal and then separated by dots. When converting a binary octet to decimal, each binary digit is weighted based on its position, as described earlier. The weights for the eight bit positions in an octet are shown in Figure C-2. Figure C-2. Binary Digits Are Weighted Based on Their Position
For example, consider the following IP address, written in binary: 10101100000100001000001100001100 Follow these steps to write this binary address in dotted decimal notation:
Note You can confirm these results using the decimal-to-binary conversion chart in Table C-1. Thus, the IP address 10101100000100001000001100001100 in dotted decimal notation is 172.16.131.12. |