Table of Contents
Overview
IPv4 is the most widely used addressing system on today’s Internet. It gives every device a logical address so that data can be sent to the right destination. In this chapter you will focus on what an IPv4 address is, how it is written, what its internal structure looks like, and a few essential behaviors that are unique to IPv4.
You will not design subnets or do calculations here. Those topics belong to later chapters such as Classful Addressing, Subnet Masks, and CIDR. For now, the goal is to become comfortable reading and recognizing IPv4 addresses and understanding what they represent.
IPv4 Address Structure
An IPv4 address is a 32 bit number. A bit is a single binary digit, either 0 or 1. If you wrote an IPv4 address in pure binary it would have 32 characters, like this example:
$$11000000\ 10101000\ 00000001\ 00001010$$
Humans do not normally use this binary format. Instead IPv4 addresses are grouped into four chunks of 8 bits, called octets, and each octet is written as a decimal number between 0 and 255.
For example, the binary number above corresponds to the address:
$$192.168.1.10$$
Each octet is one byte, so an IPv4 address is 4 bytes long.
An IPv4 address is always:
• 32 bits in length
• Written as 4 decimal octets separated by dots
• Each octet ranges from 0 to 255
The total number of possible IPv4 addresses is:
$$2^{32} = 4{,}294{,}967{,}296$$
In practice, not all of these can be used directly for hosts, because some ranges are reserved for special purposes. The idea that there is a finite pool of about 4.3 billion addresses is central to why later technologies like private addressing and IPv6 exist, but those are covered in other chapters.
Dotted Decimal Notation
The most common human readable representation of an IPv4 address is called dotted decimal notation. It has these properties:
- Four decimal numbers.
- Each number corresponds to an 8 bit binary value.
- Dots separate the octets, there are exactly three dots.
Here are some examples:
| Binary (32 bits) | Dotted decimal |
|---|---|
| 00001010 00000000 00000000 00000001 | 10.0.0.1 |
| 11000000 10101000 00000000 00000001 | 192.168.0.1 |
| 01111111 00000000 00000000 00000001 | 127.0.0.1 |
| 00101010 00110011 00000101 11110000 | 42.51.5.240 |
You will learn systematic binary to decimal conversion in a later chapter. For now, it is enough to understand that each octet is just a decimal representation of 8 bits.
When you see something like “IP: 192.168.1.1” in a configuration or a screenshot, that is dotted decimal notation for an IPv4 address.
Network and Host Portions
Logically, an IPv4 address has two parts:
- A network part that identifies which network the device belongs to.
- A host part that identifies the specific device within that network.
An analogy is a street address. The network part is similar to the street name, and the host part is similar to the house number. Two houses on different streets can both be number 10, because the street names are different. In the same way, two devices in different IP networks can have the same host part, but they remain unique when combined with their network parts.
In IPv4, where the boundary sits between network and host is not fixed. You will use subnet masks and CIDR notation to define that boundary in later chapters. At this stage just remember that:
- The entire 32 bit address is not one flat identifier.
- Part of it identifies “where” the device is.
- Part of it identifies “which” device it is at that place.
Routers mainly care about the network part, because it tells them where to send traffic. Devices on the same network care about the host part, because that is how they distinguish each other.
Special Host Values: Network and Broadcast
Within any IPv4 network, two special host values are reserved:
- The all zeros host value.
- The all ones host value.
These are not used for individual devices. Instead they represent special addresses for the network itself and for broadcast traffic.
In a particular network:
- The address with all host bits set to 0 identifies the network. It is called the network address.
- The address with all host bits set to 1 is the broadcast address for that network.
You will calculate these addresses in detail when you learn about subnet masks and subnetting. For now you only need the idea that in each IPv4 network the first and last addresses in the range are reserved and are not assigned to normal hosts.
Within any IPv4 network:
• The all 0 host part is the network address.
• The all 1 host part is the broadcast address.
Neither of these can be used by a host.
Special Types of IPv4 Addresses
Not every IPv4 address is used for ordinary hosts that communicate globally. Some ranges and patterns have special roles. You will study public and private ranges in a separate chapter, so this section focuses on the fundamental special behaviors that are unique to IPv4 itself.
Loopback Addresses
The loopback range is used by a device to send traffic to itself. It never leaves the device or reaches the physical network. The best known example is 127.0.0.1, often called “localhost.”
In IPv4, the entire range from 127.0.0.0 to 127.255.255.255 is reserved for loopback. Any address in this range has the same basic behavior. If you “ping” 127.0.0.1 your computer is testing its own networking stack, not your network cable or Wi Fi.
Link Local Addresses
IPv4 reserves the range 169.254.0.0 to 169.254.255.255 for link local addresses. These are used automatically when a device cannot obtain an address from a server such as DHCP. The address is valid only on the local link and is not meant for routing to other networks.
On many systems, if you connect a device directly to a switch with no DHCP server, you might see it assign itself an address starting with 169.254. That usually means it could not get a “normal” configured address.
Unspecified Address
The unspecified IPv4 address is 0.0.0.0. It does not refer to any particular host. Operating systems often use 0.0.0.0 in configuration to represent “no address yet” or to mean “all IPv4 addresses on this device.” Routing and NAT chapters will explore its different roles in more depth.
Broadcast Address
There are two main ideas of broadcast in IPv4:
- The limited broadcast address 255.255.255.255. This is used to send traffic to all hosts on the local network when the sender does not yet know anything about the network boundaries.
- The directed broadcast to a specific network. In that case, all host bits for that network are set to 1. For example, if a network has addresses from 192.168.1.0 to 192.168.1.255, then 192.168.1.255 is the directed broadcast for that network.
Directed broadcasts are often disabled by default on routers for security reasons, which you will see in routing and security chapters. The important point here is that IPv4 has a concept where one packet can be addressed to “all hosts” in a network by using a special broadcast address.
Unicast, Broadcast, and Multicast in IPv4
Every IPv4 packet is addressed in a way that determines how many recipients it targets.
In basic IPv4 you will encounter three addressing styles:
- Unicast. One sender to one specific receiver. Most everyday communication uses unicast. For example, your computer sending traffic to 8.8.8.8 is unicast.
- Broadcast. One sender to all hosts in a local network. The source uses a broadcast address so that every device in that network receives and processes the packet.
- Multicast. One sender to a selected group of receivers that have joined a particular multicast group. The address identifies the group, not a single host.
IPv4 reserves the range 224.0.0.0 to 239.255.255.255 for multicast addresses. Various protocols use these addresses to deliver data efficiently to multiple receivers, for example for streaming or routing control messages.
IPv4 addressing types:
• Unicast: one to one
• Broadcast: one to all in the local network
• Multicast: one to many selected receivers
You will look at how Ethernet and switches treat broadcasts and multicasts in detail later. For now, recognize that these three styles are built into how IPv4 addresses are used.
Human Conventions and Readability
Because IPv4 addresses appear frequently in logs and configurations, there are some common conventions when humans write them:
- Leading zeros in an octet are usually omitted. People write 10.0.0.1, not 010.000.000.001.
- Each octet must still represent a value between 0 and 255. Something like 300.1.2.3 is not a valid IPv4 address.
- The total number of octets must be exactly four. Anything with two or five numbers separated by dots is not a valid standard IPv4 address.
Here is a small comparison table:
| Written form | Valid IPv4? | Comment |
|---|---|---|
| 192.168.1.10 | Yes | Common and correct |
| 192.168.001.010 | Yes | Technically valid, but uncommon for humans |
| 10.0.0 | No | Only three octets |
| 256.10.10.10 | No | 256 is out of range |
| 192.168.1.10.5 | No | Five octets |
Different tools may accept or reject unusual forms differently, but for clean network documentation and beginner practice, you should always use the simple, four octet dotted decimal format.
IPv4 and the Idea of Addresses per Network
Although the details of calculating sizes belong to the Subnetting chapter, it is useful to understand a fundamental property of IPv4 networks now. The number of usable host addresses in a network depends on how many bits are allocated to the host part.
If a network uses $h$ bits for hosts, then the total number of different host combinations is $2^h$. However, two of those combinations are reserved for the network and broadcast addresses, as mentioned earlier. This leads to a common IPv4 pattern:
For a normal IPv4 network with $h$ host bits:
Total addresses: $2^h$
Usable host addresses: $2^h - 2$
You will apply this formula in detail when you learn subnet planning. At this stage, it prepares you for the idea that IPv4 networks always have slightly fewer usable addresses than the raw total suggests.
Practical Examples
Here are a few complete examples to tie the concepts together.
Consider the address 192.168.1.100. You can say:
- It is an IPv4 address in dotted decimal format.
- It has 4 octets, each between 0 and 255.
- It has an internal split between network and host parts, which depends on the subnet mask. That will be defined elsewhere.
- Depending on that mask, 192.168.1.0 is probably the network address, and 192.168.1.255 is probably the broadcast address, but you must know the mask to be sure.
Now consider 127.0.0.1:
- It is part of the 127.0.0.0/8 loopback range.
- Any packet sent to 127.0.0.1 stays on the local device.
- It is not used to identify a host on a physical network.
Finally, consider 255.255.255.255:
- In IPv4, this is the limited broadcast address.
- A packet sent to this address is intended for every host on the local network.
- Routers typically do not forward this packet to other networks.
These examples show how an IPv4 address is not just a number, but also carries meaning about how the network will treat a packet.
Summary
IPv4 provides 32 bit logical addresses for devices, written as four dotted decimal octets. Inside each address there is a network part and a host part, which determine where a device lives and which specific device it is within that network. Some addresses and ranges have special roles, such as loopback, link local, broadcast, and multicast.
Understanding what an IPv4 address looks like and what the basic special ranges are will make it much easier to learn about subnet masks, classful addressing, CIDR, and subnetting in the following chapters.