10.5

Reserved Address Space

 

10.5.1

Purposes for network IDs and broadcast addresses

If your computer wanted to communicate with all of the devices on a network, it would be quite unmanageable to write out the IP address for each device. You might try two hyphenated addresses, indicating that you are referring to all devices within a range of numbers, but that, too, would be quite unmanageable. There is, however, a shorter method.

An IP address that ends with binary 0s in all host bits is reserved for the network address (sometimes called the wire address). Therefore, as a Class A network example, 113.0.0.0 is the IP address of the network containing the host 113.1.2.3. A router uses a network's IP address when it forwards data on the Internet. As a Class B network example, the IP address 176.10.0.0 is a network address.

The decimal numbers that fill the first two octets in a Class B network address are assigned and are network numbers. The last two octets contain 0s, because those 16 bits are for host numbers, and are used for devices that are attached to the network. The IP address in the example (176.10.0.0) is reserved for the network address. It will never be used as an address for any device that is attached to it.

If you wanted to send data to all of the devices on a network, you would need to use a broadcast address. A broadcast occurs when a source sends out data to all devices on a network. To ensure that all of the devices on the network pay attention to the broadcast, the sender must use a destination IP address that all of them can recognize and will pick up. Broadcast IP addresses end with binary 1s in the entire host part of the address (the host field).

For the network in the example (176.10.0.0) , where the last 16 bits make up the host field (or host part of the address), the broadcast that would be sent out to all devices on that network would include a destination address of 176.10.255.255 (since 255 is the decimal value of an octet containing 11111111).

 

10.5

Reserved Address Space

 

10.5.2

Network ID

It is important to understand the significance of the network portion of an IP address - the network ID. Hosts on a network can only communicate directly with devices that have the same network ID. They may share the same physical segment, but if they have different network numbers, they usually cannot communicate with each other - unless there is another device that can make a connection between the networks.

 

10.5

Reserved Address Space

 

10.5.3

Network ID analogy

ZIP Codes and network IDs are quite similar in how they work. A ZIP Code enables the postal system to direct your mail to your local post office, and to your neighborhood. From there, the street address directs the carrier to the proper destination. A network ID enables a router to put a packet onto the appropriate network segment. The host ID helps the router address the Layer 2 frame (encapsulating the packet) to the specific host on that network.

 

10.5

Reserved Address Space

 

10.5.4

Broadcast address analogy

A broadcast address is an address that has all 1s in the host field. When you send a broadcast packet on a network, all devices on the network notice it. For example, on a network with an ID of 176.10.0.0, a broadcast that would reach all hosts would have the address 176.10.255.255.

A broadcast address is quite similar to a bulk postal mailing. The ZIP Code directs the mail to the appropriate area, and the broadcast address of "Current Resident" further directs the mail to every address. An IP broadcast address uses the same concept. The network number designates the segment, and the rest of the address tells every IP host in that network that this is a broadcast message, and that the device needs to pay attention to the message. All devices on a network recognize their own host IP address as well as the broadcast address for their network.

 

10.5

Reserved Address Space

 

10.5.5

Hosts for classes of IP addresses

Each class of network allows a fixed number of hosts. In a Class A network, the first octet is assigned, leaving the last three octets (24 bits) to be assigned to hosts. The maximum number of hosts, in a Class A network, is 224 (minus 2: the network and broadcast reserved addresses), or 16,777,214 hosts.

In a Class B network, the first two octets are assigned, leaving the final two octets (16 bits) to be assigned to hosts. The maximum number of hosts, in a Class B network, is 216 (minus 2), or 65,534 hosts.

In a Class C network, the first three octets are assigned. This leaves the final octet (8 bits) to assign to hosts, so the maximum number of hosts is 28 (minus 2), or 254 hosts. 

Remember that the first address in each network is reserved for the actual network address (or network number), and the final address in each network is reserved for broadcasts.

 

10.6

Basics of Subnetting

 

10.6.1

Classical IP Addressing

Network administrators sometimes need to divide networks, especially large ones, into smaller networks. These smaller divisions are called subnetworks and provide addressing flexibility. Most of the time subnetworks are simply referred to as subnets.

Similar to the host number portion of Class A, Class B, and Class C addresses, subnet addresses are assigned locally, usually by the network administrator. Also, like other IP addresses , each subnet address is unique.

 

10.6

Basics of Subnetting

 

10.6.2

Subnetwork

Subnet addresses include the Class A, Class B, or Class C network portion, plus a subnet field and a host field. The subnet field and the host field are created from the original host portion for the entire network. The ability to decide how to divide the original host portion into the new subnet and host fields provides addressing flexibility for the network administrator. To create a subnet address, a network administrator borrows bits from the original host portion and designates them as the subnet field.

Figures and illustrate the hierarchical nature of subnet addresses. 

To create a subnet address, a network administrator borrows bits from the host field and designates them as the subnet field. The minimum number of bits that can be borrowed is 2. If you were to borrow only 1 bit, to create a subnet, then you would only have a network number - the .0 network - and the broadcast number - the .1 network. The maximum number of bits that can be borrowed can be any number that leaves at least 2 bits remaining, for the host number. In this example of a Class C IP Address, bits from the host field for the subnet field have been borrowed. 

 

10.6

Basics of Subnetting

 

10.6.3

Purpose for subnetting

A primary reason for using subnets is to reduce the size of a broadcast domain. Broadcasts are sent to all hosts on a network or subnetwork. When broadcast traffic begins to consume too much of the available bandwidth, network administrators may choose to reduce the size of the broadcast domain.

 

10.6

Basics of Subnetting

 

10.6.4

Subnet mask

The subnet mask (formal term: extended network prefix), is not an address, but determines which part of an IP address is the network field and which part is the host field. A subnet mask is 32 bits long and has 4 octets, just like an IP address. 

To determine the subnet mask for a particular subnetwork IP address follow these steps. (1) Express the subnetwork IP address in binary form. (2) Replace the network and subnet portion of the address with all 1s. (3) Replace the host portion of the address with all 0s. (4) As the last step convert the binary expression back to dotted-decimal notation.

Note: The extended network prefix includes the class A, B, or C network number, plus the subnet field (or subnet number) that is being used to extend the routing information (which is otherwise just the network number).

 

10.6

Basics of Subnetting

 

10.6.5

Boolean operations: AND, OR, and NOT

The term "operations" in mathematics refers to rules that define how one number combines with other numbers. Decimal number operations include addition, subtraction, multiplication, and division. There are related, but different, operations for working with binary numbers. The basic Boolean operations are AND, OR, and NOT.

  • AND is like multiplication
  • OR is like addition
  • NOT changes 1 to 0, and 0 to 1

 

10.6

Basics of Subnetting

 

10.6.6

Performing the AND function

The lowest numbered address in an IP network is the network address (the network number plus 0 in the entire host field). This also applies to a subnet: the lowest numbered address is the address of the subnet.

In order to route a data packet, the router must first determine the destination network/subnet address by performing a logical AND using the destination host's IP address and the subnet mask. The result will be the network/subnet address.

In the Figure, the router has received a packet for host 131.108.2.2 - it uses the AND operation to learn that this packet should be routed to subnet 131.108.2.0. The process of ANDing is explained in Lab 10.6.6.

 

 

10.7

Creating a Subnet

 

10.7.1

Range of bits needed to create subnets

To create subnets, you must extend the routing portion of the address. The Internet knows your network as a whole, identified by the Class A, B, or C address, which defines 8, 16, or 24 routing bits (the network number). The subnet field will become additional routing bits, so that the routers within your organization can recognize different locations, or subnets, within the whole network.

  1. Question: In the address 131.108.0.0, which are the routing bits?
    Answer: 131.108 - That's the 16 bit Class B network number.
  1. Question: What are the other two octets (16 bits) of the address 131.108.0.0 used for?
    Answer: Well, as far as the Internet knows, that's just a 16 bit host field, because that's what a Class B address is - a 16 bit network number and a 16 bit host number.
  1. Question: What part of the address 131.108.0.0 is the subnet field?
    Answer:  When you decide to create subnets, you must divide the original host field (16 bits in the case of Class B) into two parts - the subnet field and the host field. This is sometimes referred to as "borrowing" some of the original host bits to create the subnet field. The other networks in the Internet won't care - they look at the address the same - all they really see is the Class A, B, or C network number, and send the packet on to its destination. The minimum number of bits that you can borrow is 2, regardless of whether you're working with a Class A, B, or C network1. Because at least 2 bits must remain for host numbers2, the maximum number of bits borrowed varies by address class. 

Address 
Class

Size of Default 
Host Field

Maximum Number 
of Subnet Bits

A

24

22

B

16

14

C

8

6

The subnet field always follows immediately after the network number. That is, the borrowed bits must be the first n bits of the default host field, where n is the desired size of the new subnet field. 

The subnet mask is the tool used by the router to determine which bits are routing bits and which bits are host bits.

1 Previous standards did not allow for the use of subnets obtained by borrowing 1 bit  (with only 1 subnet bit, the subnet field can only have two values: subnet 0 is part of the network address, and subnet 1 would be part of the network broadcast address) – although many devices can now support subnets obtained by borrowing 1 bit, it is still common practice to avoid doing this to insure compatibility with legacy devices; for our purposes here, you will always borrow at least 2 bits.

2 Similarly, a 1 bit host field would allow only for host 0, which is part of the network address, and host 1, which is part of the broadcast address, leaving 0 valid host addresses.

 

10.7

Creating a Subnet

 

10.7.2

Determining subnet mask size

Subnet masks use the same format as IP addresses. They are 32 bits long and are divided into four octets, written in dotted decimal format. Subnet masks contain all 1s in the network bit positions (determined by the address class) as well as the desired subnet bit positions, and contain all 0s in the remaining bit positions, designating them as the host portion of an address.

By default, if you borrow no bits, the subnet mask for a Class B network would be 255.255.0.0, which is the dotted decimal equivalent of 1s in the 16 bits corresponding to the Class B network number.

If 8 bits were to be borrowed for the subnet field, the subnet mask would include 8 additional 1 bits, and would become 255.255.255.0.

For example, if the subnet mask 255.255.255.0 were associated with the Class B address 130.5.2.144 (8 bits borrowed for subnetting), the router would know to route this packet to subnet 130.5.2.0 rather than to just network 130.5.0.0

Another example is the Class C address 197.15.22.131, with a subnet mask of 255.255.255.224. With a value of 224 in the final octet (11100000 in binary), the 24 bit Class C network portion has been extended by 3 bits, to make the total 27 bits. The 131 in the last octet now presents the third usable host address in the subnet 197.15.22.128. The routers in the Internet (that don't know the subnet mask) will only worry about routing to the Class C network 197.15.22.0, while the routers inside that network, knowing the subnet mask, will be looking at 27 bits to make a routing decision.

 

10.7

Creating a Subnet

 

10.7.3

Computing subnet mask and IP address

 

Whenever you borrow bits from the host field, it is important to note the number of  additional subnets that are being created each time you borrow one more bit. You have already learned that you cannot borrow only 1 bit; the fewest you may borrow is 2 bits.

Borrowing 2 bits creates four possible subnets (22) (but you must always remember that there are two reserved/unusable subnets). Each time you borrow another bit from the host field, the number of subnets created increases by a power of 2.

The eight possible subnets that are created by borrowing 3 bits is equal to 23 (2 x 2 x 2). The sixteen possible subnets created by borrowing 4 bits is equal to 24 (2 x 2 x 2 x 2). From these examples, it is easy to see that each time you borrow another bit from the host field, the number of possible subnets doubles.

  1. Question: How many bits are being borrowed (how long is the subnet field) for a Class B network using a subnet mask of 255.255.240.0?
    Answer: The first two octets of the mask (255.255) correspond with the 16 bits in a Class B network number. Remember that the subnet field is represented by all the additional "1" bits past that. The number 240 decimal is 11110000 in binary, and you can see that you are using 4 bits for the subnet field.
  1. Question: How many possible subnets are there with a 4 bit subnet field? 
    Answer: Start with finding the smallest 4 bit number - 0000 - then the largest 4 bit number - 1111 (15). So the possible subnets are 0-15, or sixteen subnets. However, you know you cannot use subnet 0 (it's part of the network address), and you cannot use subnet 15 (1111) either (broadcast address). So this 4 bit subnet field gives you fourteen usable subnets (1-14).

 

10.7

Creating a Subnet

 

10.7.4

Computing hosts per subnetwork

Each time you borrow 1 bit from a host field, there is 1 less bit remaining in the field that can be used for host numbers. Specifically, each time you borrow another bit from the host field, the number of host addresses that you can assign decreases by a power of 2 (gets cut in half).

To help you understand how this works, use a Class C network address as an example. If there is no subnet mask, all 8 bits in the last octet are used for the host field. Therefore, there are 256 (28) possible addresses available to assign to hosts (254 usable addresses, after you subtract the 2 you know you can't use). Now, imagine that this Class C network is divided into subnets. If you borrow 2 bits from the default 8 bit host field, the host field decreases in size to 6 bits. If you write out all of the possible combinations of 0s and 1s that could occur in the remaining 6 bits, you would discover that the total number of possible hosts that could be assigned in each subnet would be reduced to 64 (26). The number of usable host numbers would be reduced to 62.

In the same Class C network, if you borrow 3 bits, the size of the host field decreases to 5 bits and the total number of hosts that you could assign to each subnet would be reduced to 32 (25). The number of usable host numbers would be reduced to 30. 

The number of possible host addresses that can be assigned to a subnet is related to the number of subnets that have been created. In a Class C network, for example, if a subnet mask of 255.255.255.224 has been applied, then 3 bits (224 = 11100000) would have been borrowed from the host field. The useable subnets created are 6 (8 minus 2), each having 30 (32 minus 2) useable host addresses.

Exercise:
Divide the last octet into two parts: a subnet field and a host field. If there are 32 possible host addresses that can be assigned to each subnet, then their IP addresses would fall within the range of numbers (but remember the 2 unusable host addresses in each subnet!).

In a Class C network 199.5.12.0 with subnet mask 255.255.255.224, to which subnet would host 199.5.12.97 belong? (hint: 97 = 01100001 binary)

  1. subnet 0?
  2. subnet 1?
  3. subnet 2?
  4. subnet 3?
  5. subnet 4?
  6. none of the above?

 

10.7

Creating a Subnet

 

10.7.5

Boolean AND operation

 

As you have already learned, the lowest numbered address in an IP network is the network address (the network number plus 0 in the entire host field). This also applies to a subnet; the lowest numbered address is the address of the subnet.

In order to route a data packet, the router must first determine the destination network/subnet address. To accomplish this the router performs a logical AND using the destination host's IP address and the subnet mask for that network.

Imagine that you have a Class B network with the network number 172.16.0.0. After assessing the needs of your network, you decide to borrow 8 bits in order to create subnets. As you learned earlier, when you borrow 8 bits with a Class B network, the subnet mask is 255.255.255.0.

Someone outside the network sends data to the IP address 172.16.2.120. In order to determine where to deliver the data, the router ANDs this address with the subnet mask. When the two numbers are ANDed, the host portion of the result will always be 0. What is left is the network number, including the subnet. Thus, the data is sent to subnet 172.16.2.0, and only the final router notices that the packet should be delivered to host 120 in that subnet.

Now, imagine that you have the same network, 172.16.0.0. This time, however, you decide to borrow only 7 bits for the subnet field. The binary subnet mask for this would be 11111111.11111111.11111110.00000000. What would this be in dotted decimal notation?

Again, someone outside the network sends data to host 172.16.2.120. In order to determine where to send the data, the router again ANDs this address with the subnet mask. As before, when the two numbers are ANDed, the host portion of the result is 0. So what is different in this second example? Everything looks the same - at least in decimal. The difference is in the number of subnets available, and the number of hosts that can be in each subnet. You can only see this by comparing the two different subnet masks.  

With 7 bits in the subnet field, there can be only 126 subnets. How many hosts can there be in each subnet? How long is the host field? With 9 bits for host numbers, there can be 510 hosts in each of those 126 subnets.

icon2.gif (1232 bytes)

Web Links

 

How Boolean Logic Works

1 The two graphics on this page include something you'll learn more about later - an alternate way to express the subnet mask. You learned that the 1s of the mask represent the routing bits - the network plus the subnet. 255.255.255.0 indicates there are 24 total routing bits. This is sometimes indicated by following an IP address with "/24", as in 131.108.3.1 /24 - this says the same thing as the longer subnet mask.

 

10.7

Creating a Subnet

 

10.7.6

IP configuration on a network diagram

When you configure routers, you must connect each interface to a different network segment. Then each of these segments will become a separate subnet. You must select an address from each different subnet to assign to the interface of the router that connects to that subnet. Each segment of a network - the actual wires and links - must have different network/subnet numbers. The Figure shows what a network diagram might look like using a subnetted Class B network. 

 

10.7

Creating a Subnet

 

10.7.7

Host/subnet schemes

One of the decisions that you must make whenever you create subnets is to determine the optimal number of subnets and hosts (Note: The number of subnets required in turn determines the number of hosts available. For example, if you borrow 3 bits with a Class C network, only 5 bits remain for hosts).

You have already learned that you cannot use the first and last subnet. You also cannot use the first and last address within each subnet - one is the broadcast address of that subnet, and the other is part of the network address. When you create subnets, you lose quite a few potential addresses. For this reason, network administrators must pay close attention to the percentage of addresses that they lose by creating subnets.

Example:
If you borrow 2 bits with a Class C network, you create 4 subnets, each with 64 hosts. Only 2 of the subnets are usable and only 62 hosts are usable per subnet, leaving 124 usable hosts out of 254 that were possible before you chose to use subnets. This means you are losing 51% of your addresses.

Imagine, this time, that you borrow 3 bits. You now have 8 subnets, of which only 6 are usable, with 30 usable hosts per subnet. This gives you a total of 180 usable hosts, down from 254, but now you are losing only 29% of your addresses. Whenever you create subnets, you need to take into consideration future network growth and the percentage of addresses that you would lose by creating subnets.

 

 

10.7

Creating a Subnet

 

10.7.8

Private addresses

There are certain addresses in each class of IP address that are not assigned. These addresses are called private addresses. Private addresses might be used by hosts that use network address translation (NAT), or a proxy server, to connect to a public network; or by hosts that do not connect to the Internet at all.

Many applications require connectivity within only one network and do not need external connectivity. In large networks, TCP/IP is often used, even when network layer connectivity outside the network isn’t needed. Banks are good examples. They may use TCP/IP to connect to automatic teller machines (ATMs). These machines do no connect to the public network, so private addresses are ideal for them. Private addresses can also be used on a network where there are not enough public addresses available.

The private addresses can be used together with a network address translation (NAT) server. Either a NAT server or a proxy server to provide connectivity to all hosts in a network that has relatively few public addresses available. By agreement, any traffic with a destination address within one of the private address ranges will NOT be routed on the Internet.

 

Summary

This chapter discussed routing and addressing as it relates to the network layer of the OSI model. You learned that:

  • internetworking functions of the network layer include network addressing and best path selection for traffic.
  • there are two addressing methods: flat and hierarchical.
  • there are three classes of IP addresses that an organization can receive from InterNIC: Class A, B, and C. 
  • InterNIC reserves Class A addresses for governments throughout the world, Class B addresses for medium-size companies, and Class C addresses for all other entities
  • when written in a binary format, the first bit of a Class A address is always 0
  • the first 2 bits of a Class B address are always 10, and the first 3 bits of a Class C address are always 110
  • in order to provide extra flexibility for the network administrator, networks --- particularly large ones --- are often divided into smaller networks called subnetworks or subnets
  • subnets are concealed from outside networks by using masks referred to as subnet masks

In the next chapter, you will see how devices and routing protocols operate at the network layer.