Chapter 5

Configure and Verify IPv4 Addressing and Subnetting

This chapter ensures that you are ready for questions related to these topics in the Network Fundamentals section of the CCNA 200-301 exam blueprint from Cisco Systems. Remember that this is just a portion of the Network Fundamentals section. The other chapters in Part I, “Network Fundamentals,” also provide information pertinent to the Network Fundamentals section. Other important topics include IPv6, wireless networking, and virtualization.

This chapter covers the following essential terms and components:

  • IPv4 addressing

  • IPv4 address classes

  • Subnet masks

  • IPv4 Subnetting

  • IPv4 address configuration

  • Broadcasts

  • Unicasts

  • Multicasts

  • Private IPv4 addressing

  • Network Address Translation (NAT)

  • Client IP Parameters

Topic: Configure, verify, and troubleshoot IPv4 addressing and subnetting

CramSaver

If you can correctly answer these CramSaver questions, save time by skimming the ExamAlerts in this section and then completing the CramQuiz at the end of this section and the Review Questions at the end of the chapter. If you are in doubt at all, read everything in this chapter!

1. What is 187 converted to binary?

_________

2. What is 10010011 converted to decimal?

_________

3. What class of address is 239.1.2.3?

_________

4. You are using 5 mask bits in an octet. What is the decimal value of the subnet mask in this octet?

_________

5. How many hosts can the 10.0.0.0 255.255.255.128 network support?

_________

6. How many subnets can you create if you borrow 6 bits?

_________

7. What is the broadcast address for the subnet 10.15.2.0 255.255.254.0?

_________

8. What is the usable host range for 10.15.0.224/27?

_________

Answers

1. 10111011

2. 147

3. Class D

4. 248

5. 126

6. 64

7. 10.15.3.255

8. 10.15.0.225–10.15.0.254

An IPv4 address is a 32-bit number that we like to represent in dotted-decimal notation. Consider using a conversion chart for the 8 bits that exist in an octet to help with the various subnetting exercises you might encounter on the CCNA 200-301exam. Figure 5.1 is a simple chart you can jot down on scratch paper before starting the exam.

image

Figure 5.1 A Conversion Chart for IPv4 Addressing and Subnetting Questions

One task that is simple using this chart is converting a number from decimal to binary or vice versa. For example, to convert 186 to binary, you first note that you can successfully subtract 128 from this number, so you can set the first bit to on (1). The remainder after this subtraction is 58, and you cannot subtract 64 from this number (without having a negative number), so you set the 64 value to off (0) and move to the next number. You then subtract 32 from 58, place a 1 in the 32 column, and end up with 26 as the remainder. You can subtract 16 from 26, so you put a 1 in that column. Continuing with this method, you can easily calculate that 186 in binary is 10111010.

Converting from binary to decimal is even easier: Just examine what bit positions are on (1) and add those decimal values together. So, for example, 11101111 equals 239.

Early on in the development of TCP/IP, the designers created address classes to attempt to accommodate networks of various sizes. They did this by setting the initial bit values. Table 5.1 shows these classes.

Table 5.1 The IP Version 4 Address Classes

Address Class

High-Order Bit Setting

First Octet Range in Decimal

A

0

1–127

B

10

128–191

C

110

192–223

D

1110

224–239

ExamAlert

It is an important skill to be able to recognize the class of address using the decimal value in the first octet. Note that addresses beginning with 127 are reserved for local loopback purposes. Also keep in mind that Class D addresses are for multicasting. Multicast can be used to send a message to multiple devices across multiple networks and subnetworks.

Another critical memorization point here is the default subnet masks for the address classes. Remember that it is the job of a subnet mask to define what part of a 32-bit address represents the network portion and what part represents the host portion. Table 5.2 defines the classful masks that have been defined.

Table 5.2 Classful IPv4 Subnet Masks

Address Class

Classful Mask

Prefix Notation Mask Bits

A

255.0.0.0

/8

B

255.255.0.0

/16

C

255.255.255.0

/24

Note that subnet masks must use continuous on bits (1), starting from the left (MSB). The subnet mask octet 11100000 is valid, whereas 00111111 or 11100011 are not. This results in the only possible values in a subnet mask octet being the ones shown in Table 5.3.

Table 5.3 The Possible Values in an IPv4 Subnet Mask Octet

On Bits

Binary

Value

8

11111111

255

7

11111110

254

6

11111100

252

5

11111000

248

4

11110000

240

3

11100000

224

2

11000000

192

1

10000000

128

0

00000000

0

ExamAlert

Some students write out this table on scratch paper, along with other information provided in this chapter, before beginning the CCNA 200-301 exam. If you can quickly calculate these facts on an as-needed basis during the exam, you can skip this step.

Remember that subnetting is a process of “stealing” or “borrowing” bits from the host portion of a classful IPv4 address in order to create additional subnets. Think of using the following IP address and subnet mask combination in your network:

  1. 10.0.0.0/8 or 10.0.0.0 255.0.0.0

This allows you to create only one giant network. Sure, this network can have many host systems (specifically, 224 – 2), but they all must exist in the same network. With broadcast traffic and other potential issues, this would be terrible for efficient communications. Today, we like to divide networks into small sections (subnetworks) of about 100 computers or fewer.

ExamAlert

Notice that to calculate the number of hosts a subnet can support, you take the number of bits remaining for host addressing (h) and make this the exponent for the number 2 and then subtract 2 from this amount. Thus, the formula is 2h — 2. You subtract 2 in this formula because you cannot assign a host an IP address with all zeros in the host bits or all ones in the host bits. These addresses are reserved; the all-zeros address identifies the network itself, and the all-ones address is the broadcast address for the subnet.

Note

Super fun fact thanks to my incredible technical editor, Angelos Vassiliou: The all-zeros host address is specifically reserved because older (pre-BSD 4.3) IPv4 implementations actually sent directed broadcasts to the all-zeros address. (See https://tools.ietf.org/html/rfc1027#section-2.6.)

In the preceding example, say that you decide to borrow 4 bits for subnetting. Now the identifications look like this:

  1. 10.0.0.0 255.240.0.0 or 10.0.0.0/12

How many bits are left for host identification? The subnet mask now contains 12 bits, leaving 20 bits available for host identification. This calculation, 220 – 2, requires a calculator. As a result, you would not see this question on the CCNA 200-301 exam. (The answer, by the way, is an astounding 1,048,574 hosts per subnet.)

ExamAlert

How many subnets can you create? The answer is the formula 2s, where s is the number of subnet bits you are borrowing. In this case, you have 24. If you examine the scratch paper chart from Figure 5.1, you quickly see that the answer is 16 subnets. Note that as you borrow more and more host bits, you can create more and more subnets, but each subnet supports fewer and fewer hosts.

Another important skill you need is to be able to establish the exact subnets to create, given a bit-borrowing scenario. The great news is that you can once again rely on Figure 5.1 for assistance!

Using the preceding scenario, you have:

  1. 10.0.0.0 255.240.0.0 or 10.0.0.0/12

To determine the subnets, you determine the block size by determining the least significant bit (rightmost) decimal value that the subnet mask extends to. So in this example, you extend 4 bits into the second octet. In this case, you can use Figure 5.1 to determine that the decimal value (block size) here is 16. Therefore, you start at 0, and then each new subnet increments by 16—so you have subnets numbered 0, 16, 32, 48, 64, 80, and so on. Plugging these values into the IP address given, you have the following subnets:

  1. 10.0.0.0/12

  2. 10.16.0.0/12

  3. 10.32.0.0/12

  4. 10.48.0.0/12

  5. 10.64.0.0/12

  6. 10.80.0.0/12

  7. and so on.

What if you begin with 10.46.0.0/16 and want to borrow 4 additional bits to create new subnets? No problem. Now this is what you have:

  1. 10.46.0.0/20

  2. 10.46.16.0/20

  3. 10.46.32.0/20

  4. 10.46.48.0/20

  5. 10.46.64.0/20

  6. 10.46.80.0/20

  7. and so on.

What if you begin with 192.168.1.0/24 and need to create six subnets? Borrowing 3 bits does the job, with some to spare (23 = 8), and you have these subnets:

  1. 192.168.1.0/27

  2. 192.168.1.32/27

  3. 192.168.1.64/27

  4. 192.168.1.96/27

  5. 192.168.1.128/27

  6. 192.168.1.160/27

There are two more subnets, of course, but you do not care in this case because you need only six.

Note

You can further subnet unused subnets! This is known as variable-length subnet masking.

What about usable addresses for hosts on a subnet? Look at 192.168.1.0/27 above. That is a reserved address—the subnet ID itself. Add 1 to this address, and you have the first usable host address on this subnet: 192.168.1.1/27. The last address before you get to the next subnet is 192.168.1.31/27. This is reserved for the subnet broadcast. Remember from the earlier discussion that these two reserved addresses are why we subtract 2 in the formula for calculating the number of hosts. Because the last usable address is always the next subnet ID minus 2, the last usable address on the subnet is 192.168.1.30/27.

Here is one more example. If you have 10.10.0.0/16 and want at least 15 new subnets, you can create the scheme 10.10.0.0/20. Here are the usable host address ranges for the first four subnets:

  1. Subnet 10.10.0.0/20: 10.10.0.1 (first usable)–10.10.15.254 (last usable)

  2. Subnet 10.10.16.0/20: 10.10.16.1 (first usable)–10.10.31.254 (last usable)

  3. Subnet 10.10.32.0/20: 10.10.32.1 (first usable)–10.10.47.254 (last usable)

  4. Subnet 10.10.48.0/20: 10.10.48.1 (first usable)–10.10.63.254 (last usable)

ExamAlert

Be ready to implement all the skills just outlined when you take the CCNA 200-301 exam. Obviously, there are a variety of ways in which questions can be asked, and this chapter provides plenty of examples through CramSavers, CramQuizzes, and Review Questions. Although initially these questions might seem like a lot of work, you will eventually crave questions like these in the exam because math questions don’t have the challenging gray areas that some multiple-choice questions have.

CramQuiz

1. What is 203 converted to binary?

Image A. 11001011

Image B. 11101011

Image C. 10101100

Image D. 11001000

2. What is 01101111 in decimal?

Image A. 112

Image B. 111

Image C. 120

Image D. 110

3. What is the default subnet mask for a class B network?

Image A. 255.255.255.0

Image B. 255.0.0.0

Image C. 255.255.0.0

Image D. 255.255.255.255

4. If a subnet mask has a length of 19 bits, what is the subnet mask in dotted-decimal notation?

Image A. 255.255.192.0

Image B. 255.255.224.0

Image C. 255.255.240.0

Image D. 255.255.252.0

5. If you have the mask 255.255.255.240, how many hosts can you support?

Image A. 32

Image B. 62

Image C. 14

Image D. 6

6. Your network needs to support 30 subnets. How many bits should you “borrow” from the host portion of the address in order to create the least waste in terms of address space?

Image A. 4

Image B. 5

Image C. 6

Image D. 7

7. What is the last usable host address on a subnet where a host has been given the address 172.16.7.1 255.255.254.0?

Image A. 172.16.7.255

Image B. 172.16.6.1

Image C. 172.16.7.128

Image D. 172.16.7.254

CramQuiz Answers

1. A is correct. Using the chart in Figure 5.1, you arrive at these decimal values: 128 + 64 + 8 + 2 + 1 = 203.

2. B is correct. The bits you add here are 64 + 32 + 8 + 4 + 2 + 1 = 111.

3. C is correct. 255.255.0.0, or 16 bits, is the default mask for a Class B address.

4. B is correct. The /19 indicates 3 bits of subnetting in the third octet, which means a value of 128 + 64 + 32 = 224.

5. C is correct. With this mask, there are only 4 bits left for host addressing. Using the chart in Figure 5.1, you can determine that 2 raised to the 4th power is 16. You subtract 2 from this number to arrive at 14 hosts.

6. B is correct. Borrowing 5 bits permits the creation of 32 subnets. You have the 30 you need, plus 2 additional subnets. Borrowing 4 bits only allows for the creation of 16 subnets (which is not enough), but borrowing 6 bits would allow for 64 subnets (with 34 unused subnets, which would be too much waste).

7. D is correct. The usable host range here is 172.16.6.1 through 172.16.7.254.

Topic: Compare and contrast IPv4 address types

CramSaver

1. When you send information from one system to another system in a network without intending for the data to reach any other system, what type of traffic is this?

_________

2. What type of traffic uses the destination IP address range with 224–239 in the first octet?

_________

3. What destination MAC address do you find in an ARP frame when it is sent from a workstation that needs Layer 3–to–Layer 2 address resolution?

_________

Answers

1. Unicast

2. Multicast

3. The broadcast address (ffff.ffff.ffff)

Modern networking systems use three main forms of IPv4 addressing for communicate in the network:

  • Unicast

  • Broadcast

  • Multicast

Unicast transmission is most likely what you think of first. Say that you are in a home network with IP address 192.168.1.2, and you want to send data to print to a printer located at 192.168.1.10. You do not intend for any other system to receive this traffic. This is a classic example of unicast IPv4 traffic.

When you have a system that must send a frame to all members of the network, this is termed a broadcast. At Layer 2, the destination broadcast address is FF:FF:FF:FF:FF:FF.

Note

Do not be confused by the various presentations of MAC addresses in different operating systems. For example, Windows uses FF-FF-FF-FF-FF-FF, Linux uses ff:ff:ff:ff:ff:ff, and macOS uses ffff.ffff.ffff. These are all just different methods of representing the same important address.

At Layer 3, an example of a broadcast IPv4 address is 255.255.255.255. Remember that there is another type of broadcast, however, that is sent when a packet is destined for all of the members of a subnet—known as a directed broadcast, or targeted broadcast. For example, the broadcast address for subnet 10.10.0.0/20 is 10.10.15.255. (Earlier in this chapter, you calculated the broadcast addresses for subnets.)

Note

Because a directed broadcast to a remote subnet can introduce many potential security issues, most routers give you the opportunity to enable or disable directed broadcast capabilities. You can, therefore, ensure that a router will not take a directed broadcast from a remote subnet and forward into another (destination) subnet. Of course, routers can do nothing about directed broadcasts locally generated into the existing local subnet.

What if you want a device to “tune into” traffic in much the same way you tune into a television station in order to enjoy a broadcast of some show? The network equivalent of this is multicasting. Remember that the multicast address range is 224–239 in the first octet. Computers can “subscribe to” or “join” a multicast group by participating in (listening to) this address scheme (in addition to their unicast address). Multicast is a way of sending packets to multiple hosts across multiple networks and subnetworks. Some routing protocols use multicast addressing. When you enable RIPv2 on a router, it starts listening for traffic destined for its 224.0.0.9 address as this is the address used to send traffic to all RIPv2 routers.

ExamAlert

Multicast saves bandwidth and server resources because a single traffic stream serves multiple recipients across multiple networks. Contrast this with a traffic stream that must be replicated for every single unicast receiver that needs the traffic.

CramQuiz

1. What type of IP traffic is used when communicating directly between two nodes (for example, in exchanging email)?

Image A. Broadcast

Image B. Multicast

Image C. Unicast

Image D. Anycast

2. EIGRP uses the IPv4 address 224.0.0.10 in its operation. What type of address is this?

Image A. Unicast

Image B. Broadcast

Image C. Multicast

Image D. Anycast

3. What does it mean when you see FF:FF:FF:FF:FF:FF as the destination address in an Ethernet frame?

Image A. It means the frame is a multicast frame.

Image B. It means the frame is a unicast frame.

Image C. It means the frame should be dropped.

Image D. It means the frame is a broadcast frame.

CramQuiz Answers

1. C is correct. Although an ARP broadcast may initially be needed, because these systems have already communicated, the traffic can be sent unicast.

2. C is correct. 224.0.0.10 is the EIGRP routers reserved multicast address. (See https://www.iana.org/assignments/multicast-addresses/multicast-addresses.xhtml.)

3. D is correct. The destination address FF:FF:FF:FF:FF:FF is a reserved MAC address that indicates a broadcast.

Topic: Describe the need for private IPv4 addressing

CramSaver

1. List the Class A private address space.

_________

2. List the Class B private address space.

_________

3. List the Class C private address space.

_________

Answers

1. 10.0.0.0 to 10.255.255.255

2. 172.16.0.0 to 172.31.255.255

3. 192.168.0.0 to 192.168.255.255

The designers of IPv4 created the private address space to help alleviate the problem of IPv4 addresses being depleted. The private address space is not routed on the public Internet but can be used as needed inside private networks. Thanks to private address space, many different companies can be using exactly the same IP address space without causing things to break badly. This address space can then be translated using Network Address Translation (NAT) to allow access to and through the public Internet.

While it is your responsibility to set up your network correctly and not send the RFC 1918 prefixes to the Internet (via your ISP), understand that ISPs are not in the business of trusting the skills of network architects. ISPs put filters on interfaces that connect to private networks. These filters drop the RFC 1918 advertisements and traffic if they inadvertently appear. It is also interesting to note that these filters filter other addresses as well. These include special use and other addresses that would not make sense to source from a private network. Packets that should not appear on the Internet are called Martian packets or bogons.

ExamAlert

Whenever you use private address space on an Internet-facing device, you must use Network Address Translation (NAT) in order to enable proper communication with the public Internet.

Because of private addresses and NAT, you tend to see the same address ranges (typically 192.168.1.X) used in many homes today. Table 5.4 identifies the ranges in the private address space.

Table 5.4 The IPv4 Private Address Ranges

Address Class

Range of Private Addresses

A

10.0.0.0 to 10.255.255.255

B

172.16.0.0 to 172.31.255.255

C

192.168.0.0 to 192.168.255.255

ExamAlert

Both for success as a network architect and for the CCNA 200-301 exam, you must memorize the private address ranges. Although it is normally not important to memorize Request for Comments (RFC) numbers, the RFC that defined these ranges. RFC 1918, is so famous that you should know it. While I refer to the contents of RFC 1918 as private address ranges, the IETF often refers to these address ranges as “blocks,” so do not be confused by that if you see it in the literature on the subject.

CramQuiz

1. What technology permits many private addresses to communicate on the Internet?

Image A. SMTP

Image B. POP3

Image C. SNMP

Image D. NAT

2. Which of the following is not a private address?

Image A. 10.10.10.1

Image B. 12.34.100.1

Image C. 172.16.1.10

Image D. 192.168.1.10

3. What famous RFC defines what IP address space is for private use only?

Image A. RFC 2020

Image B. RFC 2191

Image C. RFC 2001

Image D. RFC 1918

CramQuiz Answers

1. D is correct. Network Address Translation permits private addresses to communicate with and across the Internet.

2. B is correct. 12.X.X.X is part of the public IP address space.

3. D is correct. RFC 1918 defines the private address space.

Topic: Verify IP parameters for client OS (Windows, Mac OS, Linux)

CramSaver

1. What command can you use at the command prompt on a Windows system in order to see the basic IP configuration on an interface?

_________

2. What command can you use in the terminal on a Linux system in order to view the IP configuration of all interfaces?

_________

Answers

1. ipconfig

2. ifconfig

Regardless of what client OS you use, there is an easy way to verify the IP parameters on network interfaces (unless the OS is administratively locked down to not allow such actions). In fact, in Chapter 6, “Configure IPv6,” you will discover that it is also as easy to do this for IPv6 information assigned to interfaces.

Example 5.1 shows the use of ipconfig on a Windows 10 system. As you can see, the output of this command provides you with basic configuration parameters. In Chapter 6, you will learn how to obtain even more information by using the /all switch after this command.

Example 5.1 Using ipconfig on a Windows 10 System

C:Users	erry>ipconfig
Windows IP Configuration
...
Wireless LAN adapter Wi-Fi:
   Connection-specific DNS Suffix  . :
   IPv6 Address. . . . . . . . . . . : 2603:9000:e70b:5300:340d:2223:70a:4585
   Temporary IPv6 Address. . . . . . : 2603:9000:e70b:5300:44b7:970b:a94b:be24
   Temporary IPv6 Address. . . . . . : 2603:9000:e70b:5300:758e:acd4:c9f0:d24d
   Link-local IPv6 Address . . . . . : fe80::340d:2223:70a:4585%5
   IPv4 Address. . . . . . . . . . . : 192.168.0.8
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   Default Gateway . . . . . . . . . : fe80::92c7:92ff:fecc:dda7%5
                                       192.168.0.1

Keep in mind that you can also obtain this information in the GUI. In Windows 10, you find this information in the GUI by going to Settings, clicking the Network & Internet option, and clicking View your network properties. Figure 5.2 shows an example of this approach.

image

Figure 5.2 Using the Windows 10 GUI to Obtain IP Address Information

ExamAlert

For the CCNA 200-301 exam, you need to know that you check your IPv4 address settings in macOS or Linux by using ifconfig. This command is roughly equivalent to ipconfig in Windows. Interestingly, Linux systems are moving away from ifconfig in favor of more user-friendly tools.

CramQuiz

1. You are in the command prompt on a Windows system. What command displays your IP address and default gateway for the local network interface?

Image A. ifconfig

Image B. ipconfig

Image C. netconfig

Image D. testconfig

2. You are in the terminal on a macOS system. How can you quickly see your IP address and default gateway information?

Image A. netstat

Image B. intconfig

Image C. ipconfig

Image D. ifconfig

CramQuiz Answers

1. B is correct. The ipconfig command displays this information in Windows.

2. D is correct. Use the ifconfig command in Linux or on a macOS system.

Review Questions

1. What is 2 raised to the 7th power?

Image A. 64

Image B. 128

Image C. 32

Image D. 16

2. Which of the following is true of the IP address 127.0.0.1?

Image A. This is a multicast address.

Image B. This is a Class A unicast address.

Image C. This is a loopback address.

Image D. This is an invalid IP address.

3. What is the subnet mask if you begin with the default Class A mask and then “borrow” 4 bits for subnetting?

Image A. 255.255.128.0

Image B. 255.255.240.0

Image C. 255.240.0.0

Image D. 255.255.255.240

4. If you need to create six subnets and want to waste as little IP address space as possible, how many bits should you “borrow”?

Image A. 2

Image B. 3

Image C. 4

Image D. 5

5. Examine the following diagram. What is the most likely reason Host A is unable to ping Host B?

image

Image A. The subnet masks are incorrect for the link between R1 and R2.

Image B. Host A has an invalid IP address.

Image C. Host B is attempting to use the subnet ID as an IP address.

Image D. The R2 interface to R1 is attempting to use a subnet broadcast IP address.

6. What is the Layer 3 broadcast address?

Image A. 127.255.255.255

Image B. 0.0.0.0

Image C. 1.1.1.1

Image D. 255.255.255.255

7. What is the range of Class B private addresses?

Image A. 172.16.0.0 to 172.16.255.255

Image B. 172.0.0.0 to 172.255.255.255

Image C. 172.16.0.0 to 172.31.255.255

Image D. 172.32.0.0 to 172.36.255.255

8. What parameters is your engineer most likely verifying when she enters ifconfig on your Linux system?

Image A. Duration of the current interface state

Image B. OS version information

Image C. Registry settings

Image D. IP address settings

Answers to Review Questions

1. B is correct. As shown on the quick reference sheet from Figure 5.1, 27 = 128.

2. C is correct. 127.0.0.1 is a loopback address.

3. C is correct. The default Class A subnet mask is 255.0.0.0. Borrowing 4 bits from the next octet creates the new mask 255.240.0.0.

4. B is correct. Borrowing 3 bits makes it possible to create eight subnets. Borrowing fewer bits does not allow for as many subnets, and borrowing more than 3 bits wastes addressing space because there will be more unused subnets than when borrowing 3 bits.

5. C is correct. The Host B IP address is the subnet identifier for that subnet and is reserved.

6. D is correct. The IPv4 broadcast address is simply 255.255.255.255.

7. C is correct. The RFC 1918 /20 range is 172.16.0.0 to 172.31.255.255 for Class B networks.

8. D is correct. The ifconfig command on Linux displays IP address information.

Hands-On Lab Practice Assignment

Configure and Verify IPv4 Addressing

To complete this Hands-On Lab Practice Assignment, download the assigned Packet Tracer file from the book’s companion website and perform the lab on your locally installed version of Packet Tracer. For instructions on how to download and use the Packet Tracer files, see “Packet Tracer Hands-On Lab Practice Assignments” in the Introduction of this book.

Additional Resources

Subnetting—“I Feel the Need, the Need for Speed”

https://www.ajsnetworking.com/subnetting3

Subnetting Quiz

http://bit.ly/subnetquiz

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.16.81.94