Tutorials

## Free Class C Subnetting Tutorial, What is CIDR, Subnet Mask, Directed and Limited Broadcast

External Resources

This lesson is only a part of a series of IPv4 subnetting lessons. Please visit the below links to learn IPv4 subnetting completely.

In this Class C Subnetting Tutorial - Part 1, you will learn how to subnet a Class C network. You need good knowledge about binary number system and the conversions between decimal to binary and binary to decimal. Click the following link to learn more about binary and hexadecimal number system.

Subnetting (RFC 950) is the process of dividing any classful IP network (Class A, Class B, or Class C network) into smaller networks.

Before proceeding further deep into subnetting, we should know these terms.

If we recollect from the previous lessons, an IPv4 address has two components, the network part and the host part. Really, IPv4 address is a combination of IPv4 address and Subnet mask and the purpose of subnet mask is to identify which part of an IPv4 address is the network part and which part is the host part. Subnet mask is also a 32 bit number where all the bits of the network part are represented as "1" and all the bits of the host part are represented as "0".

If we take an example for a Class C network, 192.168.10.0, the address part and the subnet mask can be represented as below.

Component Binary Decimal

For a Class C IPv4 address, the first three octets are used to represent the Network part and the lact octet is used to represent the host part. From the above table, we can see all "1" in the network part and all "0" in nthe host part. When this subnet mask is converted to a decimals, it will become 255.2555.255.0. The default subnet mask for a Class C network is 255.255.255.0, Class B network is 255.255.0.0 and Class A network is 255.0.0.0

### What is a Network Address?

A network address is used to identify the subnet that a host may be placed on and is used to represent that network. We can find the network address by assigning all bits in the host part as 0.

The host id value containing all 1's in the bit pattern indicates a directed broadcast address. A directed broadcast address can occur in the destination IPv4 address of an IP datagram, but never as a source IPv4 address. A directed broadcast address will be seen by all nodes on that network. For example, the broadcast id for the network 192.168.10.0 will be 192.168.10.255.

A directed broadcast is sent to a specific network identified in the Network part of the IPv4 address. Routers on the network configured to forward-directed broadcasts will send the IP datagram to the final router that connects the destination specidied in the network part, and the router at the destination network should forward it to the destination host.

### What is CIDR?

Classless Inter-Domain Routing (CIDR, RFC 1517, RFC 1518, RFC 1519, RFC 1520) was published in 1993 to keep the internet from running out of IPv4 addresses. The "classful" system of allocating IPv4 addresses can waste many IPv4 addresses. Any organization who need just a few IPv4 addresses more than 254 must get a Class B address block of 65533 IPv4 addresses. Even much more IPv4 addresses are wasted in the case of Class A, where total usable IPv4 addresses per network is 16777214 ((2^24) - 2).

The original "IPv4 Class A networks" uses 8 bits to represent the network part, "Class B networks" uses 16 bits to represent the network part and "Class C networks" uses 24 bits to represent the network part. CIDR replaced these categories with a more generalized network prefix. This network prefix could be of any length, not just 8, 16, or 24 bits.

For example; 172.16.120.213 255.255.128.0 can be represented in CIDR format as 172.16.120.213/17, because there are 17 bits used for network part.

Classless Inter-Domain Routing (CIDR) includes supernetting (supernetting is the method of using contiguous blocks of address spaces to simulate a single, larger, address space), VLSM (Variable Length Subnet Masking, a method of subnetting a subnet) and route aggregation (method representing multiple networks using a single entry in a router's routing table. This can greatly reduce the size of the routing tables in routers).

### Class C Subnetting Tutorial

Subnetting is done by taking the bit/s from host part and adding it to the network part. Consider the same Class C example given above. Remember, the first three octets of a Class C network is used to represent the network and the last octet is used to represent the host. The default format for a Class C IPv4 address is Network.Network.Network.Host.

To make things easy, you may remember this.

If all the bits in the host part are "0", that represents the network id.

If all the bits in the host part are "0" except the last bit, it is the first usable IPv4 address.

If all the bits in the host part are "1" except the last bit, it is the last usable IPv4 address.

If all the bits in the host part are "1", that represents the directed broadcast address.

All the IPv4 addresses between the first and last IPv4 addresses (including the first and last) can be used to configure the devices.

### Class C - One Bit Subnetting Tutorial

Consider the network shown above. If we include one bit from the host part to the network part, the subnet mask is changed into 255.255.255.128. The single bit can have two values in last octet, either 0 or 1.

11000000.10101000.00001010.0 | 0000000
11111111.11111111.11111111.1 | 0000000

That means, we can get two subnets if we do a single bit subnetting.

SN No Description Binaries Decimal

The network 192.168.10.0 is divided into two networks, each network has 128 total IPv4 addresses and 126 usable IPv4 addresses (two IPv4 addresses are used in each subnet to represent the network address and the directed broadcast address). The subnet mask for one bit subnetting is 255.255.255.128.

### Class C - Two Bit Subnetting Tutorial

If we include two bits from the host part to the network part, the subnet mask is changed into 255.255.255.192. The two bits added to network part can have four possible values in last octet and that are 00, 01, 10 and 11. That means, we can get four networks if we do a two bit subnetting.

11000000.10101000.00001010.00 | 000000
11111111.11111111.11111111.11 | 000000

SN No Description Binaries Decimal

The network 192.168.10.0 is divided into four networks, each network has 64 total IPv4 addresses and 62 usable IPv4 addresses (two IPv4 addresses are used in each subnet to represent the network address and the directed broadcast address). The subnet mask for two bit subnetting is 255.255.255.192.

### Class C - 3 Bit Subnetting Tutorial

If we include three bits from the host part to the network part, the subnet mask is changed into 255.255.255.224. The three bits added to network part can have eight possible values in last octet and that are 000, 001, 010, 011, 100, 101, 110 and 111. That means, we can get eight networks if we do a three bit subnetting.

11000000.10101000.00001010.000 | 00000
11111111.11111111.11111111.111 | 00000

SN No Description Binaries Decimal

The network 192.168.10.0 is divided into eight networks, each network has 32 total IPv4 addresses and 30 usable IPv4 addresses (two IPv4 addresses are used in each subnet to represent the network address and the directed broadcast address). The subnet mask for three bit subnetting is 255.255.255.224.

### Class C 1-bit and 2-bit Subnetting Video Tutorials - Part 2

In this Class C Subnetting Tutorial - Part 1, you have learned what is a subnet mask, what is network address, what is directed broadcast,what is limited broadcast, what is CIDR and how to perform a Class C subnetting. Click "Next" to view Class C Subnetting Tutorial - Part 2

Jajish Thomason