Which subnet mask would you use if you wanted to have 12 subnets with a Class C network ID?

A) 255.255.255.252
B) 255.255.255.248
C) 255.255.255.240
D) 255.255.255.254

ANSWER:
C
Explanation: C) The 255.255.255.240 or /28 mask provides for 4 subnet bits and 4 host bits, providing a total of 16 available subnets. The next lowest mask, 255.255.255.224 or /27, will provide 3 subnet bits and 5 host bits, providing only 8 available subnets.

If you wanted to have 12 subnets with a Class C network ID, which subnet mask would you use?

Right Answer is: 255.255.255.240

SOLUTION

  • If an IPv4 address contains a number in the range of 192 to 223 in the first octet, it is a Class C address.
  • Class C addresses were originally intended to support small networks.
  • The first three octets of a Class C address represent the network number.  The last octet may be used for hosts.
  • Class C networks use a default subnet mask of 255.255. 255.0 and have 192-223 as their first octet.
  • Since from the given example 255.255.255.240 we can use the Class C mask.

Since  240 in binary is 11110000, that is you have four subnet bits and four host bits. Using our math, we’d get the following:

24 − 2 = 14 subnets

24 − 2 = 14 hosts.

Configuring Sniffer Pro to Monitor Network Applications

Robert J. Shimonski, ... Yuri Gordienko, in Sniffer Pro Network Optimization and Troubleshooting Handbook, 2002

The Subnet Masks Tab

The Subnet Masks tab allows you to adjust or modify the subnet masks used by the Sniffer Pro Expert. In Chapter 1, you read about the basics of an IP address. Here, you will configure the IP address in the Expert options. As Figure 4.39 shows, you have the option to either add or delete subnet masks from the Sniffer Pro Expert. One note to mention is that failure to put the correct IP address class and subnet mask into the Expert options can result in false information reported by the Expert when capturing data. We recommend leaving the defaults.

Which subnet mask would you use if you wanted to have 12 subnets with a Class C network ID?

Figure 4.39. Viewing the Expert Subnet Masks Tab

Read full chapter

URL: https://www.sciencedirect.com/science/article/pii/B9781931836579500083

MCSA/MCSE 70-291: Reviewing TCP/IP Basics

Deborah Littlejohn Shinder, ... Laura Hunter, in MCSA/MCSE (Exam 70-291) Study Guide, 2003

Default Subnet Mask

A subnet mask is a four-octet number used to identify the network ID portion of a 32-bit IP address. A subnet mask is required on all class-based networks, even on networks that are not subnetted. A default subnet mask is based on the IP address classes we discussed earlier and is used on networks that are not subdivided. If your network is not subnetted, you must use the subnet mask associated with your IP address class. The default subnet masks are shown in dotted decimal format in Table 1.8.

Table 1.8. Default Subnet Masks

IP Address ClassDefault Subnet Mask
Class A 255.0.0.0
Class B 255.255.0.0
Class C 255.255.255.0

We’ve already discussed the fact that a Class A network uses the first octet as the network address. You can see from the default subnet mask shown in the preceding table that the first octet is set to all 1 s (dotted decimal 255). Recall that a network ID cannot be set to all 1 s. Thus, when you use logical ANDing with any Class A network and the default subnet mask, it will always yield the Class A network ID. For example, if the Class A network ID is 66.x.y.z, it would be represented as 01000010.x.y.z. The default subnet mask is represented as 11111111.x.y.z. The logical AND function, shown in Table 1.9, yields 01000010.x.y.z.

Table 1.9. ANDing Network ID and Default Subnet Mask

Class A Network ID = 66 01000010
Default Subnet Mask = 255 11111111
Bitwise AND result = 66 01000010

Read full chapter

URL: https://www.sciencedirect.com/science/article/pii/B978193183692050007X

Understanding Networks and Networked Video

Anthony C. Caputo, in Digital Video Surveillance and Security (Second Edition), 2014

Subnet Mask

A subnet mask determines which parts of the IP address are network and host identifiers. It is a 32-bit number that distinguishes each octet in the IP address. For example, as depicted in Table 4.9, 255.255.0.0 is a standard Class B subnet mask, since the first two bytes are all ones (network) and the last two bytes are all zeros (host).

Table 4.9. IP Address Class Identifiers

ClassIP AddressNetwork IDHost ID
A a.b.c.d a b.c.d
B a.b.c.d a.b c.d
C a.b.c.d a.b.c d

Keeping in mind the unique class identifiers within the first byte of the IP address (see Table 4.9), in a subnetted network the network portion can be extended to 255.255.255.0, which would subnet a Class B address space using its third byte. The first two octets of an IP address would identify the Class B network, the next octet would identify the subnet within that network, and the final byte would select an individual host. Subnet masks are on a bit-by-bit basis; thus a subnet mask like 255.255.240.0 (4 bits of subnet; 12 bits of host) can also be used.

Read full chapter

URL: https://www.sciencedirect.com/science/article/pii/B9780124200425000046

Introduction to Networking

Dale Liu, ... Luigi DiGrande, in Cisco CCNA/CCENT Exam 640-802, 640-822, 640-816 Preparation Kit, 2009

Subnet Mask

The subnet mask is used in IPv4 and IPv6 to show what part of the address is the network portion and what part of the address is the host portion. In IPv4 there are three default subnet masks corresponding to the three classes of IP addresses (as illustrated earlier). There are currently three ways of showing the subnet masks for IPv4 addresses; you can show them in dotted decimal, binary, or classless interdomain routing (CIDR). Dotted decimal is shown in Table 1.8, the binary notation for a Class A default mask would look like 11111111.00000000.00000000.00000000 and finally the CIDR notation uses a slash/then the number of bits that need to be turned on in the mask. So for a Class A it would be /8, for Class B it would be /16, and finally for a Class C it would be /24.

For IPv6 the default subnet mask is /64 (the first 64 bits are the network portion). You could subnet this to make a few smaller networks as with the default mask you have 18,446,744,073,709,551,616 possible addresses on one IPv6 network.

Read full chapter

URL: https://www.sciencedirect.com/science/article/pii/B9781597493062000051

Addressing and Routing Architecture

James D. McCabe, in Network Analysis, Architecture, and Design (3), 2007

6.3.2 Subnetting

The next step in adding hierarchy to addressing is to allow a classful network address to be segmented into smaller sections. Subnetting (RFC 950) accomplishes this. Subnetting is using part of the device (host) address space to create another level of hierarchy. Changing the address mask increases the number of bits allocated to the network, creating the subnet. The resultant mask now includes a subnet mask, and the network segments that are created are termed subnets.

What is essentially happening in subnetting is that, by changing the address mask to increase the number of bits allocated to the network and thereby decreasing the number of bits allocated to devices, subnetting takes address space away from devices and gives it to the network.

Subnetting can be done on Class A, B, or C networks, although it is rare to subnet a Class C network (since there are only 254 addresses for devices anyway). The result of subnetting is a set of equal-sized subnets, where the length of the subnet mask determines the number of subnets and the size of each subnet. An example of this for Class B networks is shown in Figure 6.7.

Which subnet mask would you use if you wanted to have 12 subnets with a Class C network ID?

Figure 6.7. Masks and Sizes for Subnetting a Class B Network

Subnetting adds hierarchy to a network. A network in which all devices are addressed with the same network address can have problems scaling to a large number of devices. The term “large” is relative: some networks have problems with a few dozen devices, while others can scale to hundreds of devices without problems. The problems are usually related to traffic loads and behavior at the link and physical layers. The behaviors of users, applications, and devices are reflected in the traffic flows on the network, and the characteristics of these flows (including their sources and sinks) impact the scalability of the network. How network devices are configured at the link layer affects how they communicate at that layer. Problems at the link layer, such as jabbering devices or broadcast/multicast storms, impact scalability of the network. Subnetting helps to reduce the problem by segmenting the network into subnets connected by routers. Routers terminate the link and physical layers, thus stopping problems in one subnet from impacting other subnets.

Subnet masks (and therefore subnets) are recognized only within that network. When routes to that network are advertised, the natural mask is used. This is desirable; since subnetting is used to provide hierarchy within that network, there is no need to reveal that hierarchy outside of the network.

Example 6.3

Creating Subnets.

Let’s subnet 129.99.0.0 into seven subnets. 129.99.0.0 is a Class B (how do we know this?) address with a natural mask of 255.255.0.0. To create subnets, we increase the mask into the third octet by enough bits to get seven subnets. From Figure 6.7, we see that three bits will give us seven subnets, using an extended mask (subnet mask) of 255.255.224.0, as shown below.

Which subnet mask would you use if you wanted to have 12 subnets with a Class C network ID?

Each subnet is shown below in binary and dotted-decimal forms.

Which subnet mask would you use if you wanted to have 12 subnets with a Class C network ID?

Read full chapter

URL: https://www.sciencedirect.com/science/article/pii/B9780123704801500074

Addressing and Subnetting Basics

In IP Addressing & Subnetting INC IPV6, 2000

Decimal Equivalent Mask Values

Tables 1.2, 1.3, and 1.4 show the possible subnet masks that can be used in class A, class B, and class C networks.

Table 1.2. Class A Subnet Table

SubnetsHostsMaskSubnet BitsHost Bits
2 4,194,302 255.192.0.0 2 22
6 2,097,150 255.224.0.0 3 21
14 1,048,574 255.240.0.0 4 20
30 524,286 255.248.0.0 5 19
62 262,142 255.252.0.0 6 18
126 131,070 255.254.0.0 7 17
254 65,534 255.255.0.0 8 16
510 32,766 255.255.128.0 9 15
1,022 16,382 255.255.192.0 10 14
2,046 8,190 255.255.224.0 11 13
4,094 4,094 255.255.240.0 12 12
8,190 2,046 255.255.248.0 13 11
16,382 1,022 255.255.252.0 14 10
32,766 510 255.255.254.0 15 9
65,534 254 255.255.255.0 16 8
131,070 126 255.255.255.128 17 7
262,142 62 255.255.255.192 18 6
524,286 30 255.255.255.224 19 5
1,048,574 14 255.255.255.240 20 4
2,097,150 6 255.255.255.248 21 3
4,194,302 2 255.255.255.252 22 2

Table 1.3. Class B Subnet Table

SubnetsHostsMaskSubnet BitsHost Bits
2 16,382 255.255.192.0 2 14
6 8,190 255.255.224.0 3 13
14 4,094 255.255.240.0 4 12
30 2,046 255.255.248.0 5 11
62 1,022 255.255.252.0 6 10
126 510 255.255.254.0 7 9
254 254 255.255.255.0 8 8
510 126 255.255.255.128 9 7
1022 62 255.255.255.192 10 6
2046 30 255.255.255.224 11 5
4094 14 255.255.255.240 12 4
8,190 6 255.255.255.248 13 3
16,382 2 255.255.255.252 14 2

Table 1.4. Class C Subnet Table

SubnetsHostsMaskSubnet BitsHost Bits
2 62 255.255.255.192 2 6
6 30 255.255.255.224 3 5
14 14 255.255.255.240 4 4
30 6 255.255.255.248 5 3
62 2 255.255.255.252 6 2

These subnet mask tables can make it easier for you to determine which subnet mask to use for any given situation. Look at the tables for just a minute and notice what happens. As you go down the table, the number of subnets increases and the number of hosts in each subnet then decreases. Why? Look at the right-hand side of each table. As the number of subnet bits increases, the number of host bits decreases. Since we have a fixed number of bits to work with in each class of network address, each bit can be used in only one way—specified by the mask. Each bit must be either a subnet bit or a host bit. An increase in the number of subnet bits causes a reduction in the number of host bits.

Notice too that the tables are different sizes for each class of address. Because of the 24-bit, 16-bit and 8-bit host fields for class A, B, and C networks, respectively, we have three different tables.

Read full chapter

URL: https://www.sciencedirect.com/science/article/pii/B9781928994015500048

TCP/IP and Routing

Naomi J. Alpern, Robert J. Shimonski, in Eleventh Hour Network+, 2010

Understanding Subnet Masking

Large networks are subdivided to create smaller subnetworks. This process of segmenting is called subnetting, and most networks are divided into segments called subnets. Supernetting is the process of combining smaller networks into one larger network.

A subnet mask is a 32-bit number that is to shield or mask certain bits.

The number of host IDs on a network is variable, but the network ID must be the same for all hosts on a segment.

The underlying concept of subnets and subnet masking involves a binary process called bitwise ANDing.

DID YOU KNOW?

Bitwise ANDing simply means that we are performing the logical AND function on each bit. The simple AND statements can be expressed as shown here. Rather than a mathematical plus function, this is a comparison between two (or more) values.

0 + 0 = 0

0 + 1 = 0

1 + 0 = 0

1 + 1 = 1

Notice that the logical AND function results in a 1 only when both inputs are 1; otherwise, the result is 0.

Default Subnet Mask

A subnet mask is a four-octet number used to identify the network ID portion of a 32-bit IP address. A default subnet mask is based on the IP address classes we discussed earlier and is used on networks that are not subdivided. A subnet mask is required on all class-based networks, even on networks that are not subnetted.

The default subnet masks are shown in dotted decimal format in Table 6.4.

Table 6.4. Default Subnet Masks

IP Address ClassDefault Subnet Mask
Class A 255.0.0.0
Class B 255.255.0.0
Class C 255.255.255.0

Custom Subnet Mask

Subnetting is accomplished by using bits from the host address space for the network address space.

The custom subnet mask, also called a variable length subnet mask, is used to identify the bits used for a network address versus the bits used for a host address.

Custom subnet masks are used when subnetting or supernetting.

To determine the appropriate custom subnet mask, typically referred to simply as subnet mask, for a network, you must follow these steps:

1.

Determine the number of host bits to be used for subnetting.

a.

Determine the maximum number of subnets required including consideration for future anticipated growth.

b.

Determine how many host bits are required to create the number of subnets.

c.

Add together the values of the left-most bits from the octets, yielding the highest network ID.

2.

Determine the new subnetted network IDs.

a.

List all the possible binary combinations of the bits taken from the host address space.

b.

Calculate the incremental value to each subnet and add to the network address.

3.

Determine the IP addresses for each new subnet.

a.

Start with counting out the default class network ID bits.

b.

Add the bits that were borrowed from the host ID to the default network ID.

4.

Determine the appropriate subnet mask.

a.

Use bitwise ANDing to compare the bits of the IP address and the subnet mask.

b.

The result of the comparison is the network ID.

Read full chapter

URL: https://www.sciencedirect.com/science/article/pii/B9781597494281000011

Variable-Length Subnet Masking

In IP Addressing & Subnetting INC IPV6, 2000

Introduction

Variable-length subnet masks (VLSM) allow network administrators to “right size” each subnet. With fixed-length subnet masks, however, each subnet in the network is the same size because each device has the same subnet mask, regardless of the need for addresses in each subnet. If we select a class mask of 255.255.254.0, each subnet is allocated 510 addresses. Most LANs have an upper limit of less than 150 devices due to traffic patterns and capacity of the physical LAN media.

In actual fact, each network, WAN or LAN, has a different number of devices. With VLSM, the address administrator can more closely match the addressing needs of each subnet and use the address space more efficiently.

Read full chapter

URL: https://www.sciencedirect.com/science/article/pii/B9781928994015500085

Windows Server 2008 R2 networking

Dustin Hannifin, ... Joey Alpern, in Microsoft Windows Server 2008 R2, 2010

IP subnetting

A subnet mask is another group of dotted decimal numbers, representing a binary number that distinguishes which part of the IP address represents the network. The subnet mask is used to allow computers to determine whether the addresses of other computers they wish to communicate with are on the local network or on a remote network. If the computer resides on a remote network, the communication request is sent to the default gateway. Figure 3.6 explains how subnet masks work.

Which subnet mask would you use if you wanted to have 12 subnets with a Class C network ID?

Figure 3.6. How the Subnet Mask Works.

The three main IP address classes have default subnet masks. The standard subnet masks for each class, including number of supported hosts on each network are listed in Table 3.2.

Table 3.2. Standard Subnet Masks

Subnet MaskNumber of Supported Hosts per Network
Class A 255.0.0.0 Over 16 million
Class B 255.255.0.0 Over 16 thousand
Class C 255.255.255.0 254

The default subnet mask is not practical in most network configurations. For example, let us say that you owned a Class B network of 159.247.0.0. Using the default mask, you could have over 16,000 computers on one nonroutable network segment. What if you had a remote office connected via a WAN link? Would you need to acquire another Class B network range for that office? First, this would be a major waste of your IP addresses and second, good luck on getting someone to give you that many. Luckily, you can create custom subnet masks to split up your IP addresses. By simply changing the subnet mask from 255.255.0.0 to 255.255.255.0, you have instantly given yourself 254 unique routable networks that can support 254 hosts each. Creating a custom subnet mask is as simple as adding some binary ones to replace zeros in the mask. But what if you need to support 400 computers in a remote network? What does the mask look like then? This is where it gets a little tricky. You will need to convert the dotted decimal to its binary equivalent and perform a simple calculation. Let us take a look at this process.

1.

Decide how many subnets or networks you need to support. This is pretty easy to calculate. Figure out how many networks you have that are separated by a router.

2.

Decide how many hosts you need on each network. You need to plan for the number of computers and other IP devices that you will want to support at each network location. Remember that you may need IP addresses for network switches, printers, and other IP-enabled devices on top of the number of computers that you need to support each network. You should plan for growth here as well. Give yourself at least 10% growth room for a given network.

3.

Calculate the subnet mask. You now have enough information to calculate the proper custom subnet mask. Perform the following to calculate your subnet mask.

a.

Convert the standard subnet mask to binary. If we are using an IP network of 160.240.0.0, then the mask would be 255.255.0.0. The binary conversion is 11111111.11111111.00000000.00000000. Notice that it takes eight binary numbers to make up the number between each decimal. This is why each number between the decimal is referred to as an octet.

b.

Add one to the number of networks (subnets) you need. Assume that you need five networks. Add one to it to get six.

c.

Convert the decimal number to binary. You can do this manually or the calculator in Windows works great for this. In our example, we convert the decimal number six to binary, which is 110.

d.

Calculate the bits required for the mask. This is equal to the bits required to create the binary number. Since 110 is three individual numbers, 3 bits are required.

e.

Add the bits to the standard subnet mask resulting in a new binary subnet mask of 11111111.11111111.11100000.00000000. Now convert this binary back to decimal resulting in 255.255.224.0. You now have the subnet mask to use on each network segment.

Now that you have learned how to create a custom subnet mask, you should be aware that you can use a special subnet calculator to perform these steps for you. However, it is important that you understand how subnetting works if you plan on supporting Windows networks.

Read full chapter

URL: https://www.sciencedirect.com/science/article/pii/B9781597495783000037

Private Addressing and Subnetting Large Networks

In IP Addressing & Subnetting INC IPV6, 2000

VLSM

Variable-Length Subnet Mask (VLSM) is a technique used to conserve IP addresses by tailoring the mask to each subnet. Subnets that need many addresses will use a mask that provides many addresses. Those that need fewer addresses will use a different mask. The idea is to assign “just the right amount” of addresses to each subnet.

Many organizations have point-to-point WAN links. Normally, these links comprise a subnet with only two addresses required. Our subnetting tables given in Chapter 2 tell us that 255.255.255.252 is the appropriate mask to use for those subnets. But that mask would never do for a typical LAN where there are dozens (if not hundreds) of hosts in a subnet. By using a routing protocol that supports VLSM, we can use a block of addresses much more efficiently. VLSM is explained in more detail in Chapter 5.

Read full chapter

URL: https://www.sciencedirect.com/science/article/pii/B9781928994015500061

How many subnets does Class C have?

Class C /31 borrows 7 bits for the network address from the host address. That gives us 128 subnets, which is 2 to the power of 7. /31 can accommodate two hosts each. The valid host addresses would be 200.15.

What is the subnet mask for Class C?

Class C networks use a default subnet mask of 255.255. 255.0 and have 192-223 as their first octet.

What is the subnet mask for 12?

Class A.

What IP class uses 255.255 0.0 subnet mask?

Default Subnet Mask.