Understand IP Address IPv4 Classes And Subnet Mask

Make Money


Objectives 

At the end of this article you will be able to Understand IP Address in :
1. Understand about IP Address
2. Explain about IPversion4 CLASSES and Subnet Mask


Introducing IP Addresses and versions of IP Addresses


Just as one needs a specific postal address to send a parcel to someone, computers also need a unique identification address to send data to a specific computer. 

The Internet Protocol (IP) addressing system provides each computer on a network with a unique identifier. The following section will take a detailed look into the IP addressing system, including different IP Classes and subnet masks. 

A network address is an identifier for a node or network interface of a telecommunications network. 

Network addresses are often designed to be unique across the network, although some networks allow for local or private addresses that may not be unique. 

More than one type of network address may be used in any one network. 

There are 2 types of address

  1. Physical address, example Hardware address (MAC address)
  2. Logical or Software address, for example, IP address.
An IP address is a unique address used to identify each device (i.e. computer, mobile devices, printers, etc.) connected to an IP network. Internet Protocol version 4 (IPv4) is currently the most used addressing standard; however, IPv6 is also being used widely. 

Also, Read ↔ How To Take Google Adsense Approval
                                 

An IPv4 address contains 32 binary bits. As it is difficult for people to work with the binary numbers that computers use, IP addresses are converted to decimal format before they are displayed. This makes the whole process faster and more reliable. 

An IP address is a unique address used to identify each device (i.e. computer, mobile devices, printers, etc.) connected to an IP network.
  • 32-bit IPv4 is most widely used, while 128-bit Ipv6 is gradually taking over.
  • IPv4 uses decimal format and IPv6 uses hexadecimal format.
  • The image shows the IPv4 and IPv6 addressing systems.
Understand IP Address
Differences between IPv4 and IPv6
Understand IP Address


IP version 4 Octets 


An IPv4 address consists of four 8-bit parts called octets. Each octet is separated by a dot (.) and is represented by decimal numbers. An octet can range from 00000000 to 11111111 binary numbers; or 0 to 255 decimal numbers. As such, a typical IPv4 address can be like this 172.16.254.1
Understand IP Address



Thinking in Binary

To understand how binary to decimal conversion works, it is important to grasp the underlying principles of both systems. Instead of the ten digits of the decimal systems, i.e. 0 to 9, the binary system only uses two: 0 and 1. 

In a binary number, each digit is represented by a power of two, gradually increasing from right to left. The digit to the far right is the least significant digit and has a value of 20. Each digit on the left is increased in value by one power. 

Also Read:-
1. Computer Networking Course
2. How to set up home Network?

Thus, the leftmost digit in an octet, which is the most significant digit, has a value of 27. The sample Binary and Decimal conversion is shown as, 


Understand IP Address


Understand IP Address

Converting IP Addresses to Decimal 

To get the decimal equivalent of a binary number, the respective value of each binary digit is added. Following this rule, the largest binary number in an octet, 11111111, becomes in its decimal representation: 

27+26+25+24+23+22+21+20 = 128+64+32+16+8+4+2+1 = 255 

Each of the 8 digits in an octet cab is either 1 or 1. As such, each octet can have a decimal value of 0 to 255.

While working with IP addresses, it is necessary to understand binary to decimal as well as a decimal to binary conversions. The rule established above is following for each octet to get the decimal equivalent of a binary IP address
For example: 

Binary address: 01111111.  00001010.  00000010.  00010001 

Equivalent decimal address: 127.  10.   2.   17

IP version 4 Address Classes


The Internet Protocol system is divided into a well-specified hierarchy of five classes. Each class is created to accommodate a network of a specific size, and is represented by an alphabet from A to E. Each class differs in size of the network and the number of hosts it can accommodate. 

Classes A, B, and C are used for large, medium and small networks respectively. Classes D and E are not used in normal operations; Class D is used for Multicast, while Class E is reserved for experimental usage. 

The first octet of an IP Address (more specifically the three most significant bits of the octet) determines the class of the IP address as shown in the image below: 


Understand IP Address


In the Class-based IP addressing system mentioned above, many unused IP addresses were wasted as ISPs and large organizations reserved addresses that could not be shared. 

Thus, this addressing scheme is being used less and less after the introduction of Classless Inter-Domain Routing (CIDR), which is being adopted by the majority of networks. However, it is important to learn about the Class specifications to understand the IP addressing system. 

Host or Network? 

An IP address provides information about the Network ID and the Host ID of a client. Some parts of an IP address form its network ID (local area network, internet) while the rest is used to identify host devices (computer, printer). 

The network ID is used the rest is used to identify the host devices that are located within the same physical network. Hosts with same network ID are able to communicate and share information with each other. 

For each IP address class, the function of each octet can vary. In Class A, for example, the first octet is used for the network ID and the last three octets form the host ID. 

In Class B, the four octets are divided equally to form the network ID and the host ID. The first three octets make up the network ID in Class C, while the last one is the host ID. 


Understand IP Address


The network ID starting with 127 is reserved for internal loopback functions. Neither the network ID nor the host ID can contain all 1’s in the address as such address is reserved for the broadcast address. Similarly, the address containing all )’s is used to identify a specific host on the local network, and I not assigned to any device. 

The formula(2n – 2), where “n” is the number of bits in the address, is used to count the maximum number of network or host IDs that exist within a network. 

Class A Addresses 


In a Class A address, the first octet is the network ID and the rest of the three octets are used to assign host IDs. As such, Class A address can contain a large number of hosts. The most significant bit in a Class A address is always ‘0’. 

The addresses ‘0’ and ‘127’ are not used to assign networks IDs. This restricts the number of Class A networks to 126, while the number of hosts can be up to 16,777,214 per network (applying the formula mentioned in the previous section). 

The image shows the typical IP address and Subnet mask for Class A network. 


Understand IP Address


Class B Addresses 

In a Class B address, the first two octets form the network ID and the last two octets are used to assign host IDs. The first two bits in Class B address are always set to ‘1’ and ‘0’. This restricts the maximum number of networks to (214-2) = 16,384. 

The 16 bits of the last two octets, in turn, allows for a medium to large sized network with (216-2) = 65,534 hosts per network. The image shows the typical IP address and Subnet mask for a Class B network. 


Understand IP Address


Class C IP Addresses 


The First three octets in a Class C Address are used for network ID, while the final octet is used for host IDs. The three left-most bits in a Class C address are always set to ‘110’. 

This leaves 21bits for network ID and 8 bits for host ID, which allows a maximum of 2,097,152 networks and 254 hosts per network. Thus, Class C addresses are good for small networks with a limited number of hosts. 

The image shows the typical IP address and Subnet Mask for a Class C network. 


Understand IP Address


Summary of IP version 4 Classes used for PC Networks

Understand IP Address


The network address 0.0.0.0 is the placeholder for ‘no particular address’ and can mean “all IPv4 address on the local machine”. 

The network address 127.0.0.0 (host ID can be anything) is called the loopback address and is reserved for testing one’s own computer for hardware or software debugging. 

The network address 255.255.255.255 is used for broadcasting messages to the entire local network. 

Also, Read↔ What is Network Topology & Its Types?

There is also a host of private address within each class that is reserved for internal use by the company or home networks. 

These addresses are not supposed to be visible on the internet and most internet service providers (ISP) will block internet access to such addresses. This is useful if one needs to use a TCP/IP network, but does not intend to connect to the internet.


Understand IP Address


Subnet Mask

A Subnet is used to separate the flow of network traffic between hosts based on a network configuration, thereby improving security and performance. 

This process is called Subnetting. While the hosts within one network can communicate with each other freely, applying a Subnet allows network administrators more control in such communications between network hosts. 

It also allows organizations to put certain hosts with sensitive information within their local network on a different Subnet. 

As discussed earlier, an IP address has two parts, the network ID and the host ID. Usually, the two parts can be determined easily by looking at the class of the IP address

However, subnet further divides the host part of an IP address into a subnet and host address. A subnet mask can contain 32 bits (IPv4) or 128 bits (IPv6) and is visualized like an IP address with dots (.) separating each octet. However, a subnet mask does not work as an IP address


Understand IP Address


A subnet mask, like an IP address, has two parts. The left-most part contains 1’s while the right-most part contains 0’s. A valid subnet mask cannot be only 1’s or 0’s. To give an example, for a Class C IP address (like 192.168.1.0), the default subnet mask would be 255.255.255.0 (24-bit network address and 8-bit host address). 

To further divide this network into subnets, more than 24 bits need to be 1 on the left-most part of the address. Thus, if the 25th bit is changed to 1, it creates two subnets with a host address range from 192.168.1.1 to 192.168.1.127 and from 192.168.1.128 to 192.168.1.255. 

Following this rule, a two-bit subnet number splits the network into four extended networks and a three-bit subnet splits it into eight extended networks. 

During a communication attempt, the source host determines whether the destination whether the destination host is on the local network or a remote network by applying a subnet mask. This is done by performing a bitwise AND operation on the mask. 


Boolean Algebra 


Boolean Algebra is used to calculate binary variables like “true” and “false” or ‘1’ or ‘0’. The ANDing process that is used to determine subnet masks can have the following outcomes:
  • If the two compared values are both 1, the result is 1.
  • If one of the value is 0 and the other is 1, the result is 0.
  • If both of the compared values are 0, the result is 0.

A Trial Separation 

Following the process mentioned above, the source and destination host addresses are compared to determine whether the communication is meant for a local host or a remote host. If the two do not match, all communication is directed towards the remote host through the routing path, if one is set, or the default gateway of the source host. 

For instance, if two hosts A and B with the IP addresses 192.168.1.110 and 192.168.1.115 want to communicate, the calculation will be like this: 

A’s IP address in binary: 11000000.10101000.00000001.01100100 

A’s subnet mask is binary: 11111111.11111111.11111111.00000000 

B’s IP address in binary: 11000000.10101000.00000001.00000000 

B’s subnet mask in binary: 11111111.11111111.11111111.00000000 

ANDing Result: 11000000.10101000.00000001.00000000 

The two results match indicating that the two hosts are on the same network, and thus a remote communication is not necessary.                                                    
Make Money

Read Also:

Related Posts
Disqus Comments