STRUCTURE AND ROLE OF IP ADDRESSES IN THE INTERNET
The Internet relies on a robust system of network-layer addresses known as Internet Protocol (IP) addresses to identify devices and facilitate communication across diverse networks.
This chapter explores the fundamental aspects of IP addresses:
Their structure.
Allocation.
Assignment.
Various types used for different communication needs.
And the differences between IPv4 and IPv6.
Emphasizing how these protocols address the growing demands of the Internet.
I. Understanding IP Addresses
IP addresses are unique numerical labels assigned to each device connected to a network that uses the Internet Protocol for communication.
These addresses are essential for routing traffic and ensuring that data packets are sent to the correct destination.
Each IP address serves two primary purposes:
Host Identification: Every device on the Internet must have at least one unique IP address to be identified.
Location Addressing: IP addresses provide information about the device's location within the network, guiding routers in directing data packets to their destination.
II. Structure of IP Addresses
IP addresses can be categorized into two major versions: IPv4 and IPv6, each with its own structure.
IPv4: The most widely used version, IPv4 addresses are 32 bits long, typically expressed in decimal format as four octets (e.g., 192.168.1.1). This results in approximately 4.3 billion unique addresses.
IPv4 addresses are divided into classes (A, B, C, D, and E) for various uses, with Classes A, B, and C primarily allocated for host identification, while Class D is used for multicast and Class E is reserved for experimental purposes.
IPv6:
To accommodate the exponential growth of the Internet and the limitations of IPv4, IPv6 was introduced, utilizing a 128-bit address space.
This allows for an almost limitless number of unique addresses (approximately 340 undecillion).
IPv6 addresses use hexadecimal format, with sections separated by colons.
(e.g., 2001:0db8:85a3:0000:0000:8a2e:0370:7334).
IPv6 also includes features like auto-configuration and improved routing efficiency.
III. Allocation and Assignment of IP Addresses
The allocation and assignment of IP addresses are managed through a hierarchical system. The Internet Assigned Numbers Authority (IANA) oversees global IP address allocation, distributing large blocks of addresses to regional registries (RIRs), which in turn allocate addresses to Internet Service Providers (ISPs) and organizations.
IV. Dynamic vs. Static IP Addresses:
Dynamic IP addresses are temporarily assigned to devices by a Dynamic Host Configuration Protocol (DHCP) server. This is the most common assignment method, providing flexibility and efficient address use.
Static IP addresses are manually configured and remain constant, often used for servers and critical devices requiring a stable address.
HIERARCHICAL ADDRESSING AND ROUTING SCALABILITY
Hierarchical nature of IP addressing
Means are structured with different parts representing specific information, such as network and host.
This enhances routing scalability. By structuring IP addresses into different levels, routers can efficiently manage large amounts of traffic.
The hierarchical model allows for aggregation, where multiple addresses can be represented by a single entry in the routing table, reducing its size and improving routing efficiency.
With aggregation, the router groups multiple IP addresses under a broader range. For example, instead of listing individual addresses, it can group them like this:
192.168.1.0/24 (which means IP addresses from 192.168.1.0 to 192.168.1.255)
This way, the router sees any IP address that starts with 192.168.1. as belonging to the same group, and it can route data more efficiently.
This reduces the number of entries in the routing table and speeds up the decision-making process.
In the above, R1 is a router that connects to both the rest of the network (the internet) and other routers (R2 and R3). R1 uses route aggregation to reduce the size of its routing table.
Route Aggregation
R1 receives a route advertisement (like a summary) for the network 200.10.0.0/16 from the rest of the network. This means it knows how to route any traffic destined for any address in the range 200.10.0.0 to 200.10.255.255.
Instead of having separate entries for each subnet (smaller networks) within 200.10.0.0/16, R1 groups (aggregates) subnets into larger chunks:
200.10.0.0/17 (which covers 200.10.0.0 to 200.10.127.255).
200.10.128.0/17 (which covers 200.10.128.0 to 200.10.255.255).
These two entries are the only ones listed in R1's routing table, even though R2 and R3 further split these into smaller subnets (like 200.10.32.0/19). By doing this, R1 doesn’t need to store all the smaller subnets directly.
Key Point: Instead of keeping every small network route individually, R1 aggregates these networks into larger chunks (two /17 networks), simplifying its routing table.
Subnetting
Within larger networks, subnetting is employed to create smaller, manageable sub-networks.
This practice helps in optimizing performance and security, as well as efficient IP address utilization.
Special-Purpose Addresses
In addition to standard unicast addresses, there are special-purpose addresses used for specific functions:
Broadcast Addresses: Used to send data packets to all devices in a network segment.
In IPv4, this is typically represented by the highest address in a subnet
(e.g., 192.168.1.255 for a subnet mask of 255.255.255.0).
Multicast Addresses: Allow data to be sent to multiple devices simultaneously. IPv4 multicast addresses fall within the range of 224.0.0.0 to 239.255.255.255, facilitating efficient communication for services like streaming.
Anycast Addresses: Anycast is a one-to-nearest kind of transmission in which a single source sends a message to the nearest destination (among multiple possible destinations.
These are assigned to a group of devices, with packets routed to the nearest one in terms of network topology, optimizing response times for services like DNS.
The Role of DNS in Addressing
While IP addresses function as the foundational identifiers for devices, they are often abstracted from end-users through the Domain Name System (DNS).
DNS translates human-readable domain names (e.g., www.example.com) into IP addresses, without allowing users to interact with the Internet needing to remember numerical addresses.
However, there are scenarios where users must engage with IP addresses directly, such as network setup, troubleshooting, or when DNS fails. Understanding IP addressing becomes crucial in these instances.
IP ADDRESS ALLOCATION
Internet Devices & IP Addresses
When a device connects to the global Internet, it is assigned a unique IP address to communicate with other devices. These addresses must be carefully managed to prevent duplicates, which could cause issues on the network.
Private Networks
In private networks (such as home or office networks), IP addresses must also be managed to avoid conflicts with other private networks.
Specific ranges of IP addresses are reserved for private use to prevent overlap with addresses used on the global Internet.
Groups of IP addresses are allocated to organizations, which then assign addresses to their devices according to a network numbering plan. This ensures organized and conflict-free communication within the network.
ISPs (Internet Service Providers) usually receive large blocks of IP addresses from higher-level authorities. ISPs then allocate smaller portions of these addresses to individual users or businesses.
The ISP also handles routing the user’s traffic to the Internet and back. Users typically pay ISPs for access to the Internet, which includes receiving an IP address and the promise of routing their data.
Expressing IP Addresses
IPv4 (Internet Protocol version 4) is the most widely used format for IP addresses on the Internet.
It allows devices to identify and communicate with each other.
IPv4 addresses are often represented in a format called dotted-quad notation. For example, an IPv4 address looks like this: 165.195.130.107. This notation has several characteristics:
It consists of four decimal numbers.
Each number is separated by a period (dot).
Each number can be a non-negative integer ranging from 0 to 255.
The dotted-quad notation represents a single 32-bit nonnegative integer.
This means that each of the four decimal numbers corresponds to a segment of the overall binary address.
Each segment (number) represents 8 bits (or 1 byte) of the address. Therefore, the entire IPv4 address can be thought of as a combination of four 8-bit segments.
In many networking scenarios, it’s important to understand the binary structure of an IPv4 address, as computers use binary to process data.
There are many online tools available that can help you convert between different formats of IP addresses or provide additional information about them.
Summary
Dotted-Quad Notation is a user-friendly way to represent an IPv4 address in decimal format, making it easier for humans to read and understand.
Binary Representation shows the underlying structure of the address, which is crucial for computers and networking tasks. Each decimal segment of the IP address corresponds to an 8-bit binary number, forming a 32-bit address in total.
Understanding both representations helps in tasks like subnetting, configuring networks, and troubleshooting connectivity issues.
UNDERSTANDING IPV6 ADDRESSES
Length: IPv6 addresses are 128 bits long, which is four times larger than IPv4 addresses. Many users are less familiar with IPv6 compared to IPv4.
Hexadecimal Format: IPv6 addresses are typically written in hexadecimal (base-16) format. An address consists of eight blocks, each separated by colons.
Simplifications in IPv6 Address Representation
📌📌📌
IPv4-compatible addresses were initially meant for transitioning between IPv4 and IPv6 but are no longer required.
📌📌📌
Use of Brackets in IPv6 Addresses
Notice IPv6 uses colons not dots.
RFC 5952 Rules for IPv6 Address Representation
IPv4 Address Space:
Total Possible Addresses: 4,294,967,296 (approximately 4.3 billion).
IPv6 Address Space:
Total Possible Addresses: 340,282,366,920,938,463,463,374,607,431,768,211,456 (approximately 340 undecillion).
Address Grouping
Due to the vast number of addresses, it is convenient to categorize the address space into various types and sizes:
Let’s explain everything in this table….
Unicast Addresses
Unicast addresses are the most common type of IP address and is simply the unique IP of a device on the network.
Just like your home address points to a specific house on a street, a unicast address points to a specific device on a network.
When data is sent to a unicast address, it is delivered specifically to that one address, making it an efficient way to communicate directly between two devices.
The majority of the IPv4 address space is allocated for unicast addresses, allowing for direct one-to-one communication on the network.
Example: An example of a unicast address is 192.168.1.10, which might represent a specific computer within a home network. When someone sends a message to this address, it goes directly to that particular computer, enabling direct communication.
Multicast Addresses
Multicast addresses allow data to be sent to multiple specific interfaces at once, making them efficient for group communications, such as streaming media or online gaming.
Rather than sending separate copies of the same data to each recipient, multicast sends a single copy to a designated multicast address, and all interested recipients can subscribe to this address to receive the data.
An example of a multicast address in IPv4 is 239.255.0.1. This address can be used by a streaming service to deliver video content to all users subscribed to that stream without flooding the network with duplicate packets.
Devices interested in receiving the multicast stream join a multicast group. This is typically done through software or network configuration. The source device (e.g., a streaming server) sends data packets to the multicast address.
Routers in the network intelligently replicate and forward the packets to all interfaces connected to devices subscribed to the multicast group. All subscribed devices receive the same data, ensuring that all viewers get the same video stream at the same time. This way, multicast avoids the need for the source device to send individual copies of the data to each viewer, significantly reducing network traffic and improving efficiency.
Broadcast Addresses
Broadcast addresses are used to send data to all devices on a particular network segment simultaneously.
When a message is broadcast, every device connected to the network segment receives the data, regardless of whether it is the intended recipient.
Broadcast addressing is prevalent in IPv4 networks, but it is not commonly used in IPv6 due to its more efficient multicast addressing scheme.
Example: A typical IPv4 broadcast address is 192.168.1.255. Sending a packet to this address will result in all devices on the 192.168.1.0/24 subnet receiving the packet.
This is useful for tasks like network discovery, where a device needs to find out what other devices are present on the network.
Anycast Addresses
Anycast addresses are similar to multicast addresses but serve a different purpose.
When data is sent to an anycast address, it is delivered to the nearest device that is listening to that address, as determined by the routing protocol.
This is particularly useful for optimizing routing and load balancing across multiple servers that provide the same service.
Example: An example of anycast addressing is using the IPv6 address 2001:0db8::1 assigned to multiple servers around the world.
When a user sends a request to this anycast address, the request will be routed to the closest server (geographically or based on network topology), which can reduce latency and improve response times.
In our example, if the Kenyan DNS server is down, the user's query would be routed to the next nearest server, which in this case is the one in Madagascar.
This is the key benefit of anycast - it provides redundancy and ensures that the service remains available even if one or more servers fail.
Special-Purpose Addresses
Special-purpose addresses are reserved for specific functions within the IP addressing scheme.
These include addresses like the loopback address, which allows a device to communicate with itself, and link-local addresses that are used for communication between devices on the same local network without the need for a globally routable address.
Example: The loopback address in IPv4 is 127.0.0.1, often referred to as localhost. This address is used for testing and internal communications within a device. For IPv6, the equivalent is ::1, which serves the same purpose, allowing applications on the same machine to communicate with one another.
CLASSFUL ADDRESSING IN IPV4
In the early days of the Internet, IP addressing followed a structure called classful addressing.
This approach divided each unicast IP address into two parts:
Network Portion: Identifies the specific network on which a device resides.
Host Portion: Identifies the particular device or host within that network.
The first set of bits in an IP address determined the network, often referred to as the net number, while the remaining bits specified the host number.
Initial Purpose and Structure
A network interface is simply a connection point for a device to connect to a network e.g. Ethernet port provided by NIC or a Wi-Fi adapter.
An interface address is the IP address assigned to a specific network interface on a device.
The host address usually refers to the IP address of a device (like a computer, printer, or server) on the network.
In early networks, each device typically had only one network interface (like a single Ethernet port).
This interface would connect the device to the network and be assigned an IP address (for example, 192.168.1.5).
Since there was only one connection point, this IP address worked both as the interface address (for the network connection itself) and as the host address (for the whole device).
In other words, interface address and host address were essentially the same thing, referring to the device’s only connection to the network.
However, as the Internet grew, it became evident that networks would have different requirements in terms of the number of devices they needed to support.
Devices today have multiple connection points/network interfaces, mainly Ethernet and Wi-Fi.
Each of these interfaces are usually assigned a different private IP address, coz they are separate connections e.g.
192.168.110.12 for Wi-Fi.
192.168.110.14 for the Ethernet.
The host (your laptop or PC or server) now has multiple IP addresses, one for each interface. So different interface addresses.
So, today, the terms interface address and host address aren’t interchangeable because the host (device) can have multiple IP addresses, one for each active network connection.
This is exactly what that point was explaining—how network design evolved from a single connection per device to supporting multiple interfaces, each with its own IP address.
QC: So, what is going to be the host address, If I have multiple IP’s, multiple connections and multiple cards? Or it doesn't matter anymore? Does host address cease to exist?
When you have multiple IP addresses across different interfaces, there isn’t a single, unique host address in the way early networking defined it, because each interface’s IP address acts as an identifier for that specific host on that specific network.
In modern networking, the concept of a single host address matters less because applications and services use specific interface addresses to know which connection to use. Host Identity is determined by all the IP addresses on its interfaces rather than one unique host address.
For example, if you have:
Ethernet IP: 192.168.1.10
Wi-Fi IP: 192.168.1.11
Your host (device) is reachable on both IPs, depending on which network connection is being used. Modern networking tools, like DNS, can even register multiple IPs for a single device name, letting applications find and use whichever interface is available.
QC: But the router will have multiple choices routes back to your device, it checks the NAT table and goes? Haha, I have too many IPs for this singular device, or does it use the fastest interface e.g. ethernet?
If your device has multiple interfaces (Wi-Fi, Ethernet, etc.), each with a separate IP address, the router’s NAT table tracks each IP address and knows which IP belongs to which interface.
To accommodate varying sizes of networks and to manage IP address allocation more effectively, IP addresses were divided into five classes (Classes A through E).
Each class represents a unique balance between the number of bits used for the network portion and those allocated for the host portion.
This allowed for flexibility, enabling both large and small networks to have the address space they needed.
UNDERSTANDING IP ADDRESS CLASSES IN CLASSFUL ADDRESSING
Classful addressing was an older method of assigning IP addresses. It divided the IP address space into five classes (A, B, C, D, and E), each with a fixed number of bits dedicated to the network and host portions.
It organized IP addresses into different classes to make it easier to assign them based on how big the networks were.
Each class was meant for specific sizes of networks, helping ensure that smaller networks didn’t take up too many addresses while larger ones had enough to support their needs.
From the Classful5.html
The five classes in classful addressing (A, B, C, D, and E) were designed to optimize address distribution:
Class A: Allocated for very large networks. The first bit of a Class A address is always 0, leaving 7 bits for the network portion and 24 bits for the host portion, allowing for millions of unique addresses within the network.
Class B: Used by mid-sized networks. The first two bits are 10, leaving 14 bits for the network portion and 16 bits for the host portion.
Class C: Assigned to smaller networks. The first three bits are 110, with 21 bits for the network portion and only 8 bits for the host portion.
Class D: Reserved for multicast addresses. The first four bits are 1110, but Class D does not use a network-host division since it was intended for multicast rather than unicast addressing.
Class E: Reserved for experimental purposes. The first four bits are 1111, and like Class D, it doesn’t follow a specific network-host split as it’s not typically used in production.
This class structure shows how the bits in an IP address are divided differently for each class, which affects how many addresses are available in each class.
For example, some classes have more bits for the network part, allowing for fewer addresses, while others have more bits for the host part, providing more addresses for larger networks.
This system helped manage IP address distribution effectively during the early days of the Internet. However, it was eventually replaced by classless addressing (CIDR), which offers more flexibility and better scalability.
📌📌📌
Classful Addressing divides the IPv4 address space into fixed categories (Classes A, B, C, D, and E) with predetermined sizes.
Classless Addressing (or subnetting) allows for flexible subdivision of IP address space into smaller, manageable subnets, optimizing the use of available addresses.
📌📌📌
Classful-addressing-best-explained.html:
These images are found in the html files for this chapter.
Classful is less common these days, but there’s no harm in understanding.
Make sure you refer to this image to expand on context. I’ll call it classful image.
CLASS A – DEEP DIVE
The range 0.0.0.0 to 127.255.255.255 is the range of Class A IP addresses.
0 and 31: These represent the beginning and end of the 32-bit IP address.
8 (from classful image above): This indicates the boundary between the network portion (first 8 bits) and the host portion (remaining 24 bits) of the IP address.
First bit is always 0, which indicates that it's a Class A address or to classify it as part of that address class.
The binary representation of 10.0.0.1 is 00001010.00000000.00000000.00000001, where the first bit is 0.
The binary representation of 127.0.0.1 is 01111111.00000000.00000000.00000001, where the first bit is still 0.
Next 7 bits are used for the network portion. This allows for 128 possible networks
(28 = 128).
To calculate the number of possible hosts. The formula:
Where 𝑛 is the number of bits in the host ID.
We subtract 2 to account for the network address and the broadcast address.
Network and Host Division: The network portion occupies the first 8 bits (one byte), and the remaining 24 bits are for hosts.
Use Case: Large networks like major ISPs and large organizations, allowing over 16 million hosts on each network.
Example: An IP in Class A, like 10.0.0.1, has a network ID of 10 and can have millions of hosts.
What About 127.0.0.1?
127.0.0.1 is a special address - the loopback address or local host. The network ID for 127.0.0.0 means it’s also classified under Class A since it starts with the first bit 0.
The binary representation of 127.0.0.1 is 01111111.00000000.00000000.00000001
So, while the range of Class A includes addresses starting from 0.0.0.0 up to 127.255.255.255, all Class A addresses share the property that their first bit is 0.
Reserved addresses in Class A:
Addresses starting with 0: These are reserved for the network address and are not assignable to individual hosts.
Addresses starting with 127: These are reserved for loopback addresses, primarily used for testing network interfaces (we talked about this term).
The theoretical range of Class A addresses spans from 0.0.0.0 to 127.255.255.255.
The practical usable range typically starts from 1.0.0.0 and ends at 126.255.255.255.
Here are the three main private IP ranges for the 3 classes:
10.0.0.0 to 10.255.255.255 (Class A private range).
172.16.0.0 to 172.31.255.255 (Class B private range).
192.168.0.0 to 192.168.255.255 (Class C private range).
These IPs can’t be reached from the public internet without special configurations like NAT (Network Address Translation).
So, when a Wi-Fi router, assigns you a private IP (such as your 192.168.86.240), it’s providing a secure address that’s only valid within that local network. This prevents conflicts with public IP addresses.
Private IP addresses (e.g., 10.0.x.x or 192.168.x.x) are common on local networks, but can’t be directly accessed from the internet. Since 10.x.x.x addresses are reserved for private networks, any device with this address is hidden behind the network’s public IP.
Public IP addresses are globally unique addresses that allow devices to communicate over the internet. These are assigned by ISPs (Internet Service Providers) and are routable on the internet.
The 10.0.0.0/8 network(meaning the range from 10.0.0.0 to 10.255.255.255) is a private network range defined by RFC 1918. Messages sent to 10.255.255.255 are broadcast to all devices within this network.
CLASS B– DEEP DIVE
First 2 bits are always '10' (to identify it as Class B).
To avoid confusion with class A addressing, each class has a specific bit pattern in the beginning to identify it.
This means the first few bits are reserved to tell what type (or class) of address it is.
To differentiate among the classes, the designers decided on unique starting patterns for each class:
Class A addresses start with 0.
Class B addresses start with 10.
Class C addresses start with 110.
Class D addresses start with 1110 (used for multicast).
Class E addresses start with 1111 (reserved for future or experimental use).
By looking at just the first few bits, the network can tell which class the address belongs to.
Why Exactly ‘10’ for Class B?
The designers wanted to reserve different portions of the IP address space for different-sized networks:
Class A (starting with 0): Very large networks with many hosts.
Class B (starting with 10): Medium-sized networks.
Class C (starting with 110): Small networks with fewer hosts.
Network capacity: The first two bits, which are fixed, represent the network portion of the address. This means that there are 14 bits left for the network ID, allowing for a maximum of –
214 - (16,384) different networks.
Host capacity: The remaining 16 bits are used for the host portion of the address. This allows for a maximum of – 216 (65,536) hosts per network.
Reserved Addresses
Network Address: All bits set to 0. This address represents the entire network itself and cannot be assigned to a specific host.
Broadcast Address: All bits set to 1. This address is used to send messages to all devices within the network simultaneously.
Therefore, the actual number of usable host addresses per Class B network is:
65,536 - 2 = 65,534.
Class B IP addresses range from 128.0.0.0 to 191.255.255.255 in decimal notation or 10000000.00000000.00000000.00000000 to 10111111.11111111.11111111.11111111 in binary.
Why is Class B considered the balancing point?
Medium-sized networks: Class B addresses are suitable for medium-sized networks that require more hosts than Class C networks but fewer than Class A networks.
Flexible addressing: The balance between network and host capacity allows for a flexible allocation of IP addresses to different networks, depending on their size and needs.
CLASS C DEEP DIVE
Class C IP addresses are designed for small networks that require a limited number of hosts. They are characterized by their unique bit pattern and specific allocation of bits for network and host identification.
The first three bits of a Class C IP address are always 110. This pattern immediately identifies the address as belonging to Class C. The remaining bits are divided into two parts:
Network ID: The first 21 bits represent the network ID. This allows for a massive number of 221 (over 2 million) potential networks.
Host ID: The last 8 bits represent the host ID, allowing 28 (256) hosts per network.
Therefore, the actual number of usable host addresses per Class C network is 256 - 2 = 254.
Class C IP addresses range from 192.0.0.0 to 223.255.255.255.
Ideal for small networks with a limited number of devices. Allows for a massive number of networks.
CLASS D DEEP DIVE
Class D IP addresses are specifically designed for multicast communication. Unlike unicast, where a message is sent from a single source to a single destination, multicast allows a single message to be sent to a group of multiple destinations simultaneously.
The first four bits of a Class D IP address are always 1110.
This unique pattern instantly identifies the address as belonging to Class D.
The remaining 28 bits are used for the multicast group address.
Multicast Groups
A multicast group is a logical grouping of network interfaces that share a common interest.
When a device sends a message to a multicast group address, the message is delivered to all members of that group.
This is particularly useful for applications like video conferencing, online gaming, and software updates, where the same data needs to be sent to multiple recipients.
A collection of devices that receive the same data stream from a single source.
Multicast groups can be static or dynamic, meaning that the membership of a group can be fixed or change over time.
Class D IP addresses range from 224.0.0.0 to 239.255.255.255.
Key Points to Remember
Efficiency: Multicasting significantly reduces network traffic compared to unicasting to multiple individual destinations.
Flexibility: Multicast groups can be dynamically created and joined, allowing for flexible communication patterns.
Security: Multicast addresses are not routable on the public internet, enhancing network security.
In summary, Class D IP addresses play a crucial role in enabling efficient and scalable multicast communication across networks.
CLASS E DEEP DIVE
Class E IP Addresses are a special class of IP addresses that are reserved for experimental use. They were originally set aside for future protocols or special-purpose networks.
The first four bits of a Class E IP address are always 1111. This unique pattern instantly identifies the address as belonging to Class E.
The remaining 28 bits are currently unused and reserved for future purposes by the Internet Engineering Task Force (IETF) and other organizations. It is not meant for general use or for assignment to end-user devices.
Subnetting Limitations: Class E addresses are not commonly subnetted. Since these addresses are not intended for public use, the implications of subnetting are mostly theoretical in this case.
No Defined Usage: Class D addresses are used for sending messages to a group of computers at once (multicasting). However, Class E addresses don't have a specific use like that. They are basically reserved and not being used for anything particular right now.
This is page 36 of the Book, I was stuck on this chapter for days.
I did my best bringing out the concepts in an easy way.
See you in the next chapter… Subnetting.