IP Address
What is an IP Address?
An IP address (Internet Protocol address) is a unique identifier assigned to each device on a network. It allows devices to communicate with each other over a network, such as the internet or a local network (LAN). An IP address functions similarly to a phone number or home address, enabling data to be sent to the correct destination.
Types of IP Addresses
There are two main types of IP addresses:
IPv4 (Internet Protocol version 4):
- IPv4 is the most widely used IP address version.
- It consists of 32 bits (4 bytes), which are divided into four octets, each ranging from 0 to 255.
- Example:
192.168.1.1
IPv6 (Internet Protocol version 6):
- IPv6 is designed to address the limitations of IPv4, such as the exhaustion of available IP addresses.
- It consists of 128 bits, represented as eight groups of four hexadecimal digits.
- Example:
2001:0db8:85a3:0000:0000:8a2e:0370:7334
While IPv4 is still the most commonly used version, IPv6 adoption is increasing as the number of devices on the internet grows and the pool of IPv4 addresses becomes exhausted.
Classes of IPv4 Addresses
IPv4 addresses are categorized into different classes based on their range, and each class serves different purposes (e.g., public, private, reserved). There are 5 main classes of IPv4 addresses: A, B, C, D, E.
1. Class A (Large Networks)
- Range:
1.0.0.0to127.255.255.255 - Subnet Mask:
255.0.0.0(or/8prefix) - First Octet: Starts with
0to127 - Purpose: Class A addresses are typically used for large networks with a very large number of hosts (millions).
- Private Range:
10.0.0.0to10.255.255.255
2. Class B (Medium Networks)
- Range:
128.0.0.0to191.255.255.255 - Subnet Mask:
255.255.0.0(or/16prefix) - First Octet: Starts with
128to191 - Purpose: Class B addresses are used for medium-sized networks (e.g., mid-sized businesses, large organizations).
- Private Range:
172.16.0.0to172.31.255.255
3. Class C (Small Networks)
- Range:
192.0.0.0to223.255.255.255 - Subnet Mask:
255.255.255.0(or/24prefix) - First Octet: Starts with
192to223 - Purpose: Class C addresses are used for smaller networks (e.g., home or small office networks).
- Private Range:
192.168.0.0to192.168.255.255
4. Class D (Multicast Addresses)
- Range:
224.0.0.0to239.255.255.255 - Purpose: Class D addresses are used for multicasting, where data is sent to multiple receivers at once, not individual devices.
- Note: These are not assigned to individual hosts, so they aren’t used for standard device communication.
5. Class E (Reserved for Experimental or Future Use)
- Range:
240.0.0.0to255.255.255.255 - Purpose: Class E addresses are reserved for experimental or future use. They are not used in public or private networking.
Private IP Address Ranges
Private IP addresses are reserved for use within private networks (LANs) and cannot be routed on the internet. These are commonly used in home and business networks.
Here are the private IP address ranges:
- Class A Private Range:
10.0.0.0to10.255.255.255 - Class B Private Range:
172.16.0.0to172.31.255.255 - Class C Private Range:
192.168.0.0to192.168.255.255
Devices using private IP addresses can access the internet through a Network Address Translation (NAT) service, typically provided by a router.
Special IP Address Ranges
Loopback Address (for testing):
- Range:
127.0.0.0to127.255.255.255 - This range is reserved for loopback addresses, and the most commonly used loopback address is
127.0.0.1. It is used to test network interfaces locally.
- Range:
Link-Local Addresses (self-assigned for local communication):
- Range:
169.254.0.0to169.254.255.255 - These addresses are used by devices to communicate with each other on the same local network segment when they cannot obtain a valid IP address via DHCP.
- Range:
Broadcast Address (all devices on a network):
- The broadcast address for any subnet allows a device to send a message to all devices on that network. For example, for a network
192.168.1.0/24, the broadcast address is192.168.1.255.
- The broadcast address for any subnet allows a device to send a message to all devices on that network. For example, for a network
IP Address Ranges
1. IPv4 Address Ranges:
Here’s a summary of the range and purpose of each class:
| Class | Range | Subnet Mask | First Octet | Use Case |
|---|---|---|---|---|
| Class A | 1.0.0.0 – 127.255.255.255 | 255.0.0.0 | 1-127 | Large networks (millions of hosts) |
| Class B | 128.0.0.0 – 191.255.255.255 | 255.255.0.0 | 128-191 | Medium-sized networks |
| Class C | 192.0.0.0 – 223.255.255.255 | 255.255.255.0 | 192-223 | Small networks |
| Class D | 224.0.0.0 – 239.255.255.255 | N/A | 224-239 | Multicast addresses |
| Class E | 240.0.0.0 – 255.255.255.255 | N/A | 240-255 | Reserved for experimental use |
2. IPv6 Address Ranges:
IPv6 addresses are written in hexadecimal format and can be split into several parts (such as Global Unicast, Link-local, and Multicast). The ranges for the most common types are:
- Global Unicast Address (Public Internet address):
- Range:
2000::/3
- Range:
- Link-Local Address (Used for local network communication):
- Range:
FE80::/10
- Range:
- Multicast Address:
- Range:
FF00::/8
- Range:
Summary of Key Points:
- IP addresses are unique identifiers for devices on a network, used for communication.
- IPv4 uses 32 bits and is written in decimal format (e.g.,
192.168.1.1), while IPv6 uses 128 bits and is written in hexadecimal (e.g.,2001:0db8:85a3::8a2e:0370:7334). - IP Address Classes (A, B, C, D, E) define ranges of addresses, each for different use cases (large, medium, small networks, multicast, experimental).
- Private IP Ranges are reserved for internal use within local networks and include ranges like
10.0.0.0/8(Class A),172.16.0.0/12(Class B), and192.168.0.0/16(Class C). - Special Ranges include loopback (
127.x.x.x), link-local (169.254.x.x), and broadcast addresses.
Understanding IP address classes and ranges is fundamental when designing and configuring networks.
Introduction
The Internet has changed the way we communicate, access information, and share data. With the help of the Internet, one can connect with people as well as devices all over the world, regardless of physical distance or location. But the question that arises now is, how do devices identify each other and communicate? The answer is IP address.
IP addresses are numerical labels assigned to each device that wants to connect to the Internet. Some of the examples of such devices are computers, smartphones, routers, etc. In this blog, we will explain what is IP address, different types of IP addresses in networking, and different versions of IP addresses. Let’s first understand what an IP address is.
What is an IP Address?
IP stands for Internet Protocol, and it is a set of rules that governs how data is transmitted over the Internet. An IP address is a 32-bit or 128-bit number that uniquely identifies a device on the Internet. An IP address consists of four or eight groups of binary digits separated by dots or colons. For example, 192.168.1.1 or 2001:db8::1 are valid IP addresses.
An IP address serves two main functions:
- Host Identification: Host identification means that an IP address can uniquely identify a specific device (or host) on a network.
- Location Addressing: Location addressing means that an IP address can specify the logical or physical location of a device on a network.
An IP address is assigned to a device by a DHCP server, which is a software program that manages the distribution of IP addresses on a network. A DHCP server can assign an IP address dynamically (meaning it can change over time) or statically (meaning it remains fixed).
How are IP Addresses Generated?
IP addresses are generated with the help of a specific system in order to ensure the unique identification of devices on the Internet. The process begins with the IANA, also known as Internet Assigned Numbers Authority. It is responsible for allocating a range of IP addresses to RIRs (Regional Internet Registries). RIRs mainly manage the IP addresses for specific regions. After this, the main task of RIRs is to allocate IP addresses to ISPs (Internet Service Providers). ISPs finally assign the IP addresses to their customers.
When the device connects to the Internet, the ISP’s DHCP or Dynamic Host Configuration Protocol server assigns an available IP address from its pool. This IP address is a combination of four numbers separated by dots ranging from 0 to 255. One such example of the IP address is 192.0.2.1.
Now, you must be curious about how IP addresses work. Let us understand in detail.
IP Address Working
With the help of IP addresses, it is now possible to send as well as receive data over the Internet which in return allows devices to communicate with one another worldwide. An IP address is a unique identifier assigned to every single device that is connected to the Internet.
Now, the process begins when a device sends a request to access a website or a server. This request is directed to a DNS, which then translates the website’s domain name into the corresponding IP address.
Mainly, there are two IP addresses i.e., IPv4 (32-bit addresses) and IPv6 (128-bit addresses). When a request is sent, the IP address is used in order to identify the destination device, and data is routed through the internet backbone (a network of high-speed connections) to reach the intended device. Once the data reaches the destination, the IP address ensures it is delivered to the correct device, allowing the requested data to be displayed on the user’s screen.
Now we have a basic understanding of IP addresses, let’s discuss different IP address types.
Types of IP Address
There are different types of IP address based on their scope, allocation, and usage. We have classified IP addresses into three categories, i.e., Consumer IP addresses, Website IP addresses, and IP addresses based on Operational characteristics. Let’s Begin!
Consumer IP Addresses
Consumer IP addresses are those users who utilize the Internet. These can be public or private. Private IP addresses can be used within a network, whereas public IP addresses are utilized outside a network. Below, we have explained with the help of an image.
Public IP Address
A public IP address is an IP address that can be accessed from any device on the Internet. It is also called a primary address or an external address. A public IP address is unique and can be used to locate and identify a device on the Internet. A public IP address is assigned to your router by your Internet Service Provider (ISP). Your router then uses a technique called Network Address Translation (NAT) to share this public IP address with all the devices connected to your home network.
For example, if you visit What is my IP, you will see your public IP address displayed on the screen. This is the same IP address that other websites or servers see when you access them from your browser.
Public IP addresses can be further classified into static and dynamic IP addresses. Let’s understand both these IP addresses in detail.
- Static IP Address
A static IP address is an IP address that does not change over time. It is manually configured by the user or the network administrator and remains fixed until it is changed again. Static IP addresses are usually used for devices that need to be easily identifiable or accessible on a network, such as servers, printers, cameras, or routers. Let’s take an example for better understanding.
For example, if you want to set up a web server on your home network, you might assign it a static IP address like 192.168.1.100. This way, you can always access it from any device on your network using this address.
- Dynamic IP address
A dynamic IP address is an IP address that changes periodically. It is automatically assigned by a DHCP server based on the availability of addresses on the network. Dynamic IP addresses are more common than static ones because they are easier to manage and more efficient in terms of resource utilization. Let’s take an example.
For example, if you connect your laptop to a public Wi-Fi network at a coffee shop, you will receive a dynamic IP address from the DHCP server of that network. This IP address will be valid only for the duration of your connection and will be released when you disconnect.
Website IP Addresses
A website IP address is an IP address that is associated with a website or a domain name. A website IP address can be either dedicated or shared. Let’s understand both of these protocols in detail.
Dedicated IP Address
A dedicated IP address is an IP address that is exclusively assigned to a single website or domain. It means that no other website or domain can use the same IP address. Dedicated IP addresses are usually more expensive and less common than shared ones. They are mainly used for websites that need higher security, performance, or reliability, such as e-commerce sites, online banking sites, or email servers.
For example, if you visit https://www.pynetlabs.com/, you will see that it has a dedicated IP address of 172.67.172.178. This means that only pynetlabs.com can use this IP address, and no other website can share it.
Shared IP Address
A shared IP address is an IP address that is shared by multiple websites or domains. It means that several websites or domains can use the same IP address. Shared IP addresses are usually cheaper and more common than dedicated ones. They are mainly used for websites that do not have high requirements for security, performance, or reliability, such as blogs, forums, or personal sites.
These are the two Website IP Address Types. Now, let’s move on to the last one in the list of types of IP Address.
IP Addresses Based on Operational Characteristics
There are four types of IP addresses based on their operational characteristics: unicast, multicast, anycast, and broadcast.
Unicast IP Address
A unicast IP address is an IP address that is used for one-to-one communication between a sender and a receiver. It means that a packet sent from a source device to a destination device with a unicast IP address will be delivered to that specific device only. Unicast IP addresses are the most common type of IP address on the Internet.
For example, when you send an email to someone, you use their unicast IP address to deliver the message to their inbox.
Multicast IP Address
A multicast IP address is an IP address that is used for one-to-many communication between a sender and multiple receivers. It means that a packet sent from a source device to a destination device with a multicast IP address will be delivered to all the devices that have joined the multicast group associated with that address. Multicast IP addresses are mainly used for streaming media, video conferencing, or online gaming.
For example, when you watch a live video on YouTube, you use a multicast IP address to receive the stream from the server along with many other viewers.
Broadcast IP Address
A broadcast IP address is an IP address that is used for one-to-all communication between a sender and all the receivers on a network. It means that a packet sent from a source device to a destination device with a broadcast IP address will be delivered to every device on the network regardless of their individual addresses. Broadcast IP addresses are mainly used for network discovery, configuration, or maintenance.
For example, when you connect your printer to your home network, you use a broadcast IP address to announce its presence and request an IP address from the DHCP server. Learn the difference between Multicast and Broadcast.
Anycast IP Address
This address is used for a specific group of devices where the data is sent to the closest or most appropriate device within the group. It’s often used for content delivery networks (CDNs) to ensure users access content from the nearest server.
For example, imagine sending a package with multiple potential delivery points, and the closest one gets the delivery.
These are the four types of IP Addresses Based on Operational Characteristics. Let’s now look at the different versions of IP addresses.
Versions of IP Address
IP addresses can also be classified based on their versions or formats. There are two versions of IP address: IPv4 and IPv6.
IPv4
IPv4 stands for Internet Protocol version 4. It is the first and most widely used version of the IP address. It has a 32-bit address space, which means it can support up to 4.3 billion (2^32) unique addresses. However, due to the rapid growth of the Internet and the depletion of available addresses, IPv4 is insufficient to meet the network’s current and future demands. IPv4 addresses are written in decimal notation, which consists of four numbers separated by dots, such as 192.168.1.32. Each number can range from 0 to 255.
IPv6
IPv6 stands for Internet Protocol version 6. It is the latest and most advanced version of an IP address. It has a 128-bit address space, which means it can support up to 340 undecillion (2^128) unique addresses. This is enough to assign an IP address to every atom on Earth and still have plenty left over. IPv6 is designed to overcome the limitations of IPv4 and provide enhanced features such as security, mobility, and scalability.
Below, we have shown both the IPv4 and IPv6 IP addresses with the help of an image.
Private (internal) IP addresses aren’t routed on the Internet, they never leave the local network, and no traffic can be exchanged using private IP addresses. Private IP addresses within the same local network must be unique.
Users cannot access the Internet directly from a private IP address but must route the connection through NAT,
which replaces the private IP address with a public one. Thus, NAT hides the private IP, increasing network security.
Private IP Ranges
*****************
Class A. Ranging from 10.0.0.0 to 10.255.255.255, it is for large networks and has 8 bits for the network and 24 for hosts.
Class B. Ranging from 172.16.0.0 to 172.31.255.255, it is used for medium networks and has 16 bits for the network and 16 for hosts.
Class C. Ranging from 192.168.0.0 to 192.168.255.255, it is for smaller networks and has 24 bits for the network and 8 for hosts.
Overview
********
32-bit address length: Allows for approximately 4.3 billion unique addresses.Limited Address Space :
IPv4 has a limited number of addresses, which is not enough for the growing number of devices connecting to the internet.
In the IPv4 IP address space, there are five classes: A, B, C, D and E.
Each class has a specific range of IP addresses (and ultimately dictates the number of devices you can have on your network).
Primarily, class A, B, and C are used by the majority of devices on the Internet. Class D and class E are for special uses.
Class A Public & Private IP Address Range
**************************************
Class A Public & Private IP Address Range
Class A addresses are for networks with large number of total hosts. Class A allows for 126 networks by using the first
octet for the network ID. The first bit in this octet, is always zero. The remaining seven bits in this octet complete the network ID. The 24 bits in the remaining three octets represent the hosts ID and allows for approximately 17 million hosts per network. Class A network number values begin at 1 and end at 127.
Public IP Range: 1.0.0.0 to 127.0.0.0
First octet value range from 1 to 127
Private IP Range: 10.0.0.0 to 10.255.255.255 (See Private IP Addresses below for more information)
Subnet Mask: 255.0.0.0 (8 bits)
Number of Networks: 126
Number of Hosts per Network: 16,777,214
Class B Public & Private IP Address Range
*******************************
Class B addresses are for medium to large sized networks. Class B allows for 16,384 networks by using the first two octets for the network ID. The first two bits in the first octet are always 1 0. The remaining six bits, together with the second octet, complete the network ID. The 16 bits in the third and fourth octet represent host ID and allows for approximately 65,000 hosts per network. Class B network number values begin at 128 and end at 191.
Public IP Range: 128.0.0.0 to 191.255.0.0
First octet value range from 128 to 191
Private IP Range: 172.16.0.0 to 172.31.255.255 (See Private IP Addresses below for more information)
Subnet Mask: 255.255.0.0 (16 bits)
Number of Networks: 16,382
Number of Hosts per Network: 65,534
Class C Public & Private IP Address Range
**************************************
Class C addresses are used in small local area networks (LANs). Class C allows for approximately 2 million networks by using the first three octets for the network ID. In a class C IP address, the first three bits of the first octet are always 1 1 0. And the remaining 21 bits of first three octets complete the network ID. The last octet (8 bits) represent the host ID and allows for 254 hosts per network. Class C network number values begins at 192 and end at 223.
Public IP Range: 192.0.0.0 to 223.255.255.0
First octet value range from 192 to 223
Private IP Range: 192.168.0.0 to 192.168.255.255 (See Private IP Addresses below for more information)
Special IP Range: 127.0.0.1 to 127.255.255.255 (See Special IP Addresses below for more information)
Subnet Mask: 255.255.255.0 (24 bits)
Number of Networks: 2,097,150
Number of Hosts per Network: 254
Class D IP Address Range
************************
Class D IP addresses are not allocated to hosts and are used for multicasting. Multicasting allows a single host to send a single stream of data to thousands of hosts across the Internet at the same time. It is often used for audio and video streaming, such as IP-based cable TV networks. Another example is the delivery of real-time stock market data from one source to many brokerage companies.
Range: 224.0.0.0 to 239.255.255.255
First octet value range from 224 to 239
Number of Networks: N/A
Number of Hosts per Network: Multicasting
Class E IP Address Class
************************
Class E IP addresses are not allocated to hosts and are not available for general use. These are reserved for research purposes.
Range: 240.0.0.0 to 255.255.255.255
First octet value range from 240 to 255
Number of Networks: N/A
Number of Hosts per Network: Research/Reserved/Experimental
IP Address Security Threats
There are different types of risks as well as vulnerabilities associated with IP addresses. There are many ways by which one can know your IP address, and after that can cause damage to your system and resources. Some of these are:
- Online Stalking
- Tracking down the location
- Downloading Illegal content
- Social Engineering, and many more.
Once the hacker gets your IP address, it is now easy for them to carry out various IP address attacks. Below, we have explained the detailed explanation in the image.
IP Spoofing
It is the most common IP address security threat. Hackers can fake their IP address in order to impersonate a trustworthy source. This allows them a free pathway to access sensitive information.
DoS Attacks
In such types of threats, attacks can overwhelm a network as well as websites with traffic from multiple IP addresses. This will cause the network or website to crash.
IP Address Hijacking
Attackers can hijack IP addresses in order to redirect users to malicious websites or steal sensitive information.
BGP Hijacking
Hackers can hijack BGP (Border Gateway Protocol) routes to redirect internet traffic. This allows them to steal sensitive information or inject malware.
DDNS Abuse
Hackers can exploit vulnerabilities in DDNS (Dynamic DNS) systems to redirect users to malicious websites or steal sensitive information.
MITM Attacks
MITM is also known as a Man-in-the- middle attack. In such attacks, Hackers can intercept and alter communication between two parties, using their own IP addresses to eavesdrop and steal sensitive data.
IP Address Security Threats
When you use the internet, your device is assigned an Internet Protocol (IP) address, which can reveal your location and identity. To protect your privacy, you can hide your IP address. Below, we have discussed two ways by which you can protect as well hide your IP address.
VPN (Virtual Private Network)
One way to do this is by using a VPN. A VPN creates a secure connection between your device and a VPN server, making it seem like your internet traffic is coming from the VPN server’s IP address instead of your own. This way, your true IP address remains hidden.
Proxy Server
Another way to hide your IP address is by using proxy servers or the Tor network, which also redirects your internet traffic through a third-party server, masking your IP address.
This is how you can protect your IP Address. Now, we have everything related to IP Address and all Types of IP Address.
IPv6
Global IPv6 Address
2001:1234:0000:0000:0000:0000:0000:1010/64
To Short IP Address
2001:1234::1010/64
Link Local IP Address For Private IP
FE80:0000:0000:0000:0000:200:CFF:FE0A:C1D2
To Short IP Address
FE80::200:CFF:FE0A:C1D2
Full IPv6 Address (Big Form)
2001:0db8:0000:0000:0000:ff00:0042:8329
Shortening Rules
Rule 1: Remove Leading Zeros
Each block of 4 hex digits can drop leading zeros.
2001:0db8:0000:0000:0000:ff00:0042:8329
→ 2001:db8:0:0:0:ff00:42:8329
Rule 2: Use Double Colon (::)
A single sequence of consecutive zero blocks can be replaced with ::
Example:
2001:db8:0:0:0:ff00:42:8329
→ 2001:db8::ff00:42:8329
Shortest Form (Smallest Representation)
So the final shortest form of our example is
2001:db8::ff00:42:8329
Big form: 2001:0db8:0000:0000:0000:ff00:0042:8329
Short form: 2001:db8::ff00:42:8329