IP Address & Classes

Search for a command to run...

No comments yet. Be the first to comment.
In this article, you'll learn about what interface are and how to use them, along with the difference between type and interface. This article gives you a basic understanding of the interface. This is going to be a full series of typescript where yo...

In this article, you'll learn about what enums are and how you can use them in your projects. Enums, short for Enumerated Types. This is going to be a full series of typescript where you will learn from basic topics like string, boolean to more comp...

In this article, I will suggest to you some of the best extensions you need to install for better productivity that can come in very handy. So without further due, let's get into it. OSlash OSlash is a free, top-rated Text Expander and Custom Keyboar...

In this article, I'll be explaining what is an operating system, its functions, types and services. What are kernel, shell and system calls? and what is CPU scheduling? This will be a short or brief introduction about each of the mentioned topics. Wh...

In this article, We are going learn about how you can use type in Array and there is a special thing that is Read only Array. In which you can't manipulate the values. In addition, I'll talk about Tuples as well. How you can use it? This is going to...

In this article, I will explain the concept of IP Addresses, How it works, and its classifications and types in detail. I'll cover each one of these ones by one as simple as possible.
An IP address, or Internet Protocol address, is a series of numbers that identifies any device on a network.
IP addressing is the process of finding a unique IP address. A unique IP address is required for each host and network component that communicates using TCP/IP protocol.
TCP/IP stands for Transmission Control Protocol/Internet Protocol and is a suite of communication protocols used to interconnect network devices on the internet. TCP/IP is also used as a communications protocol in a private computer network
The IP Address identifies a system's location on the network. An IP must be globally unique and have a uniform format.
Each IP address has two parts:
Network ID: It identifies the system that is located on the same physical networkID. It is also known as the network address.
Host ID: It identifies the workstation, server, router, or other TCP/IP host within a network. The address for each host must be unique. to the networkID.
The use of the term networkID refers to any IP networkID, whether it is class-based, a subnet, or a supernet.

An IP Address is 32-bits long. It is a common practice to segment the 32-bits of the IP address into four 8-bit fields called octets. Each octet is converted to a decimal number (the base 10 numbering system) in the range of 0-255 and separated by a period (a dot). This format is called dotted decimal notation.
Example IPv4 Address- 128.168.112.201

TCP/IP defines five classes of IP addresses: Class A, B, C, D, and E. Each class has a range of valid IP addresses. The value of the first octet determines the class.
| Class | Range |
| A | 0-127 |
| B | 128-191 |
| C | 192-223 |
| D | 224-239 |
| E | 240-255 |
Class A addresses are assigned to networks with a very large number of hosts. The high-order bit in a class A address is always set to 0. The next seven bits (completing the first octets) complete networkID. The remaining 24 bits (the last three octets) represent the host ID.

As shown in the above image the network ID only has 8-bits the first bit is 0 (fixed bit for Class A) and the other 7-bits are empty. So there can only be 27 - 2 (126) maximum possible networks. I have subtracted the 2 from possible networks because IANA does not allow to use of the first and last bits of the address which are (00000000 and 01111111).
As there are only 24-bits left and we could do the math 224 - 2 (16777214). Now here I've also subtracted the 2 that is because in host id first bits of the host address represent the whole network. and the last address is used as the broadcasting address to the whole network.

In the above, I have taken a network with IP address 72.0.0.0 in this 72 represents the network ID and that is in the range of 0-127 so we know it is a Class A IP address, and 0.0.0 represent host ID but we cannot assign to the user or host because this IP represents the whole network.
And Broadcasting IP Address means that if anyone has to send the message or data to all the hosts then It can be done with the 72.255.255.255 which can also not be assigned to the host.
| Summary | |
| Max. Networks | 27 - 2 (126) |
| Max. Hosts | 224 - 2 (16777214) |
| Example IP Address | 72.21.96.242 |
Class B addresses are assigned to medium-sized to large-sized networks. The two high-order bits in a class B address are always set to binary 10. The next 14-bits (completing the first and second octets) complete the network ID. The remaining 16-bits (last two octets) represent the host ID.

As shown in the above image, the network ID has 16-bits in which 2-bits are fixed (10) and there are 14-bits left empty. So there can be maximum of 214 (16384) networks. There is no restriction by IANA as it was in Class A.
As there are only 16-bits left and we could do the math 216 - 2 (65534). Now here I've also subtracted the 2 that is because in host id first bits of the host address represent the whole network. and the last address is used as the broadcasting address to the whole network as I mentioned in the Class A section.
| Summary | |
| Max. Networks | 214 (16384) |
| Max. Hosts | 216 - 2 (65534) |
| Example IP Address | 168.211.236.201 |
Class C addresses are used for small networks. The three high-order bits in class C are always set to binary 110. The next 21-bits (completing the first three octets) complete the network ID. The remaining 8-bits (last octet) represent the host ID.

As shown in the above image, the network ID has 24-bits in which 3-bits are fixed (110) and there are 21-bits left empty. So there can be maximum of 221 (2097152) networks. There is no restriction by IANA as it was in Class A.
As there are only 8-bits left and we can do the math 28 - 2 (254). Now here I've also subtracted the 2 that is because in host id first bits of the host address represent the whole network. and the last address is used as the broadcasting address to the whole network as I mentioned in the Class A section.
| Summary | |
| Max. Networks | 221 (2097152) |
| Max. Hosts | 28 - 2 (254) |
| Example IP Address | 192.168.216.105 |
Class D addresses are reserved for IP multicast addresses. The four high-order bits in a Class D address are always set to binary 1110. The remaining bits are for the address that the interested host will recognize. Class D is never used for regular networking operations. It is a 32-bits network address. Thus, there is no need to extract the host address from the IP address.
Example IP Address: 225.231.47.153

Class E addresses are reserved for experimental purposes only for R&D (Research and development) or Study. The high order bits in Class E are set to 1111.
Example IP Address: 244.171.88.113

8-bits (first octet) identify the network, and the remaining 24-bits represent the host.16-bits (first two octets) identify the network, and the remaining 16-bits represent the host.24-bits (first three octets) are used to represent the network, and the remaining 8-bits represent the host. -32-bit network addresses. There is no need to extract the host address from the IP.
This was it, I have not coved the concept such as IPv4, IPv6, and subnetting perhaps that's for another article. If you learn something new then don't forget to press ❤️. You can also follow me for more such articles.