Introduction
An IP address is an address used to uniquely identify a devices such as computer,server and printers on an IP network. The address is made up of 32 binary bits which can be divisible into a network portion and host portion with the help of a subnet mask. The 32 binary bits are broken into four octets (1 octet = 8 bits). Each octet is converted to decimal and separated by a period (dot). IP address divided into different classes. Class A (1.0.0.0-127.255.255.255), Class B (128.0.0.0-191.255.255.255), Class C (192.0.0.0-223.255.255.255), Class D (224.0.0.0-239.255.255.255), class D, Class E and Classless Inter-domain Routing (CIDR).
- Class A—The first octet (8bits) denotes the network address, and the last three octets (24bits) are the host portion. Any IP address whose first octet is between 1 and 126 is a Class A address. Note that 0 is reserved as a part of the default address, and 127 is reserved for loopback.
- Class B—The first two octets (16 bits) denote the network address, and the last two octets (16 bits) are the host portion. Any address whose first octet is in the range 128 to 191 is a Class B address.
- Class C—The first three octets (24bits) denote the network address, and the last octet (8bits) is the host portion. The first octet range of 192 to 223 is a Class C address.
- Class D—Used for multicast. Multicast IP addresses have their first octets in the range 224 to 239.
- Class E—Reserved for future use and includes the range of addresses with a first octet from 240 to 255.
And subnetting
By subnetting you will be able to create multiple logical networks in a single physically connected networks (a single Class A, B, or C network). If you do not have subnet, you are only able to use one network from your desired Class A, B, or C network, for example 10.143.8.1 – 00001010.10001111.00001000.00000001 255.255.255.128- 11111111.11111111.11111111.10000000 If you count number of 1 in the bitmask you will get total 25. So the mask of 255.255.255.128 can also be denoted as /25 as there are 25 bits that are set in the mask. There is another method called CIDR. Classless Interdomain Routing (CIDR) was introduced to improve both address space utilization and routing scalability in the Internet. CIDR moves way from the traditional IP classes (Class A, Class B, Class C, and so on). In CIDR , an IP network is represented by a prefix, which is an IP address and some indication of the length of the mask. one of these networks can be described with the notation prefix/length. For example, 10.0.0.0/25 denotes the network 10.0.0.0 255.255.255.128 CIDR also depicts a more hierarchical Internet architecture, where each domain takes its IP addresses from a higher level. This allows for the summarization of the domains to be done at the higher level. For example, if an ISP owns network 203.17.0.0/16, then the ISP can offer 203.17.1.0/24, 203.17.2.0/24, and so on to their clients.
You can see on this picture for subnetting
You can use calculator to make sure for the subnetting and host
Source :