Special IPv4 Addresses
Special IPv4 Addresses
In IPv4, some addresses are reserved for special purposes rather than being assigned normally to individual devices. The following are five important special address types.
| Special address | IPv4 block/address | Main purpose |
|---|---|---|
| This-host address | 0.0.0.0/32 | Used when a host does not yet know its own IP address |
| Limited-broadcast address | 255.255.255.255/32 | Sends a packet to all devices in the local network |
| Loopback address | 127.0.0.0/8 | Testing software/networking on the same computer |
| Private addresses | 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, 169.254.0.0/16 | Used for private/local networks |
| Multicast addresses | 224.0.0.0/4 | Sending data to a group of devices |
Let's understand each one with simple examples.
1. This-Host Address — 0.0.0.0/32
The address:
0.0.0.0
is called the this-host address.
It is used when a host wants to send an IP datagram but does not know its own IP address yet.
Example
Suppose a computer has just started and is trying to obtain an IP address. At this point, it does not know its own IP address.
It may use:
Source IP = 0.0.0.0
This essentially means:
"This host, whatever my current IP address is."
So, 0.0.0.0 is not normally assigned to a computer as its permanent IP address.
2. Limited-Broadcast Address — 255.255.255.255/32
The address:
255.255.255.255
is called the limited-broadcast address.
It is used when a host wants to send a packet to all devices on the local network.
Example
Suppose a network contains:
PC1 PC2 PC3 PC4
If PC1 sends a packet to:
Destination IP = 255.255.255.255
the packet is intended for all devices on that local network.
┌── PC2 │ PC1 ─────────┼── PC3 │ └── PC4 Destination: 255.255.255.255 ↓ All devices locally
Important point
Routers do not forward a packet with destination 255.255.255.255.
Therefore, the broadcast remains within the local network.
3. Loopback Address — 127.0.0.0/8
The entire block:
127.0.0.0/8
is reserved for loopback.
A commonly used loopback address is:
127.0.0.1
When a computer sends a packet to a loopback address, the packet does not leave the computer.
It comes back to the same host.
Computer ┌───────────┐ │ │ │Application│ │ ↓ │ │ 127.0.0.1 │ │ ↓ │ │ Loopback │ │ ↑ │ └───────────┘
Example
Suppose you develop a client-server application.
You can run both the client and server on the same computer:
Client ↓ 127.0.0.1 ↓ Server
This allows you to test the networking software without requiring two computers.
Easy way to remember
Loopback = Talk to myself
4. Private Addresses
The following identifies four blocks as private addresses:
10.0.0.0/8 172.16.0.0/12 192.168.0.0/16 169.254.0.0/16
These addresses are used for private/local networks.
For example, a home network might use:
Router 192.168.0.1 | ┌───┼────────┐ PC1 PC2 Phone 192.168.0.2 192.168.0.3
These addresses are used inside the local network and are not used as globally unique Internet addresses in the same way as public addresses.
We later discusses their use with NAT (Network Address Translation).
Examples of private addresses
10.1.2.3 172.16.5.10 192.168.1.20
5. Multicast Addresses — 224.0.0.0/4
The block:
224.0.0.0/4
is reserved for multicast.
Multicast means sending data to a group of receivers.
It is different from broadcast.
Broadcast
One sender → every device
PC2 ↑ PC1 ───────┼──→ PC3 ↓ PC4
Multicast
One sender → only members of a particular group
PC2 ✓ ↗ PC1 ───────────→ PC3 ✓ ↘ PC4 ✗
Here, PC2 and PC3 belong to the multicast group, while PC4 does not.
Comments
Post a Comment