Title: 2.5 IPv4 Subnetting
Course: Information and Communication Technology: Module B > Section: Section 2 - Network Addressing Basics

2.5.1 Subnetting

Subnetting is a logical subdivision of an IP network. It means dividing a network into two or more pieces. All computers belonging to a network are addressed with the identical network portion in their IP address. This results in the logical division of an IP address into two fields: a network identifier and the host identifier. The host portion identifies a specific host or node.

Subnet addresses include the network portion, which can be Class A, Class B, or Class C, and a subnet address portion and a host address portion. Being able to divide an address allows the network administrator to design the network appropriately. A network administrator creates a subnet by borrowing bits from the original host portion and designating them as the subnet field.

The benefits of subnetting vary with each deployment scenario. It can be used to allocate address space more efficiently and to enhance routing efficiency. Subnets are commonly used to reduce the size of a broadcast domain, allowing network traffic to be segmented by address. Traffic between subnetworks is passed back and forth using routers.

2.5.2 Subnetting

The original network portion of an IP address, before subnetting, is what is shown to the rest of the internet. It is the “classful” address that was discussed in Section 2.4.3. The subnet mask can be written as a slash character (/). For example, in IP address 192.168.1.0/24, the /24 means 24 bits have been allocated for the network prefix, and the last 8 bits have been reserved for individual device addressing. It can also be expressed in dotted decimal representation like an address. For example, 255.255.255.0 is the network mask for the 192.168.1.0/24 prefix. The mask just shows us how many bits are used for the network address (network ID or network prefix).

The default mask is the starting point for each class. It is based on the formula of each class. The network portion is filled with all 1’s and the host portion is filled with all 0’s. For example:

- Class A has a formula of N.H.H.H. and a default mask of 255.0.0.0
- Class B has a formula of N.N.H.H. and a default mask of 255.255.0.0
- Class C has a formula of N.N.N.H. and a default mask of 255.255.255.0

2.5.3 Subnetting

The subnet mask tells the network devices which part of an address is the network portion and which part is the host portion. A subnet mask is 32 bits long and has 4 octets, just like an IP address. Bits are always borrowed from the left-most available host bits.

The subnet mask of a network can be determined as follows:

1. Look at the first octet and determine the class of the IP address.
2. Find the default mask.
3. Express the default mask in binary form.
4. How many bits do you need to borrow to accommodate the number of networks you need to create and/or the number of hosts needed per network?
5. Convert the number bits needed in step 4 to all 1s (network portion). The rest of the address (new host portion) will consist of all 0s.
6. As the last step, convert the binary number back to dotted-decimal notation for each octet.

For example, if you have a class C address:

1. What is the formula?
N.N.N.H.
2. What is the default mask?
255.255.255.0
3. How many bits are used without subnetting? (Hint: each network portion contain 8 bits.)
24
4. What is the default mask in binary?
11111111.11111111.11111111.00000000
5. If you borrowed 4 bits, how many are now part of the network portion?
28
6. Borrow those 4 bits from the left-most area of the Host portion replace the network and subnet portions with all 1’s and the host portion with all 0’s.  What is the result?
11111111.11111111.11111111.11110000
7. Convert back to dotted decimal.
255.255.255.240
8. What would the slash notation be?
/28

2.5.4 Subnetting

We will concentrate on Class “C” for now. Remember, this gives us 24 bits for the network and 8 bits for the host.

Borrowing 2 bits creates four usable subnets (2^2). Every time a bit is borrowed from the host field, the number of subnets that are created is doubled.

For example:

- 8 subnets are created by borrowing 3 bits (2 x 2 x 2).
- 16 subnets are created by borrowing 4 bits (2 x 2 x 2 x 2).
- 32 subnets are created by borrowing 5 bits (2 x 2 x 2 x 2 x 2).
- 64 subnets are created by borrowing 6 bits (2 x 2 x 2 x 2 x 2 x 2).

Important to remember:

- As you increase the number of bits borrowed, increasing the number of subnets, you decrease the number of unborrowed bits, decreasing the number of hosts per subnet.
- As you decrease the number of bits borrowed, decreasing the number of subnets, you increase the number of unborrowed bits, increasing the number of hosts per subnet.
- The possible number of hosts, also known as the increment, defines the size of the subnet. It also tells you the distance between network addresses. (If you borrow 3 bits leaving you 5 host bits, 2^5 = 32. 32 is the increment so the network addresses are: x.x.x.0, x.x.x.32, x.x.x.64, x.x.x.96, etc.)

2.5.5 Subnetting

2.5.6 Subnetting

Private addr ess ing is another way of preserving space and securing the network. There are certain addresses in each class of IP address that are not assigned to the public. Private addresses might be used by hosts that use network address translation ( NAT ) or a proxy server to connect to a network or by devices that do not need to be connected. Either a NAT server or a proxy server is used for accessing a network when there are limited 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.

Some applications only require connectivity within a single network. TCP/IP is often used even when there is no need for connectivity outside the network. For example, a bank may use TCP/IP to connect to automatic teller machines (ATMs). These machines do not connect to the public network, so private addresses are ideal for them. Private addresses can also be used on a network that does not have enough available public addresses.

Please complete assignments 2.5.1, 2.5.2, and 2.5.3 in the lab manual.