Classful Subnetting An Example

The best way to get familiar with subnetting is to practice. Consider the following example that subnets major net 192.168.1.0 by stealing three bits from the host field to make a three-bit subnet field as shown in Example 1-1.

Example 1-1 Subnetting a Class C. Major Net with a Three-Bit Subnet Mask

Major net: 192.168.1.0 Class: C

Length of original host field: 8 bits (from Figure 1-1) Number of host bits to steal for subnet field: 3 bits Number of host bits remaining after subnetting: 8-3=5 bits

Network field 192.168.1

Major net in binary: 1100 0000.1010 1000.0000 - 0001.0000 - 0000 Subnet mask in binary: 1111 -1111.1111 -1111.1111 -1111.1110-0000

Subnet Host field field

Subnet mask in dotted decimal notation: 255.255.255.224

The common way to write a major net together with its subnet mask is by using the shorthand notation of the major net followed by a slash (/) and the number of ones in the mask. The shorthand notation for 192.168.1.0 masked with 255.255.255.224 (see Example 1-1) is 192.168.1.0/27 (there are 27 contiguous ones in 255.255.255.224).

NOTE Both the dotted decimal and slash notations are acceptable, and both notations are used when working with Cisco routers. For example, configuring an address on a router interface requires the mask in dotted decimal notation, but the output of show ip route favors slash notation in most versions of IOS. Also, some people prefer one notation over the other, so a good idea is to be familiar with both.

As you can see from Example 1 -1, converting from dotted-decimal notation to binary when subnetting is often convenient. A separator, such as a hyphen, makes it easier to read eight bits in a row.

Example 1 1 uses three bits for the subnet field. This yields eight unique combinations that are used to identify the subnets: 000.001.010,011, 100. 101, 110, and 111. The eight subnets for Example 1-1 are listed in Table 1 -2. The three bits that make up the subnet field are printed in boldface to emphasize the distinction between the subnet bits and the host bits.

Table 1 -2 The Ei%ht Subnets for Example J-l

Subnet Field

Octet x In 192.168.1.x (bin)

Octet x in 192.168.1.x (dec)

Subnet Number

111

1110-0000

224

192.168.1.224/27

no

1100-0000

192

192.168.1.192/27

101

1010-0000

160

192.168.1.160/27

100

1000-0000

128

192.168.1.128/27

Oil

0110-0000

%

192.168.1.96/27

010

0100-0000

64

192.168.1.64/27

001

0010-0000

32

192.168.1.32/27

000

0000-0000

0

192.168.1.0/27

In traditional subnetting, you are not allowed to use the so-called top and bottom subnets. The top subnet has all ones in the subnet field and the bottom subnet contains all zeros. For the preceding example, 192.168.1.224/27 is the top subnet and 192.168.1.0/27 is the bottom subnet. This leaves the middle six subnets available for deployment, but the top and bottom subnets are wasted. The section "Using Subnet-Zero to Get Around the Rules" later in this chapter covers how you can use the bottom subnet.

0 0

Post a comment

  • Receive news updates via email from this site