INTERNET PROTOCOL: Ip address is a layer 3 protocol in OSI layer which is used for the communication between electronics devices for transferring information over the internet. IP address stands for Internet Protocol. For example, if a computer or an electronic device wants to communicate with the outside world it needs an IP address.
In the present world IP addresses are generated by an algorithm by the Internet of Assigned Numbers Authority (IANA). ISP (Internet Service Providers) who distributes these IP addresses to geographically assigned by IANA and DHCP protocol allocates these IP addresses to the locally connected devices over the WIFI network. There are 2 versions of IP addresses IPv4 and IPv6. IPv4 is a 32-bit binary digit and for human understanding it is represented in decimal format (e.g., 192.168.0.5). IPv6 is 128-bit address representing in 32-bit hexa-decimal (16 digit) format (e.g., 2001:0db8:85a3:0000:0000:8a2e:0370:7334). [1] Hexa-decimal conversion:
0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 |
0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | A | B | C | D | E | F |
In hexa-decimal the maximum number is F which means 15 in decimal digit and lowest is 0 which mean 0 in digital. Here are some examples for hexa-decimal conversion to decimal.
Hexa-decimal | Decimal |
19 | 25 |
FB82 | 64386 |
Conversion from Hexa-decimal to Decimal:
There are four types of IP addresses public, private, static and dynamic. Public IP is used to communicate outside world whereas private for inside the organization or company. Static IP is a fixed IP address and dynamic IP may change for every re connection.
IPv4 classful address: IPv4 is a 32-bit internet protocol version 4 in binary digit format. Ip address uses on network interface to identify a device uniquely over the internet. Format for IPv4 is looks like below
1100 0000 1010 1000 0000 1010 0110 0100
192 168 10 100
IPv4 divides into 4 sets of octets which are in binary digits 0 &1. Range of an octet is 0 to 255. Based on this range divided into 5 class full IP addresses. And has 2 portions network portion and host portion.
Class | Range | No. of network bits | No. of host bits/ hosts |
A | 0-127 | 8 | 24 / 16,777,214 |
B | 128-191 | 16 | 16 / 65,536 |
C | 192-223 | 24 | 8 / 254 |
D | 224-239 | Not defined | Not defined |
D | 240-255 | Not defined | Not defined |
[2]
[3]
Class A: Class A has 8 bits of network portions and 24 bits for host portion. In total there will be 16,777,214 hosts per subnet in class A. e.g., 121.0.24.224
Class B: In class B, 16 bits for network and 16 for host portions which we get 65536 hosts per subnet. E.g., 132.5.24.55
Class C: Class C has 24 bits for network and 8 for host portion. In total we get 254 hosts per subnet. E.g., 195.56.45.4
Class D: Class D range is from 224.0.0.0 – 239.255.255.255. It is reserved for multi-casting purpose. E.g., 235.23.46.68
Class E: Class E ranges from 240.0.0.0 to 255.255.255.254. Class E is reserved for experimental and research purposes. E.g., 245.45.67.89 [2]
Range of special IP addresses
169.254.0.0 – 169.254.0.16 link-local addresses
127.0.0.0 – 127.255.255.255 loop-back addresses
0.0.0.0 – 0.0.0.8 used to communicate within the current network.
Rules for assigning host and network:
- Host ID must be unique in any network.
- Host ID cannot be assigned all 0’s as to that of IP address because it uses for network ID.
- Host &network ID cannot be assigned all 1’s because it uses for broadcast address.
- Network ID cannot start with 127. It reserved for link-local address. [2]
Private IP addresses: Private IP addresses used to assign local devices with in the network to communicate to other devices in the local network.
Private IP address ranges are: 10.0.0.0 – 10.255.255.255
172.16.0.0 – 172.31.255.255
192.168.0.0 – 192.168.255.255
In class A and B while assigning the Ip addresses, millions of Ip addresses are being wasted. To solve this problem CIDR (classless Inter-domain routing) being introduced. Example there are 100 devices which needs Ip addresses in class A. In class full Class A Ip address range each sub net has 16,777,216 addresses where as we need only 100. So, rest will be wasted. But, in CIDR we can reduced the greatest number of Ip address wastage. [2]
CIDR (Classless Inter-domain Routing): It is a method for efficient use of Ip addresses routed based on network prefix rather than network class. CIDR uses slash / notation to represent prefix. E.g., 124.28.34.0/24. Advantages: Better Routing of IP packets, efficient use of IP addresses, IP addresses allocation flexibility. [4] A company needs 100 IP addresses in class A range. By using CIDR we can allocate 100 IP addresses and minimize the maximum number of IP address wastage. By using last 7 bits in host portion, we can allocate the 100 Ip addresses. e.g.: 10.25.0.0 /25
First Ip 10.25.0.0/25 uses for network notation purpose and last Ip address 10.25.0.127/25 is for broadcast.
DHCP Server: Dynamic host configuration protocol is a network server which automatically assigns the Ip address to client devices. It assigns IP address, default gateway and other network parameters. [5] DHCP works on 4-way handshake process called DORA (Discovery, Offer, Request and Acknowledgment).
[6]
DHCP Discover is the first step in DORA process, when we start the device, it tries to discover the DHCP server for Ip address. Then DHCP server offers an IP address for the client device. A request comes to DHCP server from client as a DHCP request for accepting the IP address. Finally, DHCP server acknowledges that request.
[6]
Do not have IP before | Have an IP before | |
Discover | Client broadcast message | Broadcast |
Offer | DHCP-server broadcast message | Unicast |
Request | Client broadcast message | Broadcast |
Acknowledgment | DHCP server broadcast message | unicast |
[7] The world is now running out of IPv4 addresses. So, the networking industry has been shifting slowly towards IPv6 addresses which is 128-bit long enough to generate more than enough number of Ip addresses which is equal to 2 power 128 = [8]. [9]
References
[1] | C. MITCHELL, 29 09 2023. [Online]. Available: https://www.investopedia.com/terms/i/ip-address.asp. [Accessed 30 03 2024]. |
[2] | “GeeksforKeeks,” [Online]. Available: https://www.geeksforgeeks.org/introduction-of-classful-ip-addressing/. [Accessed 30 03 2024]. |
[3] | “computernetworkingnotes,” [Online]. Available: https://www.computernetworkingnotes.com/networking-tutorials/ip-address-classes-explained-with-examples.html. [Accessed 30 03 2024]. |
[4] | “geeksforgeeks,” [Online]. Available: https://www.geeksforgeeks.org/classless-inter-domain-routing-cidr/. [Accessed 02 04 2024]. |
[5] | “infoblox,” [Online]. Available: https://www.infoblox.com/glossary/dhcp-server/. [Accessed 02 04 2024]. |
[6] | “ComputerNetworkingNotes,” [Online]. Available: https://www.computernetworkingnotes.com/ccna-study-guide/how-dhcp-works-explained-with-examples.html. [Accessed 02 04 2024]. |
[7] | “cisco,” [Online]. Available: https://learningnetwork.cisco.com/s/question/0D53i00000Kt3m4CAB/dhcp-process-unicast-vs-broadcast. [Accessed 02 04 2024]. |
[8] | “wolframalpha,” [Online]. Available: https://www.wolframalpha.com/input/?i=2%5E128. [Accessed 02 04 2024]. |
[9] | “tech advisor,” [Online]. Available: https://www.techadvisor.com/article/739772/what-is-ipv6-and-do-i-need-it.html. [Accessed 02 04 2024]. |
[10] | “study-ccna,” [Online]. Available: https://study-ccna.com/what-is-ipv4-address/. [Accessed 30 03 2024]. |