IPv4 Address Fundamentals
From the networking curriculum
IPv4 Address Fundamentals
TL;DR
IPv4 addresses are 32-bit logical addresses crucial for unique device identification at the Network Layer. They are structured into network and host portions, enabling communication within specific networks and across the internet. Different types of IPv4 addresses, like unicast, broadcast, and multicast, facilitate varied communication patterns.
1. The Mental Model
Think of an IPv4 address like a house address. Just as a house number and street name uniquely identify where mail goes, an IPv4 address uniquely identifies a device on a network, allowing data packets to find their correct destination. The "network portion" is like the street name, and the "host portion" is like the house number.
2. The Core Material
What is an IPv4 Address?
An IPv4 address is a logical address used at Layer 3 (the Network Layer) of the networking model. Every device connected to a network, whether it's your desktop, laptop, smartphone, or a printer, must have a unique IP address. This 32-bit hierarchical address is what routers use to move data packets between different networks.
IPv4 Address Structure
An IPv4 address is made up of 4 blocks, with each block ranging from 0-255. It's a 32-bit hierarchical address divided into two main parts: a network portion and a host portion.
Here's how these parts work together:
* Network Portion: Identifies the specific network the device belongs to. All devices on the same network share the same network portion.
* Host Portion: Uniquely identifies a specific device within that network.
You'll often see something called a prefix length used with an IPv4 address. This is a shorter way to identify the subnet mask, which helps define where the network portion ends and the host portion begins. For example, /24 means the first 24 bits are the network portion.
Types of IPv4 Addresses Within a Network
Within any given network, there are three main types of IP addresses:
* Network address: This is the first address in a network block. It represents the entire network itself and is not assigned to individual devices.
* Host addresses: These are the IP addresses assigned to end devices (like your computer, phone, etc.).
* Broadcast address: This is the last address in a network block. A packet sent to this address reaches all devices on that specific network.
graph TD
A["IPv4 Address (32-bit)"] --> B["Network Portion"]
A --> C["Host Portion"]
B --> D["Identifies the network"]
C --> E["Identifies a device within the network"]
F["Prefix Length"] --> B
F --> C
G["Subnet Mask"] --> B
G --> C
Unicast, Broadcast, and Multicast Transmissions
IPv4 addresses support different ways to send data:
* Unicast: Sending a packet to one specific destination IP address. This is how most of your internet traffic works (e.g., your computer requesting a webpage from a single server).
* Broadcast: Sending a packet to all other destination IP addresses on the local network. An example might be a device searching for a printer on the network.
* Multicast: Sending a packet to a multicast address group. This means specific devices that have joined that group will receive the packet (e.g., streaming video to multiple, but not all, subscribed users).
Public and Private IPv4 Addresses
Not all IPv4 addresses are the same regarding their reachability:
* Private IP addresses: These are specific ranges of IP addresses that are not routable on the internet. Organizations use these internally for their "intranet" (internal network). They are common because they allow many devices to have IP addresses without depleting the limited pool of public IPv4 addresses.
* Public IP addresses: These are globally unique and routable on the internet. When your home network connects to the internet, your router typically gets a public IP address from your Internet Service Provider (ISP).
To allow devices with private IP addresses to communicate with devices on the public internet, Network Address Translation (NAT) is used. NAT translates private IPv4 addresses to public IPv4 addresses when traffic leaves the internal network.
IPv4 Address Conservation
The original IPv4 design didn't anticipate the massive growth of the internet. Techniques like Variable Length Subnet Masking (VLSM) help conserve IPv4 addresses by allowing different subnet masks for different network sizes based on their requirements, optimizing the use of available addresses.
Regional Internet Registries (RIRs) are responsible for allocating IP addresses to ISPs, who then provide blocks to smaller ISPs and organizations.
3. Worked Example
Let's consider a simple IPv4 address: 192.168.1.10 with a prefix length of /24.
- IPv4 Address:
192.168.1.10 - Prefix Length:
/24(This tells us the first 24 bits are for the network, and the remaining 8 bits are for the host.) - Subnet Mask (implied by /24):
255.255.255.0
From this, we can determine:
* Network Address: 192.168.1.0 (All host bits are zero). This identifies the network.
* Host Address: 192.168.1.10 (This specific address is assigned to a device).
* Broadcast Address: 192.168.1.255 (All host bits are one). Sending data to this address reaches all devices on the 192.168.1.0 network.
192.168.1.0/24 is also an example of a common private IP address range, meaning devices with addresses in this range can communicate within your home network but need NAT to access the public internet.
4. Key Takeaways
- IPv4 addresses are 32-bit logical identifiers at the Network Layer, essential for every network-connected device.
- Each IPv4 address is divided into a network portion and a host portion, with the prefix length indicating this division.
- There are specific addresses for the network itself, individual hosts, and for broadcasting to all hosts in a network.
- Unicast, broadcast, and multicast describe different ways data can be sent to destinations using IPv4.
- Private IPv4 addresses are used for internal networks (intranets) and require NAT for internet communication, unlike public IPv4 addresses.
- VLSM and RIR allocations are critical for efficiently managing the finite supply of IPv4 addresses.
- Your router needs to translate binary (what computers understand) to decimal (what we typically use) for IPv4 addresses.
Common Mistakes to Avoid:
- Don't confuse physical (MAC) addresses with logical (IP) addresses; they operate at different network layers.
- Forgetting that private IP addresses cannot be directly routed over the internet without NAT.
- Assigning the network address or broadcast address to a host device.
- Misunderstanding the role of the prefix length in defining the network and host portions.
5. Now Try It
Choose an IPv4 address like 172.16.5.30 and a prefix length of /20. Now, identify the network address, a possible host address range for this network, and the broadcast address. Then, state whether this is likely a public or private IP address and why.
Frequently asked about IPv4 Address Fundamentals
More from networking
Get the full networking curriculum
Clone the complete plan to your dashboard for unlimited AI-generated notes, practice quizzes, and a personalised revision schedule.
Create Free Account