Subnetting Basics
With the growth of the Internet, there was a need for larger address spaces. However, this could only be achieved by increasing the length of the IF addresses. Although this meant that the format of IP address needed to be changed. Thus, a short-term solution, classless addressing was provided which uses subnetting. Thus, subnetting refers to a logical division of an IP address.
Classless Addressing
Classless addressing enables optimum utilisation of IP addresses. In addition, with the help of classless addressing IP address can be used with different subnet masks in the same network and it enables the efficient use of IP addresses.
Benefits of subnetting
Few benefits of subnetting are as follows:
- Routers form broadcast domains for routing packets destined for other networks. Further, creation of more broadcast domains results in smaller broadcast domains, thereby, reducing network traffic on each network segment.
- Reduction in network traffic leads to network optimisation and hence, improves network performance.
- Managing small broadcast domains is simpler, thus, subnetting provides simplified management.
- Networks connected using LAN are smaller and more efficient than WAN links. Subnetting facilitates spanning of large geographical distances.
Lets us discuss subnet masks briefly in the following section.
Subnet Masks
A subnet address is created from a host address by assigning a subnet mask. A 32-bit value allowing a receiving node to discern network address and host address is termed as a subnet mask. It contains is and Os, where is refer to the subnet or network and Os refer to the host and 255 is assigned to a broadcast address. Table 3 shows the default subnet masks for Classes A, B and C.
Class | Format | Default subnet mask |
A | Network. Node. Node. Node | 255.0.0.0 |
B | Network. Network. Node. Node | 255.255.0.0 |
C | Network. Network. Network. Node | 255.255.255.0 |
CIDR (CLASSLESS INTER-DOMAIN ROUTING)
CIDR stands for Classless Inter-Domain Routing (occasionally, Classless Internet Domain Routing). CIDR was developed in the 1990s as a standard scheme for routing network traffic across the Internet.
CIDR is an alternative to traditional IP sub netting that organizes IP addresses into subnetworks independent of the value of the addresses themselves. CIDR is also known as supernetting as it effectively allows multiple subnets to be grouped together for network.
- CIDR reduced the problem of wasted address space by providing a new and more flexible way to specify network addresses in routers. CIDR lets one routing table entry represent an aggregation of networks that exist in the forward path that don’t need to be specified on that particular gateway. This is much like how the public telephone system uses area codes to channel calls toward a certain part of the network. This aggregation of networks in a single address is sometimes referred to as a super net.
- Using CIDR, each IP address has a network prefix that identifies either one or several network gateways. The length of the network prefix in IPv4 CIDR is also specified as part of the IP address and varies depending on the number of bits needed, rather than any arbitrary class assignment structure.
- A destination IP address or route that describes many possible destinations has a shorter prefix and is said to be less specific. A longer prefix describes a destination gateway more specifically. Routers are required to use the most specific, or longest, network prefix in the routing table when forwarding packets. (In IPv6, a CIDR block always gets 64 bits for specifying network addresses.)
- CIDR Notation CIDR specifies an IP address range using a combination of an IP address and its associated network mask. CIDR notation uses the following format –
- xxx.xxx.xxx.xxx/n
where n is the number of (leftmost) ‘1’ bits in the mask. For example,
- 192.168.12.0/23
Applies the network mask 255.255.254.0 to the 192.168 network, starting at 192.168.12.0. This notation represents the address range 192.168.12.0 – 192.168.13.255. Compared to traditional class-based networking, 192.168.12.0/23 represents an aggregation of the two Class C subnets 192.168.12.0 and 192.168.13.0 each having a subnet mask of 255.255.255.0.
iii. 192.168.12.0/23 = 192.168.12.0/24 + 192.168.13.0/24
Additionally, CIDR supports Internet address allocation and message routing independent of the traditional class of a given IP address range. For example,
- 10.4.12.0/22
Represents the address range 10.4.12.0 – 10.4.15.255 (network mask 255.255.252.0). This allocates the equivalent of four Class C networks within the much larger Class A space.
- You will sometimes see CIDR notation used even for non-CIDR networks. In non-CIDR IP sub netting, however, the value of n is restricted to either 8 (Class A), 16 (Class B) or 24 (Class C). Examples:
- 10.0.0.0/8
- 172.16.0.0/16.
iii. 192.168.3.0/24
- CIDR implementations
- CIDR implementations require certain support be embedded within the network routing protocols. When first implemented on the Internet, the core routing protocols like BGP (Border Gateway Protocol) and OSPF (Open Shortest Path First) were updated to support CIDR. Obsolete or less popular routing protocols may not support CIDR.
- CIDR aggregation requires the network segments involved to be contiguous (numerically adjacent) in the address space. CIDR cannot, for example, aggregate 192.168.12.0 and 192.168.15.0 into a single route unless the intermediate .13 and .14 address ranges are included (i.e., the 192.168.12/22 network).
All about IP Classes
Communication on and between networks today relies on a systematic scheme built upon Internet Protocol (IP) Addressing. An IP address consists of a network ID and host ID and is broken down into five classes of addressing. These classes are best assigned and used according to the estimated number of hosts you anticipate having on your network.
Class A
A Class A network covers the IP address range of 1.0.0.0 – 126.255.255.255, with a subnet mask of 255.0.0.0 or /8 (pronounced “Slash 8”). A Class A network can have a maximum of 126 networks and 16,777,214 hosts.
Class B
A Class B network covers the IP address range of 128.0.0.0 – 191.255.255.255, with a subnet mask of 255.255.0.0 or /16. A Class B network can have a maximum 16,384 networks and 65,534 hosts.
Class C
A Class C network covers the IP address range of 192.0.0.0 – 223.255.255.255, with a subnet mask of 255.255.255.0 or /24. A Class C network can have a maximum of 2,097,152 networks and 254 hosts.
Class | 1st Octet Decimal Range | 1st Octet High Order Bits | Network/Host ID (N=Network, H=Host) | Default Subnet Mask | Number of Networks | Hosts per Network (Usable Addresses) |
A | 1 – 126* | 0 | N.H.H.H | 255.0.0.0 | 126 (27 – 2) | 16,777,214 (224 – 2) |
B | 128 – 191 | 10 | N.N.H.H | 255.255.0.0 | 16,382 (214 – 2) | 65,534 (216 – 2) |
C | 192 – 223 | 110 | N.N.N.H | 255.255.255.0 | 2,097,150 (221 – 2) | 254 (28 – 2) |
D | 224 – 239 | 1110 | Reserved for Multicasting | |||
E | 240 – 254 | 1111 | Experimental; used for research |
Note: Class A addresses 127.0.0.0 to 127.255.255.255 cannot be used and is reserved for loopback and diagnostic functions.
Private IP Addresses
Class | Private Networks | Subnet Mask | Address Range |
A | 10.0.0.0 | 255.0.0.0 | 10.0.0.0 – 10.255.255.255 |
B | 172.16.0.0 – 172.31.0.0 | 255.240.0.0 | 172.16.0.0 – 172.31.255.255 |
C | 192.168.0.0 | 255.255.0.0 | 192.168.0.0 – 192.168.255.255 |