IP Addressing

IP addressing is compulsory for the devices to communicate over the internet. Internet protocol (IP) provides a unique address that identifies the local network. Every internet-connected device has a unique IP address.  The Internet-assigned Numbers Authority (IANA) assigns IP addresses to computer networks to ensure no two networks share the same IP network address.

Keeping in mind: MAC, the address provides the physical address for the network interface card. It does not provide information about the location of its network.

Versions of IP Addressing

IP addresses are categorized into two versions: IPv4 and IPv6.  IPv4 is the current TCP/IP addressing technique being used on the internet.

IPv4 is quickly running out due to the rapid growth of the internet. However, both IPv4 and IPv6 are supported by manufacturers of networking devices and Operating systems.

IPv4 Addressing

 IPv4 addressing is the current TCP/IP technique being used on the internet.  IPv4 is considered a 32-bit number. IPv4 is divided into 4 binary octets.  AS computers understand the binary code, an Example of IP in binary is given below

11011000.00011011.00111101.10001001

This representation of IP in decimal is given below

216.27.61.137

Each octet can represent any value from 0 to 255 (28=256). A combination of four octets gives 232 (4,294, 967, 296) unique values.

Some certain values are restricted from use as typical IP addresses. For example, the IP address 0.0.0.0 is reserved for the default network, and the address 255.255.255.255 is used for broadcasts.

NET ID and HOST ID

The NET ID and HOST ID are used to find the exact device over any network. Some of the octets’ IP addresses represent the Net ID, and the remaining octets represent the Host ID.

NET ID: Net ID always contains the same first octets. It is used to identify the network in which a computer exists.

Host ID: The host section always contains the least significant octet. It identifies the actual computer in the network.

IPv6 Addressing

The IPv4 is running out, as is the growth of the internet. IPv6 comes into the picture; it uses 128-bit address techniques as compared to 32-bit IPv4.

IPv6 provides (2128) unique IP addresses.  It is doted in hexadecimal instead of decimal,  as given below.

6789.ABCD.1234.EF92. 6789.ABCD.1234.EF92

IPv6 may be unicast, multicast, or any cast.

Classes of IP address

There are five classes of IP addresses: A, B, C, D, and E. Two hosts are reserved for every class.

For Network Identification, The Leading 1-bit (0) of class A, The Leading 2-bit (10) of class B, The Leading 3-bit (110) of class C, The Leading 4-bit (1110) of Class D, and The Leading 4-bit (1111) of class E are fixed.

Class A

The first octet (8-bits) represents the network ID, and the remaining 3-outer (24-bits) represents the host ID. The first leading bit of network ID in Class A is always 0 (zero), and the remaining 7 bits (0-127) represent network ID.

  • Format: 0NNNNNNN.HHHHHHHH.HHHHHHHH.HHHHHHHH (in binary)
  • Start to End Address = (0.0.0.0 to 127.255.255.255)
  • Value of first octet = 0 – 127
  • Possible network ID = (27) = 128

Important Note: Network ID 0 is reserved for the default network, and Network ID 127 is reserved for loopback IP addresses. So, the remaining 126 (1-126) network IDs are used.

  • Possible Hosts = (224-2) = 16777214
  • Total number of possible IP addresses = (231) = 2,147,483,648 (1 out of 32 bit is leading bit)
  • Subnet Mask = 255.0.0.0

An example of a Class A IP address is given below

Network ID Host ID
115. 24.53.107

Class B

The first two octets (16 bits) represent the network ID, and the remaining 2-outer (16 bits) represent the host ID. The first two leading bits of network ID in Class B are always (10), and the remaining 14 bits represent network ID.

  • Format: 10NNNNNN. NNNNNNNN.HHHHHHHH.HHHHHHHH (in binary)
  • Start to End Address IP addresses = (128.0.0.0 to 191.255.255.255) (in hexadecimal)
  • Value of first octet = (10000000 – 10111111) = 128 – 191
  • Possible network ID = (214) = 16384
  • Possible Hosts = (216-2) = 65534
  • Possible Total number of IP addresses = (230) = (2 out of 32 bit is leading bit)
  • Subnet Mask = 255.255.0.0

Example:

Network ID Host ID
145.24. 53.107

Class C

The first three octets (24 bits) represent the network ID, and the remaining 1 octet (8 bits) represent the host ID. The first three leading bits of network ID in Class B are always (110), and the remaining 21 bits represent network ID.

  • Format: 110NNNNN. NNNNNNNN. NNNNNNNN.HHHHHHHH (in binary)
  • Start to End Address IP addresses = (192.0.0.0 to 223.255.255.255) (in hexadecimal)
  • Value of first octet = (11000000 – 11011111) = 192 – 223
  • Possible network ID = (221) = 2097152
  • Possible Hosts = (28-2) = 254
  • Possible Total number of IP addresses = (229) = (3 out of 32 bit is leading bit)
  • Subnet Mask = 255.255.2555.0

Example:

Network ID Host ID
145.24.53 107

Class D

Class D is used for multicasts. Multicasting is used to pass the copies of the datagram to selected groups of hosts instead of individual hosts.

Class D is slightly different from the first three classes.

The first four leading bits of network ID in Class D are always (1110), and the remaining 28 bits represent a group of computers where the multicast message will be passed.

  • Format: 1110mmmm.mmmmmmmm.mmmmmmmm.mmmmmmmm (in binary)
  • Start to End Address IP addresses = (224.0.0.0 to 247.255.255.255) (in hexadecimal)
  • Value of first octet = (11100000 – 11101111) = 224 – 247
  • Possible Total number of IP addresses = (228) = (4 out of 32 bit is leading bit)
  • Subnet Mask, Network ID, and Host ID are not defined

Example:  Value of the first octet in range (224-247)

224.24.53.107

Class E

Class D is used for Experimental purposes only. Class E is a different class from the first three classes. The first four leading bits of network ID in Class D are always (1111), and the remaining 28 bits represent a group of computers where the multicast message will be passed.

  • Format: 1111rrrr. rrrrrrrr. rrrrrrrr. rrrrrrrr (in binary)
  • Start to End Address IP addresses = (248.0.0.0 to 255.255.255.255) (in hexadecimal)
  • Value of first octet = (11110000 – 11111111) = 248 – 255)
  • Possible Total number of IP addresses = (228) = (4 out of 32 bit is leading bit)
  • Subnet Mask, Network ID, and Host ID are not defined

Example:  Value of the first octet in range (248-255)

248.24.53.107

                                                                                                                                 Broadcasting: Sending a message to all computers connected to the network is called broadcasting. It is always done through the 255.255.255.255 IP address.