You do not need to memorize the chart, however, if you add one more bit of math to the process we used to calculate the prefix and broadcast address in the preceding section. To understand this method, you need to understand why the skip chart works.

Figure 2-8 illustrates.

Figure 2-8 Binary Places in the IPv4 Address Notice the numbers below each bit; these are the binary places, which are just like the 1s, 10s, 100s, etc., in the decimal number system everyone learns in school. If any of these change to either a 0 or 1, the entire number changes value by the amount shown below:

These numbers are the powers of two from 2 0 to 2 . 7

Counting over the number of bits in the prefix lengthโ26โwe come to the second bit in the fourth octet, which is a 1. If this bit changes to a 0, the value of the number changes by 64, so 64 is the skip value. Networks with a 26-bit prefix length can exist only on boundaries of 64โ0, 64, 128, and 192โwith a 26-bit prefix length. Because the 26th bit is in the fourth octet, the networks will count by 64s in the fourth octet.

If you can find the correct octet from the prefix length and then figure out what the skip is, you can calculate the prefix and broadcast address without the chart. Using 198.51.100.70/26 as an example again:

1. Divide 8 into the prefix length; ignore the remainder and add 1. In this case, 26/8 is 3; we add 1 and find we are working in the fourth octet of the IPv4 address.

2. Multiply the working octet by the number obtained in the first step; subtract from the prefix length. In this case, 8*4 is 24, and subtracting 24 from 26 gives us 2.

3. Subtract this number from 8 and find the power of 2. In this case, subtracting 2 from 8 gives us 6, and 2 is 64, so the skip is 6

64.

4. Find the prefix. In this case, 64 will go into 70 once, and weโre working in the fourth octet, so the prefix is 198.51.100.64.

5. Subtract 1 from the skip and add it to the prefix to find the broadcast address. In this case, the skip is 64. Subtracting 1, we get 63, and adding to 64, we get 127, so the broadcast address is 198.51.100.127.

Again, this method takes some practice to remember all the steps, but it reduces the entire problem down to some simple division (without remainders), multiplication, addition, and subtraction. With some practice, you can use this technique to quickly find prefixes and broadcast addresses.

Internet Protocol Version 6

By the 1980s, the global Internet was growing quickly enough that it became obvious more IP address space would be needed. While several schemes to resolve this problem were proposed,

only two are widely deployed today: IPv6 and Network Address

Note

IPv6 is completely different than IPv4, but we are only concerned with the changes in addressing here. Other changes between IPv4 and IPv6 will be

The term IP is used when both IPv4 and IPv6 are intended throughout this book. IPv6 was initially accepted as a draft standard by the Internet Engineering Task Force (IETF) in December of 1998, and the first IPv6 addresses were allocated in July of 1999. IPv4 and IPv6 are likely to co-exist in most networks for a long time.

In designing IPv6, the IETF quadrupled the address space. Rather than 32 bits divided into four one octet sections, the IPv6 address is 128 bits divided into 16 sections. Each section, sometimes called a quartet, represents two octets of the address

using four hexadecimal digits. Figure 2-9 illustrates an IPv6 address.

Figure 2-9 An IPv6 Address

IPv6 addresses include a prefix length to differentiate between the prefix and subnet addressesโjust like IPv4โbut the maximum prefix length is now /128 rather than /32. Longer addresses are more difficult to work with, but IPv6 addressing is also simplified in some ways:

โข Individual hosts always receive a /64 address, and links between network devices normally receive a /128 address.

Prefix lengths between /64 and /128 are extremely uncommon.

โข The shortest prefix most networks will be allocated will be a

/48. Larger companies and service providers may have access to address space with a prefix length as short as a /29, but most of the addresses you will be working with on a daily basis will have prefix lengths longer than /48.

โข Any single long string of 0s can be replaced with a double colon, or :: (you can use the :: only once in an address).

โข All leading 0s are omitted.

These simplifications mean you will mostly be working with addresses with prefix lengths between a /48 and a /64, or about 16 possible lengths. Much like IPv4 addresses, the simplest way to work with IPv6 prefix lengthsโif you insist on working with IPv6 addresses by handโis using skips, as shown in Table 2-3.

Table 2-3 IPv6 Address Skips

For instance, for 2001:db8:3e8::/48 prefix:

โข You can create two /49 subnets, 2001:db8:3e8::/49 and

2001:db8:3e8:8000::/49.

โข You can create four /50 subnets, 2001:db8:3e8::/50, 2001:db8:3e8:4000::/50, 2001:db8:3e8:8000::/50, and

2001:db8:3e8:c000::/50.

โข 2001:db8:3e8:500::/54 is not a valid prefix; you count by fours in the second digit for /54s, and 5 is not a multiple of 4.

Just like in IPv4, the first and last address of the subnet are broadcast addresses.

Three further points:

โข After working with IPv6 addresses for a while, you will

probably recognize common prefix lengths and where their

prefixes begin and end.

โข Most network operators carefully plan their addressing so only a few prefix lengths are used; this simplifies becoming familiar with them and makes spotting mistakes easy.

โข While working with IPv6 addresses, you should use a subnet calculator and/or cheat sheet to prevent mistakes.