With this IP subnetting cheat sheet, including the CIDR Cheat Sheet article, we’ll provide you with all the details and show you how to subnet IP addresses, essential for network-related interviews, jobs, and exams. Understanding how subnetting works may seem difficult initially, but it begins to make sense as you continue. You can quickly create and deploy IP subnets that will give your organization the necessary level of design ease, scalability, management, and security you need.
IP Subnetting Cheat Sheet Infographic PDF
I hope you have downloaded the PDF, now let’s first understand a few basic things before diving into subnetting.
What is IP subnetting, and why do we need it?
IP Subnetting splits a network into multiple sub-networks, creating a partition based upon a consecutive block of IPv4 addresses, which is further represented by an IP address and the subnet mask.
Subnetting is widely used to preserve IP addresses and design scalable and secured networks.
More on this later lets first understand IP address and other important concepts related to subnetting.
What is an IP address?
An IP address is a unique identifier for every computer, server, router, and hardware that connects to the network. But, first, let’s understand a few needy greedy things about IP addresses.
- It is a 32-bit binary number representing a specific physical location on the network.
- Three dots separate this 32-bit number and four blocks we call octets. Each octet represents 8 bits or 1 byte, which in turn, if you multiply by 4, will give 8×4=32 bits.
- IP addresses can be broken down into three categories, namely unicast (used on individual devices), multicast (allows someone to send information to a group of computers), and broadcast (which allows one computer to send information out to everyone). Unicast IP addresses are the most common type and are found on our laptops or other devices to connect to the Internet.
What is a subnet mask?
The subnet mask divides the IP address into the host and network addresses, defining which parts belong to the device and which to the network.
An IP address and a subnet mask provide complete information and numerical identification to any device that needs to connect to the network. Therefore, both types of addresses are always used in conjunction and have a length of 32 bits. These 32 bits are further split into four sections. Each portion is referred to as an Octet and includes 8 bits.
For example:- 192.168.100.1 255.255.255.0.
Here 192.168.100.1 is IP Address and 255.255.255.0 is Subnet Mask.
When you put the IP address and the subnet mask together, you can separate the network and host parts of the address. Here subnet mask is 255.255.255.0, so 192.168.100.0 will become Network Address, and the Host Address will become 0.0.0.1
What is Classless and Classful Ip addressing, and what is the difference?
IPv4 addresses were initially intended to be classful— ranging from Class A to Class E. Also, Unicast IPv4 addresses can be divided into two parts: the network portion and the Host ID portion of the address. Please check the table below.
Classful IP addressing worked within the bounds of the above-defined classes and was an old way of assigning IP addresses and subnets to a network.
As the Internet grew, this restricted assignment of IP addresses became a bottleneck. As a result, a more flexible and practical approach, called Classless IP Addressing, was developed.
What is the difference between Private and Public IP addresses?
- Private ip addresses or sometimes referred to as Internal ip addresses are only meant to be used on private networks and should not be routed on the Internet.
- And then there are Public ip addresses and can only be used on the Internet. You can check your public address by simply googling “what is my address.”
- IANA has designated the following three blocks of IP address space for private use.
- You can refer to the below table for reserved private IP addresses.
What is CIDR notation, and why do we use it?
IETF created Classless Interdomain Routing or CIDR in 1993 to provide greater granularity than classful routing; the CIDR notation is /XX.
It is also an efficient method for allocating IP subnets without any subnet boundaries, which lowered the rate at which Ipv4 addresses were depleted and helped grow the Internet rapidly.
For example: Instead of writing IP address with a subnet mask, which is 192.168.100.0 255.255.255.0, we can write 192.168.100.0/24.
What are CIDR Blocks?
CIDR blocks are made up of addresses with the same prefix and the same amount of bits. And with the help of supernetting, you can combine numerous connecting CIDR blocks into a bigger routing network with a shared network prefix.
The length of the prefix determines the size of the CIDR blocks. Using a shorter prefix, for example, 10.0.0.0/8, more addresses (approx. 16 Million) can be allocated, resulting in a bigger block. On the other hand, using a longer prefix, for example, 192.168.100.200/29, represents a smaller block, and you can allocate fewer addresses (6) only.
The Internet Assigned Numbers Authority (IANA) is the first to deal with CIDR blocks. After that, Regional Internet Registries (RIRs) receive huge allocations of IP addresses from IANA. Large geographical regions, such as North America, Africa, and Europe, are served by these large CIDR blocks.
Once an RIR obtains a CIDR block from IANA, it further divides it into smaller pieces to distribute to Local Internet Registries (LIRs). LIRs are generally ISP (Internet Service Providers), and they split the CIDR blocks into smaller blocks until the end-user is reached. The quantity of unique addresses needed by an end-user determines the size of the block granted to them by LIR.
Organizations that use multiple ISPs must receive provider-independent blocks directly from an RIR or LIR; however, most end-users use blocks assigned by their Internet Service Provider.
What is VLSM, and why do we use it?
When using VLSM, you can divide an IP address space into subnets of different sizes, from 0 to 32 bits. This makes subnets more useful because subnets can have masks of various sizes. CIDR uses VLSMs to create routes.
Quick Tip:- Before choosing a routing protocol, you should always check if the protocol supports VLSM or not. For example, classful routing protocols like RIPv1 and IGRP do not support VLSM.
How to convert Binary to Decimal and Decimal to Binary?
Ipv4 addresses are always represented in dotted-decimal separated by three dots for humans to understand easily. Further, these decimal numbers are converted into Binary numbers for further processing by machines. So we must know how to convert Binary to Decimal and vice versa. Binary is always represented in 1 or 0. However, any integer or non-integer number is Decimal, for example, 1,2,100,200, etc.
Example:- Convert Binary 11011011 into Decimal.
Please refer to the handy table for Binary to Decimal and Decimal to Binary conversion.
IP Subnetting Cheat Sheet with CIDR Cheat Sheet
So now we know the basics of IP addressing and subnetting; let put it all together in an IP subnetting cheat sheet for quick reference.
The formula for usable IP addresses always deducts two IP addresses because two IPs are always reserved within any subnet. One IP is Network Address, and the second one is Broadcast Address.
Let’s put it All together
Let’s take an example of the network configuration of your computer.
Let’s understand the main things here.
- IPv4 Address of this computer is 192.168.2.15
- Subnet Mask or subnet size or prefix length is 255.255.255.0
- 192.168.2.15 is from the Private IP address range.
- You can also write the above IP address and subnet mask in CIDR notion as 192.168.2.15/24
- Default Gateway is 192.168.2.1
- Let’s line up the IP address and Subnet Mask portion and convert Decimal numbers to Binary.
- 11000000.10101000.00000010.00001111 — IP address (192.168.2.15)
- 11111111.11111111.11111111.00000000 — Subnet mask (255.255.255.0)
- As you can see above, there are the first three octets (24 bits) that make up the network address and the last octet (8 bits) that make up the host address. This gives you these things:
- 11000000.10101000.00000010.00000000 — Network address (192.168.2.0)
- 00000000.00000000.00000000. 00001111 — Host address (000.000.000.15)
- The network address is 192.168.2.0 and the host address is 0.0.0.15. When a packet with a destination address of 192.168.2.15 will arrive on the 192.168.2.0 subnet, your computer will receive and process it.
In conclusion, IP Subnetting Cheat Sheet is a reference guide to subnetting. It includes an introduction to IP addressing, subnetting, IP subnets, classful/classless addressing, CIDR, and Binary to Decimal conversion table. I hope you have found this article useful! Please share it with others who you think might benefit from it. Let me know your thoughts in the comments below.
Frequently Asked Questions (FAQs)
Why do we use Classless Interdomain Routing?
Classless interdomain routing improves the allocation of IP addresses. It replaces the old classful system based on classes A, B, and C. This scheme also helped greatly extend the life of IPv4 as well as slow the growth of routing tables.
With the help of CIDR notation, you can replace lengthy subnet masks with “/” followed by a suffix, which is up to 32 bits in ipv4 and 128 bits in ipv6. For example: Instead of writing IP address with a subnet mask, which is 192.168.1.1 255.255.255.224, you can write 192.168.1.1/27.
What is VLSM, and How is CIDR different than VLSM?
There is a lot of confusion surrounding VLSM and CIDR, so it’s essential to understand the basics.
VLSM stands for Variable Length Subnet Masking, and CIDR stands for Classless Inter-Domain Routing.
CIDR is somewhat the opposite of VLSM: whereas VLSM specifies rules for subdividing networks, CIDR defines rules for referencing groups of networks with a single route statement.
While VLSM has significantly affected IP space allocation within corporate networks, CIDR has had an equally significant effect on the public Internet networks allocated to ISPs.
CIDR is based on VLSM, so in essence, with VLSM, you create smaller chunks of IP subnets, and with CIDR, you group those smaller subnets or supernet those subnets to make routing more efficient.