All you need to know about IPv4 and IPv6 addresses ! (CCNA Training)
What is an IP address? IP address stands for Internet Protocol Address.
What is it? Like humans are given names — Kumar, Paul, Mr. Smith and so on, devices like laptops and computers are given names called an ‘IP address.’ An IP address is used to identify a device like a computer or a laptop in a network. It is a unique string of numbers separated by periods — IPv4 or colons — IPv6 that identifies each device connected to a network, including the internet.
What is a network? Networks can be physical or virtual. They are interconnected computers and devices that share resources and information. Examples include local area networks (LANs), wide area networks (WANs), and the internet.
Let us go back to IP addresses.
Maybe you got an idea of what is an IP address. (WIFI stands for Wireless Fidelity.)
What are the differences between IPv4 and IPv6 addresses?
Both IPv4 and IPv6 are protocols used to uniquely identify devices on a network. However, they differ significantly in terms of address space and structure.
IPv4: Uses a 32-bit address space, typically expressed in decimal format (e.g., 192.168.0.1). There are about 4.3 billion unique addresses in total.
IPv6: Uses a 128-bit address space, expressed in hexadecimal (e.g., 2001:0db8:85a3:0000:0000:8a2e:0370:7334). This allows for 340 undecillion unique addresses.
An IPv6 address was designed to solve IPv4 address exhaustion with a vastly larger address pool, ensuring the availability of addresses for the foreseeable future. Let us look at some examples.
There are Public IPV4 addresses and there are private IPv4 addresses as well. Public IPV4 addresses cannot be used by us as they belong to certain companies/organizations.
Public IPv4 addresses (used on the internet):
- 8.8.8.8 (Google DNS server)
- 172.217.3.110 (a Google web server)
- 157.240.22.35 (a Facebook server)
Whereas, Private IPv4 addresses are used on local networks by most of the population.
- 192.168.1.1 is a common default address for home routers.
- 10.0.0.1 is used by some routers in local networks.
- 172.16.0.1 is private address range in many organizations.
DNS stands for ‘Domain Name System. Domain Name System (DNS) is a naming system for computers, networks, and services on the Internet. It translates human-readable domain names into machine-readable IP addresses like (142.250.195.142). So, instead of typing in an IP address like (172.217.3.110) you can type a domain name like www.google.com. This makes it easier for humans to navigate the web without having to remember complex numerical strings. Therefore, a Domain Name System (DNS) translates human-readable domain names into the corresponding IP addresses that computers understand and serves you the landing page of a particular website/portal/blog.
The primary difference between a domain name and an IP address lies in their function and representation on the internet. Here is how they differ.
Domain Name: A domain name is a human-readable label used to access websites. It serves as a convenient alias for the underlying IP address, making it easier for people to remember and use.
Example: www.flipkart.com
IP Address: An IP address is a numerical label assigned to each device connected to a network that uses the Internet Protocol for communication. It identifies the device’s location on the network, allowing computers to route traffic to the correct destination.
Example: 192.168.1.1 (IPv4) or 2001:0db8:85a3::8a2e:0370:7334 (IPv6)

Let’s continue with IPV4 addresses. There are 5 classes of IPv4 addresses.
IPv4 addresses are divided into five classes based on the first octet (8 bits):
Class A
First octet range: 0–127
Number of networks: 127
Number of devices per network: 16,777,216–2=16,777,214 (2²⁴ — 2)
For example, 10.10.10.10
Each number (10 — referred to as an Octet) is considered 8 bits. The highlighted first octet represent the network portion and the last 3 octets represents the number of devices in a network, called host portion.
The last 3 octets (8bits x 3 = 24), hence (2²⁴ minus 2).
Hence, 16,777,216 — 2 = 16,777,214.
But what does the -2 represent? The -2 (minus 2) represents the two IP addresses that cannot be assigned to individual hosts in a network. Please read.
1. Network Address: This is the first address in the network, where all host bits (device octet) are set to 0. It identifies the network itself rather than any individual host.
Example (Class A): 10.0.0.0 is a network address.
Broadcast Address: This is the last address in the network, where all host bits are set to 255. It is used to communicate with all hosts in the network simultaneously like sending one email to all devices in that network. The host octets are converted to 255 as seen below.
Example (Class A): 10.255.255.255 is the broadcast address.
The number 255 in each octet signifies the broadcast address for that network. That cannot be assigned a device as well. These two addresses are reserved, meaning they cannot be assigned to individual devices within the network. Therefore, the total number of usable host addresses in a Class A network is 2²⁴ — 2, which equals 16,777,214. Typical use: Large organizations, such as internet service providers (ISPs) and governments.
— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —
Class B
First octet range: 128–191
Number of networks: 16,384
Number of hosts per network: 65,534 (2¹⁶ — 2)
Typical use: Medium-sized organizations, such as universities and corporations.
Here is an example of a Class B IP address:
172.16.10.25
In the above, the first 2 sets of numbers or octets represent the network portion and the last 2 octets represent the host portion. Each number (172 — referred to as an Octet) is considered 8 bits. The highlighted first 2 sets octets represent the network portion and the last 2 octets represents the number of devices in a network, called a host portion.
The last 2 octets (8bits x 2 = 16), hence (2¹⁶ — 2).
Hence, 65,536–2 = 65,534.
But what does the -2 represent?
The -2 (minus 2) represents the two IP addresses that cannot be assigned to individual devices in a network. Please read.
Network Address: This is the first address in the network, where all host bits are set to 0. It identifies the network itself rather than any individual host. It is called the Network Address.
Example (Class B): 172.16.0.0 is a network address.
Broadcast Address: This is the last address in the network, where all host bits are set to 255. It is used to communicate with all hosts in the network simultaneously like sending one email to all devices in that network. The host octets are converted to 255 as seen below.
Example (Class B): 172.16.255.255 is the broadcast address.
The number 255 in each octet signifies the broadcast address for that network. That cannot be assigned to a device as well. These two addresses are reserved, meaning they cannot be assigned to individual devices within a network.
— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —
Class C
First octet range: 192–223
Number of networks: 2,097,152
Number of hosts per network: 254 (2⁸ — 2)
Typical use: Small organizations and individuals.
Here is an example of a Class C IP address:
192.168.1.100
Each number (192 — referred to as an Octet) is considered 8 bits. The highlighted first 3 sets octets represent the network portion and the last octets represents the number of devices in a network, called a host portion. To determine the number of devices in a network, read the following.
The last octet (8bits x 1 = 8), hence (2⁸ — 2).
Hence, 256–2 = 254.
But what does the -2 represent?
The -2 (minus 2) represents the two IP addresses that cannot be assigned to individual devices in a network. Please read.
Network Address: This is the first address in the network, where all host bits are set to 0. It identifies the network itself rather than any individual host. It is called the Network Address.
Example (Class C): 192.168.1.0 is a network address.
Broadcast Address: This is the last address in the network. It is used to communicate with all hosts in the network simultaneously like sending one email to all devices in that network. The host octets are converted to 255 as seen below.
Example (Class C): 192.168.1.255 is the broadcast address.
The number 255 signifies the broadcast address for that network. That cannot be assigned to a device as well. These two addresses are reserved, meaning they cannot be assigned to individual devices within a network.
— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —
Class D
First octet range: 224–239
Here’s a hypothetical example of a Class D IP address:
224.0.0.1
Reserved for multicast addressing, where a single packet is sent to a group of hosts/devices. While Class D addresses are not intended for general use, they can be seen in network traffic related to multicast protocols like Internet Group Management Protocol (IGMP). In this case, 224.0.0.1 is a well-known address used for all-hosts multicast.
— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —
Class E
First octet range: 240–255
For example, 240.0.0.1
Not for general use: Reserved for experimental purposes.
The class-based addressing system has limitations, especially in terms of efficient address allocation. To address these limitations, the Classless Inter-Domain Routing (CIDR) was introduced. CIDR allows for more flexible and efficient allocation of IP addresses. This address is not assigned to any specific network or host and is primarily used for research and development purposes.
(Some terms in this content can be looked up on Google to get a basic understanding.)
===============================================================
— IPv6 ADDRESSES —
IPv6 addresses are not divided into classes like IPv4. Instead, they use a prefix-based addressing system. This means that the length of the network prefix determines the number of hosts available on a network. IPv6 is intended to replace IPv4, eventually making it the only IP address standard. However, currently, both versions coexist on the internet. While most personal computer operating systems support IPv6, many routers and servers do not.
The prefix length is expressed in bits and is indicated by a forward slash (/) after the IP address. For example, 2001:db8:0:1:1:1:1:1/64 has a prefix length of 64 bits.
Here’s a breakdown of how prefix length affects the number of hosts:
- Prefix length: The number of bits used to represent the network address.
- Host portion: The remaining bits that represent the host address.
- Number of hosts: 2^(host portion bits) — 2 (subtract 2 for the network address and broadcast address).
Example:
- 2001:db8:0:1:1:1:1:1/64
- Prefix length: 64 bits
- Host portion: 128–64 = 64 bits
- Number of hosts: 2⁶⁴ — 2 = 18,446,744,073,709,551,614
As you can see, IPv6 addresses offer a much larger address space compared to IPv4, allowing for a significantly greater number of devices to be connected to the internet.
Below are the primary types of IPv6 addresses:
1. Unicast
Definition: Unicast addresses represent a single device on a network. Data sent to a unicast address is delivered to the specified interface.
Types: Global Unicast: Similar to public IPv4 addresses, these are globally routable and unique across the entire internet.
Example: 2001:0db8::/32
2. Multicast
Definition: Multicast addresses represent a group of devices. Data sent to a multicast address is delivered to all interfaces in the group. Prefix: Multicast addresses begin with ff00::/8.
Examples:
ff02::1 (All nodes on the local link)
ff02::2 (All routers on the local link)
3. Anycast
Definition: Anycast addresses are assigned to multiple devices, and data sent to an anycast address is delivered to the nearest (in terms of routing distance) device in the group.
Usage: Typically used for services like DNS or content delivery networks (CDNs) to provide a single address for multiple locations, routing traffic to the closest server.
4. Reserved Addresses
Loopback Address: Used by a device to send packets to itself, similar to the IPv4 127.0.0.1 loopback address.
In IPv6, this is ::1/128.
For example, ::1
Unspecified Address: Represents the absence of an address and is used as a placeholder before an address is assigned. It is equivalent to 0.0.0.0 in IPv4.
For example, ::/128
5. IPv4-mapped IPv6 Addresses
Definition: These are special IPv6 addresses that represent IPv4 addresses within an IPv6 address. They are used in scenarios where IPv6-only applications need to communicate with IPv4 nodes.
Format: They begin with ::ffff: followed by the IPv4 address in hexadecimal.
For example, ::ffff:192.168.0.1
Each type of IPv6 address is designed to serve different networking purposes, ensuring versatility for both local and global communications.
(Some terms in this content can be looked up on Google to get a basic understanding.)
Keep reading!!
“Seek knowledge as if you were hungry, and thirst for it as if you were parched.” (Prophet Muhammad)
Comments
Post a Comment