When we talk about IP addresses in networking, we're actually referring to two components working together:
IP_address/subnet_mask → Network_Prefix + Host_Identifier
Your example illustrates a critical nuance: 180.70.65.140/26
, 180.70.65.140/25
, and 180.65.140/24
are three distinct network destinations because:
- Each defines a different network boundary
- They belong to separate broadcast domains
- Routing treats them as entirely separate paths
Consider these routing table entries:
# Linux route command examples
route add -net 180.70.65.128 netmask 255.255.255.192 dev eth0 # /26
route add -net 180.70.65.128 netmask 255.255.255.128 dev eth1 # /25
route add -net 180.70.65.0 netmask 255.255.255.0 dev eth2 # /24
This configuration is valid because:
- Routers evaluate the longest prefix match first
- Traffic for 180.70.65.140/26 would never reach the /25 or /24 routes
- Each subnet represents a separate logical network
While technically possible, assigning the same IP with different masks to multiple devices causes problems:
# Potential configuration (not recommended)
Device A: ifconfig eth0 180.70.65.140 netmask 255.255.255.192
Device B: ifconfig eth0 180.70.65.140 netmask 255.255.255.128
Device C: ifconfig eth0 180.70.65.140 netmask 255.255.255.0
Key issues would arise when:
- Devices attempt ARP resolution for the same IP
- Applications try to bind to the same socket
- Network troubleshooting becomes ambiguous
Classless Inter-Domain Routing (CIDR) solves this through explicit prefix notation:
# Python subnet calculation example
import ipaddress
net26 = ipaddress.IPv4Network("180.70.65.140/26")
net25 = ipaddress.IPv4Network("180.70.65.140/25")
net24 = ipaddress.IPv4Network("180.70.65.140/24")
print(f"/26 network: {net26.network_address}")
print(f"/25 network: {net25.network_address}")
print(f"/24 network: {net24.network_address}")
This outputs clearly distinct network addresses, demonstrating they're separate entities.
When planning subnets:
- Allocate larger blocks first (/24 before /25 before /26)
- Document all subnet assignments meticulously
- Use IPAM tools for tracking allocations
# Sample IPAM database schema
CREATE TABLE ip_allocations (
network CIDR PRIMARY KEY,
owner TEXT,
purpose TEXT,
date_allocated DATE
);
In IPv4 networking, an IP address with different subnet masks represents distinct network segments, even though the host portion appears identical. The key concept is that the network prefix (determined by the subnet mask) fundamentally changes the address's network context.
Consider these three addresses:
180.70.65.140/26 → Network: 180.70.65.128/26 (range: 180.70.65.128-191)
180.70.65.140/25 → Network: 180.70.65.128/25 (range: 180.70.65.128-255)
180.70.65.140/24 → Network: 180.70.65.0/24 (range: 180.70.65.0-255)
Each represents a different logical network despite sharing the same host IP. Here's how routing distinguishes them:
When implementing network configurations:
# Example routing table entries
route add 180.70.65.128 mask 255.255.255.192 10.1.1.1 # /26 route
route add 180.70.65.128 mask 255.255.255.128 10.1.1.2 # /25 route
route add 180.70.65.0 mask 255.255.255.0 10.1.1.3 # /24 route
The Classless Inter-Domain Routing (CIDR) system enables this flexibility:
- Allows efficient allocation of IP space
- Permits hierarchical routing through longest prefix matching
- Enables multiple organizations to use same host IPs in different networks
Python code to demonstrate network differences:
import ipaddress
addr1 = ipaddress.IPv4Network("180.70.65.140/26")
addr2 = ipaddress.IPv4Network("180.70.65.140/25")
addr3 = ipaddress.IPv4Network("180.70.65.140/24")
print(f"/26 network: {addr1.network_address} with mask {addr1.netmask}")
print(f"/25 network: {addr2.network_address} with mask {addr2.netmask}")
print(f"/24 network: {addr3.network_address} with mask {addr3.netmask}")
When Host A (180.70.65.140/26) communicates with Host B (180.70.65.140/24):
- Host A checks if destination is in 180.70.65.128/26 network
- Determines Host B is outside its subnet
- Sends packet to default gateway for routing
- Router performs longest prefix match to determine correct path