Networking Technologies

Chapter 5: Creating Subnets

 

 

Objectives:

Chapter 5 teaches you about subnets and subnet masks. The objectives important to this chapter are on page 5-1:

  1. Explain the purpose of subnets.
  2. Define a subnet mask.
  3. Describe how subnet masks are used.
  4. Assign subnet addresses.
  5. Create subnet masks and assign subnet addresses for a sample company.

 

Concepts:

The graphic and paragraph on page 5-2 give a good introduction to the concept of subnets. Suppose your company has six divisions or locations, and logically needs six networks. Logically, you would want to be assigned six different network addresses (such as 132.132.0.0). Suppose, however, that you either cannot get or cannot afford licenses for six networks. Then you take the one network address that you do have and create six subnets. (Six, by the way, is not a magic number, it is just an example.)

Page 5-3 presents a list of reasons for creating subnets:

  • To extend the network - this reason applies if you have reached a media or node limit, and still have network address space to use
  • To reduce congestion - this reason is similar to the reason you use bridges and switches: to increase the number of collision domains. It works best if most traffic can be contained within single networks.
  • To reduce CPU use - because all hosts must listen to broadcast traffic, to determine if it is for them, a greater load is placed on each host in larger networks. Multiple smaller networks have fewer broadcasts.
  • To isolate network problems - if you have multiple networks, any problem affecting one will be less likely to affect the others.
  • To improve security - if you have sensitive transmissions, keeping them on one of several networks will limit the opportunity to eavesdrop
  • To use multiple media - as illustrated in the first graphic in this chapter, it is easier to have multiple media types if they are on different subnets. Routers will readily interconnect the subnets.

Subnetting works by borrowing bits from the host portion of an address, and using those bits to identify subsections of your network. The use of borrowed bits only works because of subnet masks. A subnet mask tells hosts on a network which bits in an address are network address bits and which bits are host address bits. It does it by the use of 1s and 0s. Consider the table below:

Subnet Masks for Classes A, B and C
Decimal Mask Binary Mask
Class A 255.0.0.0 11111111.00000000.00000000.00000000
Class B 255.255.0.0 11111111.11111111.00000000.00000000
Class C 255.255.255.0 11111111.11111111.11111111.00000000

Network devices read a mask to learn how to interpret addresses. Address positions marked by 1s in a mask are considered network address positions. Address positions marked by 0s in a mask are considered host address positions. Another way of saying this is that certain address bits are considered to be network address bits and the rest are considered host address bits. The actual method used involves Boolean math, but understanding it is not critical to understanding or using the concept. When a device reads an actual IP address, the rule from the subnet mask is applied, and the device understands which bits are for what address.

Page 5-6 presents a table of the subnet addresses possible when borrowing 1, 2, and 3 bits of the host address. Note the first example: by borrowing one bit, two subnets are theoretically possible. However, as a general rule, subnet numbers using all 1s and all 0s are not used, so borrowing one bit will probably not yield any usable subnet addresses. This is why the formula for number of subnets is the one given:
2N - 2 = number of subnets (where N is the number of bits borrowed)
You will want to keep in mind that NetWare does allow the use of all 1s and all 0s, so Novell will ask you to calculate the number of possible subnets all three ways: not using all 1s, not using all 0s, and using neither all 1s nor all 0s. Assume we borrow two bits in each of the three cases above:

Subnet Masks if Borrowing 2 Bits
Decimal Mask Binary Mask
Class A 255.192.0.0 11111111.11000000.00000000.00000000
Class B 255.255.192.0 11111111.11111111.11000000.00000000
Class C 255.255.255.192 11111111.11111111.11111111.11000000

Note that the subnet masks above do not match the standard masks from the previous table. The standard masks are classful masks, because they match the intended use of class address schemes. The masks above are classless, because they do not match any network class. Your book refers to a network hierarchy using classless subnets as a classless subnet hierarchy.

From page 5-8, be aware that routers on the Internet only use the network bits of an address for routing. Routers connecting subnets within a network must use the network, subnet, and host bits for routing. From the same page, remember that host addresses may be reused from one subnet to the next, but not within a subnet.

Since most of the address work you are likely to do with subnets will be with class C addresses, it is wise of Novell to discuss that next. Starting on page 5-11, you see a subnet scheme for a class C network. Obviously, you cannot use eight bits to define the subnet: you only have eight bits to define a host address to begin with, and you must use some of them for the host address. You must strike a balance between how many subnets you need and how many hosts you may put on each subnet. In this example, the administrator has decided to borrow 3 bits from the host byte for subnets, leaving 5 bits for host addresses. The chart on page 5-12 shows the default (classful) subnet masks for class A, B, and C networks, and what that mask would look like if you borrowed from 1 through 8 bits for subnet addressing. The chart on page 5-13 shows the number of subnets theoretically possible by borrowing 1 through 7 bits, the number of hosts theoretically possible for each of these subnets, and the masks used. To calculate these values, use the formula above:
2N - 2 = number of subnets (where N is the number of bits borrowed). Do not subtract the 2 if you are able to use all 1s and all 0s in the subnet address.

To calculate the number of hosts possible for each subnet, do the same calculation, except that for the value of N, you use the TOTAL number of host bits available in the address. For instance, if this were a class B address, and you were borrowing 3 bits from the third byte for subnet addresses, the remaining 5 bits in the third byte and the 8 bits in the fourth byte would give you 13 as the value of N. Some methods call the exponent M when calculating the possible hosts, but the math is the same.

Page 5-15 begins the topic of assigning subnet addresses. Each bullet on the page could use some discussion:

  • Each address must be unique. This is true for all IP addresses, not just subnet addresses.
  • The network and subnet numbers must be the same for all devices on the same network. A classic error is to assign two workstations to different subnets and expect them to communicate as if they were on the same logical LAN.
  • The host (physical) portion of the address must not be set to all 1s or all 0s. This is a seeming contradiction of the Novell calculations for possible subnets. NetWare allows all 1s and all 0s in the subnet address, but not in the host address.
  • Plan for growth. You will have to add more stations later to most LANs, and you may have to add more subnets than you need today. Guidelines appear on page 5-16. In general, you calculate the number of subnets required, then round up to the nearest power of two. Do the same with the number of hosts needed per subnet. You may find that the two goals are in conflict.
  • Don’t use IP addresses reserved for special use. These have been noted already in the text.

Planning for growth is addressed in greater detail on page 5-17. When assigning subnets and assigning hosts, you should watch the shared byte, the one whose bits are used for both purposes. In general, assign subnets starting with the left-most bits of the shared byte. Assign host addresses starting with the right-most bits of the shared byte. Do not use more bits than necessary. This will allow you to redefine the subnet mask later, should you have to assign more bits to the subnet, or more to the hosts due to network growth. If you do not follow this advice, you will probably have to reassign addresses when you change the subnet mask.

Page 5-19 begins an example of calculating and assigning subnet addresses. Note that this example switches to the standard calculation I have given you above, subtracting 2 from the calculated powers of 2. We learn on page 5-20 that N stands for the number of bits masked for subnets, and M stands for the number of bits not masked. (Wouldn't M and U have been better choices? Oh, well...)

Page 5-21 continues the example, becoming confusing in the process. The next step is to calculate the actual subnet addresses, that is, the addresses of the subnets themselves. The book refers to them as the first, second, etc. but the advice above tells us NOT to use them in this order. This step is for reference purposes. The method is this:

  • Find the right-most 1 in the binary version of the subnet mask. The mask you are shown is this:
    255.255.224.0 11111111.11111111.11100000.00000000


  • Determine the value of this digit, based on its position in its byte. This value can only be 128, 64, 32, 16, 8, 4, 2 or 1. Call the value delta. (For those who are curious, Δ (the Greek letter delta) is a common physics symbol for "the amount of change".) In this example, three bits are borrowed, so the value of delta is 32.
  • The value of delta is used as the value of the shared byte, creating the first subnet address. The network address in this example is 132.132.0.0, so the first subnet address would be 132.132.32.0. Subsequent subnet addresses are multiples of delta, used as the value of the shared byte. Obviously, no value greater than 255 can be used. In this example, the subnet addresses would look like this:
    132.132.32.0 10000100.10000100.00100000.00000000
    132.132.64.0 10000100.10000100.01000000.00000000
    132.132.96.0 10000100.10000100.01100000.00000000
    132.132.128.0 10000100.10000100.10000000.00000000
    132.132.160.0 10000100.10000100.10100000.00000000
    132.132.192.0 10000100.10000100.11000000.00000000

    These are not masks, nor are they host addresses. They are the addresses of the possible subnetworks.

  • Subnet addresses using all 0s or all 1s in the subnet address section are not used (in this example). Novell notes that they are possible if your routers support them. If you were to use those possibilities, there would be two more possible subnets.
  • The next step is to assign addresses to hosts. For all addresses used, the network bits must remain the same, or the hosts would not be on the same network. The first subnet we will actually use is 132.132.128.0, since this one uses only the left-most bit of the subnet bits. A few hosts on this subnet will use 128 as the value of their third byte, and the rest will not. Are you confused? Remember that you will have to use the other bits in the third byte to specify host addresses, and using those bits adds to the value of the third byte. So, the first host on this subnet could have the address 132.132.128.1. This works through 132.132.128.255, but then we have to use the host bits in the third byte. We can actually use addresses 132.132.128.1 through 132.132.159.254 for this subnet. We cannot use 132.132.128.0 because this would set all host bits to 0s. We cannot use 132.132.159.255, because this would set all host bits to 1s.
    132.132.128.0 10000100.10000100.10000000.00000000
    132.132.159.255 10000100.10000100.10011111.11111111

    In actual practice, you will probably be using class C addressing, but it is required for this course that you be able to calculate addresses based on any class of license.

The balance of the chapter is taken up by exercises practicing these skills. It is recommended that you practice a lot, remembering that you will have no means to convert from decimal to binary (or binary to decimal) in the certification test except what you know how to do by hand.