Understanding IP Class Subnetting: Class C vs. Class B
Introduction
In computer networking, IP (Internet Protocol) addresses are used to identify devices on a network and enable communication between them. IP addresses are divided into several classes, each with a different number of bits allocated for the network and host portions of the address. In this article, we will focus on Class B and Class C IP addresses and understand how subnetting works in these classes.
IP Address Classes
There are five classes of IP addresses: Class A, B, C, D, and E. Each class has a different range of IP addresses and a varying number of bits allocated for the network and host portions of the address.
Class A Addresses
Class A addresses have the first octet ranging from 1 to 126, with the remaining three octets used for host addresses. The default subnet mask for Class A addresses is 255.0.0.0, which means that the first octet is used for the network portion, and the remaining three octets are used for host addresses.
Class B Addresses
Class B addresses have the first octet ranging from 128 to 191, with the remaining two octets used for host addresses. The default subnet mask for Class B addresses is 255.255.0.0, which means that the first two octets are used for the network portion, and the remaining two octets are used for host addresses.
Class C Addresses
Class C addresses have the first octet ranging from 192 to 223, with the remaining two octets used for host addresses. The default subnet mask for Class C addresses is 255.255.255.0, which means that the first three octets are used for the network portion, and the remaining octet is used for host addresses.
Subnetting
Subnetting is a technique used to divide a larger network into smaller sub-networks or subnets. Subnetting is done by borrowing bits from the host portion of the IP address and adding them to the network portion to create subnets.
Subnetting in Class C
Since Class C addresses have only 8 bits for the host portion, subnetting can be done by borrowing bits from the host portion and adding them to the network portion. The number of subnets created depends on the number of bits borrowed, and the number of hosts per subnet depends on the number of bits remaining for the host portion.
For example, if we borrow 1 bit from the host portion, we can create 2 subnets. With 1 bit borrowed, we have 7 bits remaining for the host portion, which means we can have up to 126 hosts per subnet (since 2^7 = 128, and we must subtract 2 for the network and broadcast addresses).
original Class C network: 192.168.1.0/24
subnet mask: 255.255.255.128 (/25)
subnet 1: 192.168.1.0 - 192.168.1.127
subnet 2: 192.168.1.128 - 192.168.1.255
Subnetting in Class B
Subnetting in Class B addresses is similar to subnetting in Class C, but we have more bits to work with in the host portion. By borrowing bits from the host portion and adding them to the network portion, we can create more subnets and have more hosts per subnet.
For example, if we borrow 2 bits from the host portion, we can create 4 subnets. With 2 bits borrowed, we have 14 bits remaining for the host portion, which means we can have up to 16,382 hosts per subnet (since 2^14 = 16,384, and we must subtract 2 for the network and broadcast addresses).
original Class B network: 172.16.0.0/16
subnet mask: 255.255.254.0 (/23)
subnet 1: 172.16.0.0 - 172.16.1.255
subnet 2: 172.16.2.0 - 172.16.3.255
subnet 3: 172.16.4.0 - 172.16.5.255
subnet 4: 172.16.6.0 - 172.16.7.255
- IP addresses are divided into several classes, each with a different number of bits allocated for the network and host portions of the address.
- Subnetting is a technique used to divide a larger network into smaller sub-networks or subnets.
- In Class C addresses, subnetting can be done by borrowing bits from the host portion and adding them to the network portion, creating up to 126 hosts per subnet.
- In Class B addresses, subnetting can be done by borrowing bits from the host portion and adding them to the network portion, creating more subnets with more hosts per subnet.